Search code examples
windows-installerinstallshield-2009

Best way to install .NET Service in MSI so that it is updatable?


I have a MSI install built with InstallShield 2009 which installs a .NET service by setting the ".NET Installer Class" to Yes on the component which contains the service exe. This base install which contains files and the exe installs OK. I created a small update MSP which is updating the service exe file in the original install. When I run the MSP on a system that contains the base install I get error 1001 because it is trying to reinstall the service during the small update MSP install.

Flexera's official response to this problem is that if the .NET executable needs to be updated, then one should set the component ".NET Installer Class" to No and create their own Custom Actions. Flexera also admitted that they do not document anywhere that if you set the ".NET Installer Class" to Yes that you cannot then create MSP updates of your install. It is impossible to go back and and change the base install since it has been released and the update needs to be created against it. I have on my own come up with a workaround by including a custom action in the MSP update which uninstalls the service during the install of the MSP. This gets the small update MSP installed but this workaround does not work for uninstalling the MSP from ARP.

I need to know the best way to address this issue in future installs. How do you install a .NET service in such a way where you can easily update the service later using a small update MSP?


Solution

  • Services should be installed using the MSI way; as intaller classes are horribly fragile, but self-written custom actions aren't likely to be a lot better (just easier to control). You can find the Service options under the component advanced settings.