Jerrylk
Jerrylk

Reputation: 389

Wix Installer Upgrade without uninstall

I'm currently using wix to build a installer, here are some requirements that I've no idea how to do it.

in Installation sequence, but I still get "wix another version of this product is already installed" Error.

Please help.

    <Product  Id='fixed-ID' 
              UpgradeCode='fixed-upgrade-ID' 
              Version='1.1.1' > 
        <Package InstallerVersion='300'/>

            <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />

            <Upgrade Id="fixed-upgrade-ID">
                <UpgradeVersion Property="PREVIOUSVERSIONSINSTALLED" 
                  Minimum="0.0.0" 
                  Maximum="1.1.1" 
                  IncludeMaximum="no" 
                  IncludeMinimum="yes"
                  OnlyDetect="no" 
                  />
            </Upgrade>

        <InstallExecuteSequence>

          <RemoveExistingProducts Before="InstallInitialize" />
       </InstallExecuteSequence>
    </Product>

Upvotes: 3

Views: 6909

Answers (1)

TheESJ
TheESJ

Reputation: 2367

I recommend using the MajorUpgrade element that is present in the latest versions of WiX. It takes a lot of the complexity out of creating an installer that supports upgrade. You do need to make sure you change both Product-ID and Version. You'll always get an error if you don't change Product ID (unless you run the install with the REINSTALLMODE containing 'v', but that is a minor upgrade and restricts what you can do). Version must be changed to ensure you have a one way upgrade path, otherwise old installers could upgrade newer ones if they had the same version.

This how-to has a great walk-through.

Upvotes: 4

Related Questions