View Full Version : our MANUAL Major Upgrade solution

12-12-2009, 01:23 AM

I see the forum littered with people having problems with major upgrades and thought I'd share something that is probably not 'best practices', but it did fix our majorily broken major upgrade.

On a major upgrade, the required vc8 runtimes (and other Winsxs friends) were not upgrading. We realised we were experiencing the dreaded: http://support.microsoft.com/kb/905238 problem. We now have a solution that has been working well over our last few releases, so listen up!:

Basically, we are abandoning the minor/major upgrade functionality of msi and using the power of commandline msiexec to uninstall the previous product if it's detected. Here we go:

instructions done in IS 2008 / Basic MSI

1. Create a new Media\Upgrades entry:
I called ours MajorUpgradeDetection
upgrade code: {00000000-0000-0000-0000-000000000000}
min ver
include min ver: no
max ver:
Include Max ver: no
Exclude specifc langs: No
Detect Only: YES
Detect Prop (ours is still set to): ISACTIONPROP3
Only remove ..:
Continue on failure: no
migrate feature states: (probably should be no): yes

2. create custom action
MSI Type Number: 98
ours is named: UnInstallPreviousVersion
working folder: SystemFolder
Filename and command (ISACTIONPROP3 contains the GUID of previous product that was detected): msiexec.exe /x[ISACTIONPROP3] /qb /passive
return proc: synch (ignore)
in-script exec: Immediate exec
Execution Scheduling: Always execute
(all are "absent from sequence")

3. Onto the User Interface\dialogs...
ReadyToInstall dialog's behavior link..
Click InstallNow control
Add a new event as follows:
event: Do Action - Argument: UnInstallPreviousVersion - Condition: ISACTIONPROP3

The downside of this method is that it only works in the UI sequence (will not work in silent installs). You can change this, but our company had a requirement to display the version dialog to user as well as a warning that thier previous version would be removed. For directions on the warning message to users.. here it is:

On User Interface\Dialogs\InstallWelcome dialog:

a. Create a text box with the text you want to display if a major upgrade will be performed, .. ours is named "MajorUpgradeWarning".
b. Navigate to this dialogs behavior page... then click the 'conditions' tab at the bottom of the screen. Click on MajorUpgradeWarning
c. We have a Show action with ISACTIONPROP3
d. We also have a hide action: Not ISACTIONPROP3

As I mentioned, this only works in the UI sequence, not silent installs. So we then had a requirement to block major upgrades during silent installs....
a. Navigate to Behavior and Logic\Custom Actions
b. I created a MSI Type Number 19 action as follows:
Error Msg (Probably should be translated text though): "A version of this software is already installed, please uninstall before attempting a silent install."
Return Proc: sync (check exit code)
In-Script: Immediate Exec
Execut Scheduling: always execute
Install Exec Sequence: After ISPreventDowngrade (if you dont' have that,.. it's basically after the "FindRelatedProducts" CA)
Exec condition: ISACTIONPROP3 And UILevel=2

Keep in mind, this is what worked for us. It's not 'best practices', and this particular configuration may not work for you. Please share any tweaks you would make to the settings or added functionality or words of wisdom to your replies.

"Any problem in computer science can be solved with another level of indirection."
Nick Skitch - Bellevue Washington