3

I would like to apologize in advance if I'm leaving out any important details.

I am attempting to perform an upgrade where the previous version of the software (and all components) should be removed prior to installing the new one.

I'll try to avoid boring you with the details and say if you do a 'typical' installation, everything goes as planned. If you choose to do an advanced installation (specify installation for all users, install location, etc) then it seems to be skipping the 'uninstall previous version' step altogether.

So far, I've done the following:

-Edited my UpgradeVersion tags to match the advice of another stackoverflow question

-Verified the 'OLDVERSIONBEINGUPGRADED' property is correctly being set

-Verify that upgrade codes/ids are the same, version numbers are sequential (upgrading from 1.0.8 to 1.0.10) - after all, the 'typical' installation works correctly!

-Followed the advice given here: WiX-- always overwrite the previous version and followed this: http://wix.sourceforge.net/manual-wix3/major_upgrade.htm

-Tried to implement a hack by manually calling msiexec to uninstall a previous version by it's product id (this failed because we're already installing something -- is there a better way to schedule this?)

My Product / Upgrade section looks like this:

<Product Id="GUID1" UpgradeCode="GUID2" Version="1.0.10.0">
    <Package Compressed="yes" InstallerVersion="200"/>
    <MajorUpgrade Schedule="afterInstallInitialize" 
      DowngradeErrorMessage="Another version of [ProductName] is already installed."/>
    <Upgrade Id="GUID2">
        <UpgradeVersion Minimum="1.0.10" OnlyDetect="yes"
             Property="NEWERVERSIONDETECTED" />
        <UpgradeVersion Maximum="1.0.10" IncludeMaximum="no" 
             Property="PREVIOUSVERSIONINSTALLED" />
    </Upgrade>

I'm a Wix newbie, so I may have overlooked important details while describing my problem. If I have neglected to include something important, please let me know.

Thanks in advance for any input you can provide.

Community
  • 1
  • 1

1 Answers1

2

It sounds like you are running into the same limitation as I did, see this question. You cannot change the install scope ("per user" or "per machine") in an upgrade.

There is no simple way around this from within Windows Installer. You can only make a separate bootstrapper exe which uninstalls the previous version, and then starts the installation of the new version.

Community
  • 1
  • 1
Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
  • Thanks for your input! In testing, we've found if you do the same 'per machine' install each time, we get the same issue. Is this still the same limitation? Does the selection for 'per machine' block the upgrade or is it the scope change? Did you end up using (or testing) the hack suggested on that page? – user1267756 Mar 14 '12 at 15:28
  • FYI - Our workaround was to disallow an advanced install; it always installs per-user. We'll probably have to adjust this in the future if we have features or functionality that would be useful in the other context. – user1267756 Mar 14 '12 at 17:54
  • @user1267756: it was the scope change in my case. If you are still seeing a problem even when the scope doesn't change, then this is probably a different issue. And no, I never tested that hack. – Wim Coenen Mar 14 '12 at 19:43