I am having an issue with an installer built with Wix 3.7. I have a product which install a Windows Service. The problem is that during a product upgrade (from version 1.1 to version 1.2, same UpgradeCode, different ProductCode Guid and MajorUpgrade property used) I want to replace the executable ran by the Service. The file is in use by the old process (i.e. the Windows service). I suspect that the 1.1 installer is used to uninstall the 1.1 product, and in that installer the ServiceControl was invalid (i.e. not set to stop on uninstall).
My guess:
- 1.2 installer detects existing product (due to upgrade code)
- uninstall the old product
- the service is not stopped/uninstalled due to a bug in 1.1 installer
- 1.2 tries to replace the executable, but a process is still running the executable.
Note that I have tweaked the 1.1 installer using Orca to have a correct ServiceControl which stops and remove the service on uninstall. We call this 1.1tweaked. If I install the product using 1.1tweaked and then use my 1.2 installer than everything works as expected.
I have already tried any possible configuration of the ServiceControl in 1.2 installer, but it's useless if the steps above are right.
How can I force to stop the "current" Windows Service in the 1.2 installer? It looks like I need a Custom Action. Any ideas? Thanks
RemoveExistingProducts
? It may work if you schedule itafterInstallExecute
since the 1.1 installer will no longer try to uninstall the service due to component reference counting if your 1.1 install followed the suggested component rules. - Brian Sutherland<RemoveExistingProducts After="InstallExecute"/>
in the<InstallExecuteSequence>
? - peval27Schedule="afterInstallExecute"
in theMajorUpgrade
- peval27