Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a new version of a deployment project over old version

Tags:

I have a deployment project which will not let me install over an older version. The msi file says to uninstall the program first from Add/Remove programs. This is not a good user experience. How can I do it so that the installer will simply remove the software first and then install the new version?

like image 625
sbenderli Avatar asked Jun 11 '10 17:06

sbenderli


People also ask

What is the difference between deployment and installation?

Install means you want to install the application on this computer. Deployment means that you create an installation with an answer file and all of your settings, but it is created on a server and you use it to push out to all of your computers.

How do I install setup and deployment in Visual Studio 2015?

This blog post shows to create setup file in Visual Studio 2015. Download Microsoft Visual Studio 2015 Installer Project. RightClick on the Setup from Solution Explorer->Build it->Go to the project physical path ->choose the setup project->Debug-> and you will find the Setup File, .exe File.


2 Answers

This is tricky, you have to do following steps,

  1. Set Remove Previous Installation as True
  2. Set Detect new version as True
  3. Your C# program's version must increase with every deployment
  4. You should change version of your installer to one higher version and it will ask you to change product code, select YES.
  5. Do not change your upgrade code, let it be same.

If you do not do 3rd step correctly, installer will still install and keep the old file, your file version of every file must be new if you have changed your content.

like image 168
Akash Kava Avatar answered Sep 27 '22 18:09

Akash Kava


I tried out a few scenarios, maybe this will help someone save some time

If Assembly Version changes AND project installer version changes (with ProductCode Guid changing also) -> App installs over the top of existing one -> dlls and exe versions get updated -> IF path installed to is different, existing initially installed project files are deleted from where they were installed. (and files made since remain)

If Assembly Version changes AND project installer version changes (without ProductCode Guid changing) -> User is asked to manually remove the application -> if they go ahead and remove from control panel first, app can then be installed and the dlls and exes get updated to the new version

If ONLY Assembly Version changes, or only project installer version changes (without ProductCode Guid changing) -> User is asked to manually remove the application -> if they go ahead and remove from control panel first, app can then be installed and the dlls and exes get updated to the new version

If ONLY project installer version changes (with ProductCode Guid changing also) -> MSI goes through install process, but dlls and exe do not change version -they are as per assembly version, and are replaced with files of same assembly build version -> IF path installed to is different, existing initially installed project files are deleted from where they were installed. (any files made since remain)

If project installer version changes (with ProductCode Guid changing also) and assembly version is lower than installed version -> Installation will commence, at the end user is informed install fails as old version.

like image 23
CRice Avatar answered Sep 27 '22 18:09

CRice