【发布时间】:2018-03-12 17:30:18
【问题描述】:
我正在使用 Wix 将 app-service-controller、app-service、app-core 和 app-tray 打包到安装程序中。在升级过程中,安装程序会执行 Installvalidate 步骤,该步骤会抱怨我所有进程正在使用的文件。
如下安装输出
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
问题是它需要很长时间(大约 5-10 分钟)才能通过该阶段,然后重新安装一切正常。有什么方法可以让它更快甚至跳过它?
应用服务相关的Wix代码
<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"/>
相关帖子:
MSI: How a Service is stopped on uninstall during InstallValidate - could that work anyway?
How does the MSI Installer InstallValidate determine files in use?
【问题讨论】:
-
明确地说,这些实际的 Windows 服务是否使用 ServiceControl 元素安装并使用 ServiceControl 停止?我还要补充一点,检查正在使用的文件并不是 InstallValidate 所做的唯一事情。
-
好电话,我已经更新了问题,谢谢
标签: windows wix windows-installer installation