Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Upgrade application using setup project (VS 2003)
 

Upgrade application using setup project (VS 2003)

Hi!.
I have a program done in .NET. I use setup project to deploy it. This program has a DLL in GAC order that it can be acceded by other programs. The question is, if I want to update the DLL or the EXE, what must i do?

At the moment I increase the version of the DLL and the EXE, if I try to execute the installer says to me that already I have a version installed of this application, if I change the version to the setup project I have two options:
1.-To change the
product code and then installs them to me as a new program....
2.-Not to change the
product code and then says to me that already I have the installed product

Thank you

Kalay  Wednesday, December 27, 2006 3:23 PM
The Visual Studio way to do upgrades is RemovePreviousVersions. You need to increase the product version of the setup project, accept the change of ProductCode, and always use versions > 1.0, and have the InstallAllUsers value the same, and keep the UpgradeCode the same.RemovePreviousVersions is not an update, it is a complete uninstall of the old version followed by an install of the new version. So what you're saying about the system returning to the base version does not happen.
PhilWilson  Friday, January 19, 2007 11:58 PM

You have to increment the version of the setup project and use RemovePreviousVersions. This effectively causes an uninstall of the older product when you install the new one. This should help:

http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/

Because it's an uninstall followed by an install you don't need to change the assembly version. However because RemovePreviousVersions builds a major upgrade you may run into this:

http://support.microsoft.com/kb/905238/en-us

but if you change the assembly version you should not get this. Keep in mind that those other clients of your assembly will not be able to reference it if you just change the assembly version because they are expecting the older version. It doesn't need to be in the GAC to be accessed by other programs - they can just have a private copy in their application folders.

PhilWilson  Thursday, December 28, 2006 4:51 PM
Thank you.

Is there anyway to reinstall at the same path of the previous version? I don't want to let the user sets a new path beucause it is confused for basic users. I also have some parameters in the registry that the user introduces in the first installation, if the program is uninstalled those parameters are deleted, is there anyway to solve it?


Kalay  Monday, January 15, 2007 9:09 AM

There's no simple way to do that, unfortunately.

If you don't include the "installation folder" dialog in either version of the setup, then user's can't change it. If you haven't actually shipped v1, then this might be an option.

David Guyer MSFT  Tuesday, January 16, 2007 5:28 AM
If you don't include the "installation folder" dialog in either version of the setup, then user's can't change it. If you haven't actually shipped v1, then this might be an option.
- No it is not an option.

And then, how must i update my products?

because if i update them manually and the the user selecr restore in the add/remove programs option, then the system will return to the base version, and if i have changed database or any other external element system won't work.....
Kalay  Friday, January 19, 2007 7:53 AM
The Visual Studio way to do upgrades is RemovePreviousVersions. You need to increase the product version of the setup project, accept the change of ProductCode, and always use versions > 1.0, and have the InstallAllUsers value the same, and keep the UpgradeCode the same.RemovePreviousVersions is not an update, it is a complete uninstall of the old version followed by an install of the new version. So what you're saying about the system returning to the base version does not happen.
PhilWilson  Friday, January 19, 2007 11:58 PM
Ok. Thaks for your answers. I will think about the best deploy option: msi or xcopy. I also need the option of update just some coponents because the are used in all our applications.
Kalay  Monday, January 22, 2007 8:32 AM

There are two models for handling components that are shared between applications.

The first is to isolate and deploy a copy of the componenents with each application. Other than using disk space, this is actually a really good model. Even unintentonal "bug fixes" can break an app unexpectedly. In this model, each app is well isolated from the others and you deploy updates to each app when they are tested. A change to the components doesn't accidentally break an existing, installed app. If you have "versioning" issues, you can still do this with a data-layer and a database value that specifies the minimum required version to access the database... that way, a required update can block apps that haven't been updated and you can co-ordinate releases.

The second is to use the Global Assembly Cache and install your components there. Thetrick here is that you will have to roll out "publisher policy" as well (which is really kind of an empty assembly) to force apps to use the updated components. If you do that, all apps will use the latest version of your assemblies (unless they have local app.config entries to opt out. Fun eh ??) If you use this model, then it's best to have a seperate MSI installer for your components. Then, you build a bootstrapper package to install that MSI installer, and include that bootstrapper package with your applications' Prerequisiste bootstrappers. That way, whenever you install an app, it will run the bootstrapper pacakge if it needs to, which will upgrade the components, and then install (or upgrade) your app.

I really encourage you to use Windows Installer for your apps. There are a few things to learn, but when you do there are a lot of good benefits of using Windows Installer.

Hope this helps.

David Guyer MSFT  Tuesday, January 23, 2007 6:38 AM

You can use google to search for other answers

Custom Search

More Threads

• include contents of a whole directory in a setup and deployment project
• How to Deploy the Web and Win projects at the same time
• deployment of dotnet application from development to production
• Installing 2 versions of the same application on the same machine with ClickOnce.
• Modifying manifests programatically on site
• Click Once start Menu
• InvalidDeploymentException on some clients
• Adjuste ClickOnce destination folder
• location free + update enabled requires .net 2 sp1 (?)
• How to add uninstall file in the setup of windows apllication?