I am using Windows Installer XML 3.0 (WIX3) to install some software.
Everything works fine, however, I'm having a really hard time to handle the following use case: the installed software is still running, when the user tries to uninstall it. The default behavior seems to remove all files but lets the application running (which is hard to see in my case, because it's sitting in the task tray).
I added the following code in my installer.wxs
file:
<InstallExecuteSequence>
<Custom Action="WixCloseApplications" Before="RemoveFiles" />
</InstallExecuteSequence>
<util:CloseApplication Id="CloseFoobar"
CloseMessage="no"
Description="FooBar is still running!"
ElevatedCloseMessage="no"
RebootPrompt="no"
Target="foobar.exe" />
But this doesn't work - even worse, it shows a dialog that asks for a reboot during install!
What would be the correct way to do it?
As far as I remember it should be enough to add the following references to your UI:
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
The CloseApplication stuff is only for closing applications during install, but it is buggy (at least when I tried it some months ago, maybe it's fixed now?)
Unfortunately, this is again an example for the very poor documentation of WiX, not even standard install/uninstall scenarios like this one are documented.
There was a similar question asked on the wix-users mailing list a couple of days ago. The answer given there was:
This is the way that Windows works pre-Vista and Restart Manager. There has to be a top-level window available. An app in the tray doesn't count.
There are a few threads on the topic in the wix-users archive as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With