Problem:
I have made a Windows Service i VS2010 (C#) and a corresponding .msi that installs and starts it. Version, ProductCode, UpgradeCode etc. is set properly. RemovePreviousVersions is set to true. Works fine.
Now I want to make a new version of the service, and I want the updated .msi to update the service without requireing the user to manually uninstall the old service first.
What I do is this:
- I update the the source code of my service
- In the .msi project I change the version number and ProductCode (while leaving the UpgradeCode unchanged)
- I rebuild the whole thing.
But, when I afterwards launch the updated .msi, it fails with the following message: "Error 1001. .... An instance of the service is already running".
Questions:
Why is the service not automatically uinstalled before installing the updated version?
What can I do to make it work?
net stop servicename
should test if that is the issue) – Anirudh Ramanathan