我运行一个WiX的软件包安装。 其中MSI软件包应该关闭,如果运行的应用程序:
<util:CloseApplication Id="CloseApplication" Target="My App.exe">1</util:CloseApplication>
这在<Product>
的前元件<Feature>
元素。 我加了1
,确保条件为真。
MSI日志有这样一段话:
MSI (s) (14:94) [21:30:13:979]: Doing action: WixCloseApplications
Action ended 21:30:13: CreateFolders. Return value 1.
MSI (s) (14:68) [21:30:13:993]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI5D24.tmp, Entrypoint: WixCloseApplications
MSI (s) (14!CC) [21:30:14:023]: PROPERTY CHANGE: Adding WixCloseApplicationsDeferred property. Its value is 'My App.exe2'.
Action start 21:30:13: WixCloseApplications.
MSI (s) (14!CC) [21:30:14:023]: Doing action: WixCloseApplicationsDeferred
Action start 21:30:14: WixCloseApplicationsDeferred.
Action ended 21:30:14: WixCloseApplicationsDeferred. Return value 1.
MSI (s) (14:94) [21:30:14:052]: Doing action: InstallFiles
Action ended 21:30:14: WixCloseApplications. Return value 1.
Action start 21:30:14: InstallFiles.
如果我设置的提示为“no”是这样的:
<util:CloseApplication Id="CloseApplication" Description="Closing running application" Target="My App.exe" RebootPrompt="no" ElevatedCloseMessage="no" CloseMessage="no">1</util:CloseApplication>
日志这样说:
MSI (s) (50:04) [21:43:40:214]: Doing action: WixCloseApplications
Action ended 21:43:40: CreateFolders. Return value 1.
MSI (s) (50:14) [21:43:40:238]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIFFA9.tmp, Entrypoint: WixCloseApplications
Action start 21:43:40: WixCloseApplications.
MSI (s) (50:04) [21:43:40:333]: Doing action: InstallFiles
Action ended 21:43:40: WixCloseApplications. Return value 1.
Action start 21:43:40: InstallFiles.
无论哪种方式,安装完成,但原来的应用程序仍在运行,并且不会被关闭。
有问题的应用程序是一个WPF应用程序,我有<MajorUpgrade Schedule="afterInstallExecute" ...
和安装使用来自WiXBA修改的管理boostrapper运行。