admin管理员组

文章数量:1289402

I am migrating an installer from InstallShield to WiX (v4) and facing an issue with rollback during a major upgrade.

Issue:

The WiX installer correctly detects and uninstalls the previously installed InstallShield version during a major upgrade. However, if the upgrade fails mid-installation, the rollback does not restore the InstallShield-installed version. As a result, the application is completely removed instead of rolling back to the previous version.

Expected Behavior:

If the WiX upgrade fails, it should rollback to the previous version (i.e., the InstallShield-installed product should be restored).

Current WiX Configuration:

Here’s how I’ve set up the MajorUpgrade in WiX:

<Package
        Codepage="1252"
        Name="$(var.ProductName)" 
        Language="1033" 
        Version="$(var.ProductVersion)"
        Manufacturer="$(var.ProductManufacturer)" 
        UpgradeCode="$(var.UpgradeCode)"
        ProductCode="*"
        InstallerVersion="200">

    <Property Id="STARTSERVICE" Value="1" Admin="yes" Secure="yes"/>
    <Property Id="VERSIONMAJOR" Value="$(var.VersionMajor)" Secure="yes"/>
    <Property Id="VERSIONMINOR" Value="$(var.VersionMinor)" Secure="yes"/>

    <MajorUpgrade
            Schedule="afterInstallValidate"
            DowngradeErrorMessage="A newer version of [PRODUCTNAME] is already installed."
            AllowSameVersionUpgrades="yes"
            AllowDowngrades="no" />

    <FeatureRef Id="MainFeature"/>

    <ui:WixUI 
        Id="WixUI_InstallDir"
        InstallDirectory="INSTALLFOLDER"
    />

Troubleshooting So Far:

  • The InstallShield version is successfully uninstalled during the upgrade.
  • If the installation completes successfully, everything works as expected.
  • However, if the installation fails, the previous InstallShield version is not restored.
  • WiX rollback only restores its own changes, but it does not reinstall the old InstallShield-based product.

Question:

How can I configure WiX to restore the previous InstallShield-installed version if the upgrade fails?

Would a Custom Action to reinstall InstallShield on rollback be the best approach, or is there a native MSI mechanism to handle this?

Any guidance or alternative solutions would be greatly appreciated!

本文标签: