More Group Sites
School Rankings
Jobless Net
Better Home
Enviro++


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

How to Remove Previous Version with Windows Installer Options · View
hong
Posted: Thursday, March 03, 2011 8:40:05 PM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 335
Points: 711
Location: Australia
First we need to set RemovePreviousVersion property to True. We also have to ensure the value of UpgradeCode in both versions are the same when RemovePreviousVersion is set to true.

The installer checks UpgradeCode and ProductCode properties to determine whether the earlier version should be removed. The UpgradeCode must be the same for both versions; the ProductCode must be different.

"Just for me" upgrade cannot remove a previous version if it was installed for Everybody.

In the MSI generated by VS.Net, the logic for "RemovePreviousVersions" is to look for all the products with the same upgrade code with version between 1.0.0 and the version of the current product. Note this is a limitation. It should be between version 0.x.y and the current version. In this instance, you can use Orca MSI editor to change VersionMin.

Quote:
VersionMin

Lower boundary of the range of product versions detected by FindRelatedProducts. Enter msidbUpgradeAttributesVersionMinInclusive in Attributes to include VersionMin in the range. If VersionMin equals an empty string ("") it is evaluated the same as 0. If VersionMin is null, FindRelatedProducts ignores msidbUpgradeAttributesVersionMinInclusive and detects all previous versions. VersionMin and VersionMax must not both be null.

VersionMin must be a valid product version as described for the ProductVersion property. Note that Windows Installer uses only the first three fields of the product version. If you include a fourth field in your product version, the installer ignores the fourth field.


See more information in Major Upgrades.

Sponsor
Posted: Thursday, March 03, 2011 8:40:05 PM
hong
Posted: Friday, June 03, 2011 8:04:46 AM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 335
Points: 711
Location: Australia
General rules for upgrades ("uninstall then install") with Windows Installer
1. Old and new versions must have identical UpgradeCode and different ProductCode values.
2. Old and new versions must have InstallAllUsers selected.
3. When you make changes to your project, you should change the "AssemblyVersion" number in the AssemblyInfo.cs files in your project (including changing the assembly versions numbers of the dependent DLLs). See How can I auto increment the C# assembly version. You should also change the version of the installer (the setup project, nothing to do with file versions), by clicking on the setup project and going to the Version property. New setup version must be higher. This will ask you to change the product code. Say Yes.

These rules will ensure any previous version will be uninstalled automatically and then a new version is installed.









Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.418 seconds.