Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top