Wix: Can I perform a custom action before InstallValidate?

During the uninstall process, the installer displays the message below:

"The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup." 

I think this is because the installed service still works when uninstalling. So, I'm trying to write my own action to stop it. But it doesn't seem to work.

If I set the action as Execute='deferred' Impersonate='no' , it only allows me to set the action between InstallInitialize and InstallFinalize , so I have to set it as "immediate".

 <CustomAction BinaryKey='CustomActions' Id='StopService' DllEntry='StopService' Execute='immediate' /> <Custom Action="StopService" Before="InstallValidate">REMOVE="ALL"</Custom> 

Also note that I have to use custom actions to install the service manually instead of using Wix for some reason. That is why I am trying to remove it manually.

+4
source share
1 answer

You cannot run a personalized action before InstallInitialize. If you usually installed the service, MSI would take care of the service termination for you and not display a message about the work.

+4
source

All Articles