1
votes

I've got a .NET 4 desktop application with a MSI installer developed with Wix.

Currently when my application is running minimized to the system tray and user tries to deinstall it from Control Panel, deinstallation comes through, the files from ProgramFiles location get removed and still running application throws me a bunch of exceptions.

To prevent this I've got a custom action set in my wxs file defined like this:

<Custom Action="CheckForRunningInstance" After="ValidateProductID">(REMOVE="ALL") OR NOT(REMOVE="ALL")</Custom>

It is to check if any instance of my application is currently running to prevent the installer from proceding. It works okay if I try to run my MSI file, however this CA is not run when a user tries to uninstall the application from Control Panel > Add/Remove programs. Is there any way to force it in such situation?

1

1 Answers

2
votes

You need to place the custom action in InstallExecuteSequence so it gets called even when the package is not running with full UI.