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.
source share