Visual Studio setup project - handling uninstall discrepancy during upgrades
Follow up to "Visual Studio setup project - handling Version number and ProductCode " question. Waiting for any information from the newsgroups to which vadimrapp1 posted.
.NET ProgrammingInstallation
Last Comment
vizagboy
8/22/2022 - Mon
vizagboy
ASKER
Having issues adding the uninstall custom action to the primary output.
I got sidetracked with another issue which i am working on. I have read the article and am going to try tomorrow.
vizagboy
ASKER
There is one more reason why I had to overwrite the OnBeforeUnInstall handler besides the config files backing up. I added the logic in application to backup the config's though and is taken care.
In my application i have two EXE's. One is normal C# windows app and another is Windows service. I had to add the output of service's exe to the uninstall custom function. Otherwise during the upgrade, it says Service already exists and is aborting the upgrade. Any alternatives for this?
Vadim Rapp
Not long ago, answering another question here, I created in VS windows service project with installation and upgrade, and it was working flawlessly. Uninstallation correctly stopped the running service and then deleted it. Upgrade stopped it, upgraded, restarted. I suggest you try it on separate project with service only, see how it works, then work on making it work with your main exe. Maybe you need to have separate project for the service, and therefore adding it to the setup as Primary Output. And of course, the executable must have higher version than the one it's upgrading.
I have the service running as a separate executable. I can try that. I will be able to do it in the evening. Will get back to you with the results. Thanks!
yep, agree with you. learnt it the hard way :-)
i am going to look towards writing in vbscript and wire them in prebuild and postbuildevents. that should suffice.
Thanks for the feedback.