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:
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
Following the comments, these are the possible solutions:
Schedule="afterInstallExecute"
in the MajorUpgrade. This may work if the components are well defined and file are versioned correctly.