0
votes

In my installation package I have tool which allows to stop my main application.
I need to run this tool automatically during uninstallation of my application.
I created custom action and start it before or after InstallInitialize.
But it did not help.
Message "The following applications should be closed before continuing the install" still appears.
And script executes only when I click on the button OK in that dialog.
How to start custom action before notification "The following applications should be closed before continuing the install"?

Custom stop action before InstallValidate does not help by some reason.

<InstallExecuteSequence>
  <Custom Action='StopApplication' Before="InstallValidate"/>
</InstallExecuteSequence>

<CustomAction Id="StopApplication"
     FileKey="stopServer.cmd"
     ExeCommand="" 
     Execute="immediate" 
     Impersonate="yes" 
     Return="ignore" />
1

1 Answers

1
votes

Detection of apps that need closing down is done by the InstallValidate action, so you need to have your CA before that. After InstallInitialize is too late. That means it needs to be marked immediate.

p.s. WiX has a util CloseApp for this that might work for that app.