Installing a new version of a deployment project over old version
Asked Answered
E

5

26

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?

Encephalic answered 11/6, 2010 at 17:10 Comment(1)
What's this have to do with the C# programming language?Integrator
F
28

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.

Farreaching answered 11/6, 2010 at 17:15 Comment(7)
I think 'Remote Previous Installation' means 'RemovePreviousVersions'Dennis
Any ideas on how to achieve this without changing ProductCode guid? (minor update) stackoverflow.com/questions/3114637Dennis
With "Your C# program's version must increase with every deployment" you mean every touched assembly, don't you?Gaberones
@mbx, I don't know what you are asking about, but what I mean is AssemblyVersion attribute must change, or should be set to 1.0.*Farreaching
I usually include some .dll projects and about 1 or 2 exe into one deployment project, so do I have to change the AssemblyVersions of them also?Gaberones
If file is modified, it's assembly version must be changed, whichever file it may be, your project or any included third party library. Every professional libraries do change the file version.Farreaching
Every time I change the product code the program wants to install as a side-by-side; I will have two installed version in Add/Remove Programs. If I don't change it then it informs me that I must uninstall the current version, despite the Remove Previous and Detect New options both being set to true. This is despite both the installer version and the assembly versions being incremented. This is terribly frustrating and not much fun for users either :(Subaqueous
D
13

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.

Dennis answered 24/6, 2010 at 23:45 Comment(0)
S
6

Set setup project property RemovePreviousVersions True

But you have to use same UpgradeCode in both setup applications

Stander answered 11/6, 2010 at 17:17 Comment(0)
R
0

You can do this sometimes after installing new version the old product will remain same.

You need to change the sequence number of RemoveExistingProducts ,It must schedule between Install Validate action and InstallInitialize . You can do this by ORCA

For Ex InstallValidate=1400 InstallInitialize =1500

Then RemoveExistingProducts =1450

Rehabilitate answered 10/12, 2013 at 5:43 Comment(0)
C
-1

If you are using visual studio 2012 or upper version ,

  1. If you have already installer folder under the solution folder, just open the Project assistant under Installer and double click on it .

2.Once you open Project assistant you see the Application Information ,here you can enter the version you want to change it.

Capapie answered 17/6, 2019 at 18:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.