Makubex
Makubex

Reputation: 1114

Upgrade from VS Setup MSI to Wix MSI being treated as uninstall

Scenario:

We have used VS 2010 Setup project till now. Migrating new builds to Wix going forward.

Issue:

Msiexec is treating the upgrade as un-install + fresh-install instead of just upgrade.

Details:

Note - System correctly recognizes both as same product and during setup automatically removes the old one.

Problem is, the old product is being run as uninstall rather than as a upgrade. I have a custom action set to run during uninstall, which will remove user-data. Now the issue is, this custom action is being triggered during upgrade for some reason.

This problem doesn't happen if it's 2010 to 2010 or Wix to Wix, Only if it's 2010 to Wix.

Scenarios

The only difference I've noticed in the logs -

For VS 2010 to 2010

Action ended: MsiUnpublishAssemblies. Return value 1.
MSI (s) (90:A4) : Skipping action: _[guid].uninstall.SetProperty (condition is false)
MSI (s) (90:A4): Skipping action: _[guid].uninstall (condition is false)
MSI (s) (90:A4) [21:54:10:299]: Doing action: UnpublishComponents
Action start 21:54:10: UnpublishComponents.

For 2010 to WIX -

MsiUnpublishAssemblies. Return value 1.
Doing action: [guid].uninstall.SetProperty
Action start : [guid].uninstall.SetProperty.
MSI (s) (90:D4) : 
Note: 
1: 2235 
2:  
3: ExtendedType 
4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = '[guid].uninstall.SetProperty' 
MSI (s) (90:D4) : PROPERTY CHANGE: Adding [guid].uninstall property. Its value is '/installtype=notransaction /action=uninstall /LogFile= ... "[custom-action].exe" "oldmsi.tmp"'.
Action ended _[guid].SetProperty. Return value 1.
MSI (s) (90:D4) : Doing action: _[guid].uninstall
Action start : _[guid].uninstall.
MSI (s) (90:D4): 
Note: 
1: 2235 
2:  
3: ExtendedType 
4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = '_[guid].uninstall' 
Action ended: _[guid].uninstall. Return value 1.
MSI (s) (90:D4): Doing action: UnpublishComponents
Action start : UnpublishComponents.

I'm clueless why this uninstall is happening. Any help is appreciated.

Upvotes: 2

Views: 91

Answers (1)

PhilDW
PhilDW

Reputation: 20790

There's not enough information to be sure, but this should help:

A major upgrade always uninstalls the product being upgraded. That is the definition of a major upgrade based on new ProductCode, same UpgradeCode and incremented version and same installation context. This means that your issue depends on your assumptions about an "uninstall custom action"

Visual Studio "uninstall" custom actions are not really "uninstall" custom actions. They are called when the component (denoted by component id) is removed. When you go from VS 2010 built to VS 2010 built the component id remains the same (internally ref counted) and the component remains installed. The same happens with the WiX builds. When you go from VS 2010 built to WiX built the component ids have probably changed, therefore the component from the VS 2010 built MSI is removed, therefore the custom action is called.

In other words the issue is most likely that the component ids in your VS 2010 build (which you cannot see because VS 2010 doesn't even hint at their existence) are not the same as the component ids in your WiX build.

Upvotes: 2

Related Questions