windowswixwindows-installerinstallation

Can Wix skip InstallValidate during installation on Windows


I'm using Wix for packaging an app-service-controller, app-service, app-core and a app-tray into an installer. During upgrading, the installer does an Installvalidate step which complaints about the file in use from all my processes.

Install output as below

Info 1603.The file C:\Program Files\app\app-service-controller.exe is being held in use by the following process: Name: app-service-controller, Id: 26308, Window Title: '(not determined yet)'.  Close that application and retry.
Info 1603.The file C:\Program Files\app\app-service.exe is being held in use by the following process: Name: app-service, Id: 26028, Window Title: '(not determined yet)'.  Close that application and retry.
Info 1603.The file C:\Program Files\app\app-core.exe is being held in use by the following process: Name: app-core, Id: 25932, Window Title: '(not determined yet)'.  Close that application and retry.
Info 1603.The file C:\Program Files\app\app-tray.exe is being held in use by the following process: Name: app-tray, Id: 25856, Window Title: '(not determined yet)'.  Close that application and retry.
MSI (s) (A0:30) [12:43:46:999]: 4 application(s) had been reported to have files in use.
MSI (c) (04:48) [12:43:47:000]: File In Use: -app-service-controller- Window could not be found. Process ID: 26308
MSI (c) (04:48) [12:43:47:000]: File In Use: -app-service- Window could not be found. Process ID: 26028
MSI (c) (04:48) [12:43:47:000]: File In Use: -app-core- Window could not be found. Process ID: 25932
MSI (c) (04:48) [12:43:47:001]: File In Use: -app-tray- Window could not be found. Process ID: 25856
MSI (c) (04:48) [12:43:47:001]: No window with title could be found for FilesInUse

The problem is it takes a long time, about 5-10mins, to pass that stage then it reinstalls everything fine. Is there any way to make it quicker or even skip it?

Wix code that related to app-service

<ServiceInstall
    Id="ServiceInstall" Name="App-Service-Controller" DisplayName="$(var.Name)"
    Description="Controls the $(var.Name) foreground processes."
    Type="ownProcess" Start="auto" ErrorControl="normal">
    <util:ServiceConfig
        FirstFailureActionType='restart'
        SecondFailureActionType='restart'
        ThirdFailureActionType='restart'
        RestartServiceDelayInSeconds='1'
        ResetPeriodInDays='1'/>
    </ServiceInstall>
<ServiceControl
    Id="ServiceControl" Name="App-Service-Controller"
    Start="install" Stop="both" Remove="uninstall" Wait="yes"/>

Related posts:

MSI: How a Service is stopped on uninstall during InstallValidate - could that work anyway?

How does the MSI Installer InstallValidate determine files in use?


Solution

  • Correct me if I'm wrong.

    So I end up creating a new process that can be executed before InstallValidate. Within that process, I use RPC the tell my service to stop.