Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# install
I have a simple C#.net application that I have created a setup project for.The application is a single exe and uses an app.config fil.
 
My question is, how do I go about upgrading the application whenever I make any updates to my code?
 
Within the setup project, I see I can set the installer to automatically remove the old version, but I don't really want to do that since it may overlay my custom settings in my app.config.
 
I really want to be able to create a setup project that will simply update the binary content of my application and keep my app.config settings. I also don't want to have do uninstall first.
 
I guess I'm looking for something similar to install shield's 'upgrade' option.
 
I've been playing with several settings and have more than confused myself...How can I accomplish this?
 
I performed the following, but still no success:
 
VS recommended I change the Product id/GUID whenever I increased the version (from my setup project). When I changed the version and guiid, it did add another entry to the add/remove programs.
 
I tried simply changing the assembly version on my exe, then rebuilding the setup package without modifying the version and guid within the setup project and when I went to do an install I got the "setup detected a previous version of this product....you must first uninstall..." message.
 
Many thanks in advance.
Kind regards,
Posted 24-Mar-10 6:12am
Programm3r11.3K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Will ClickOnce Deployment[^] solve your problem?
 
This has the capability to upgrade without uninstalling manually.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi all,
 
To solve this issue do the following:
 
1) For each project in your solution that is part of the setup project, increment the assembly version.
2) Increment the setup project's version
3) This will prompt you to change some guids. Say yes
4) Make sure RemovePreviousVersions is true, and keep in mind that Visual Studio 2008's update mechanism requires you to increase file versions for files that you want to update.
5) Build setup project.
 
This solved my problem.
  Permalink  
Comments
ganeshgopug at 22-Jul-10 3:55am
   
Is it possible to avoid the Installation path user interface (or disable it with existing path), while upgrading?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 330
1 Sergey Alexandrovich Kryukov 279
2 BillWoodruff 245
3 Afzaal Ahmad Zeeshan 215
4 CPallini 205
0 OriginalGriff 5,635
1 DamithSL 4,496
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 1 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100