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

Avatar of undefined
Last Comment
vizagboy

8/22/2022 - Mon
vizagboy

ASKER
Having issues adding the uninstall custom action to the primary output.
Vadim Rapp

here's suggestion from Phil Wilson in newsgroup:

http://support.microsoft.com/?id=906766

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

the link is
news://msnews.microsoft.com/

(the EE parser apparently knows only http)
Your help has saved me hundreds of hours of internet surfing.
fblack61
vizagboy

ASKER
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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
vizagboy

ASKER
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!
ASKER CERTIFIED SOLUTION
Vadim Rapp

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
vizagboy

ASKER
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.