Link to home
Create AccountLog in
Avatar of vizagboy

asked on

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.
Avatar of vizagboy


Having issues adding the uninstall custom action to the primary output.
Avatar of Vadim Rapp
here's suggestion from Phil Wilson in newsgroup:

However, when I tried it, it did not help. I didn't fully understand that article - see my reply in the newsgroup.
the link is

(the EE parser apparently knows only http)
I got sidetracked with another issue which i am working on. I have read the article and am going to try tomorrow.
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?
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!
Avatar of Vadim Rapp
Vadim Rapp
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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.