Search code examples
wixwix3

Wix installer is removing a different product when installing


I've got two different products (A, B) that install via custom wix installers. For some reason when A is installed and I try to install B, A is uninstalled as part of B installation and vice versa when B is installed, A uninstalls B.

I have very similar WIX files but each one has a different Product UpgradeCode. I've done a bit of searching and it seems everyone has the opposite problem where the upgrade is not uninstalling their product.

Any ideas about what else has to be changed would be much appreciated as I've been banging my head against the wall for hours.

This is one of my wix files. The main difference between this and the other is different cookiecutter variables (guid and formal_name) and "<-- CONTENT -->, <-- CONTENTREFS -->" contents section. Both applications do install to different locations.

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
        Id="*"
        UpgradeCode="{{ cookiecutter.guid }}"
        Name="{{ cookiecutter.formal_name }}"
        Version="0.1.1"
        Manufacturer="{{ cookiecutter.organization_name }}"
        Language="1033">
    <Package
            InstallerVersion="200"
            Compressed="yes"
            Comments="Windows Installer Package"
    />

    <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>

    <Property Id="ARPHELPLINK" Value="https://www.myhome.com" />
    <Property Id="ARPURLINFOABOUT" Value="Home Page" />
    <Property Id="ARPNOREPAIR" Value="1" />
    <Property Id="ARPNOMODIFY" Value="1" />

    <MajorUpgrade AllowDowngrades="yes"
                  AllowSameVersionUpgrades="no"
                  IgnoreRemoveFailure="no"
                  Schedule="afterInstallInitialize" />

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="AppDir" Name="{{ cookiecutter.formal_name }}">
<!-- CONTENT -->
            </Directory>
        </Directory>

        <Directory Id="ProgramMenuFolder">
            <Directory Id="ApplicationProgramsFolder" Name="{{ cookiecutter.formal_name }}"/>
            <Directory Id="DesktopFolder" Name="{{ cookiecutter.formal_name }}DesktopFolder"/>
        </Directory>
    </Directory>
        <DirectoryRef Id="ApplicationProgramsFolder">
            <Component Id="ApplicationShortcutStartMenu" Guid="*">
                <Shortcut Id="ApplicationShortcut1" Name="{{ cookiecutter.formal_name }}" Description="{{ cookiecutter.description }}" Target="[DIR_python]\python.exe" WorkingDirectory="AppDir" Arguments="app\start.py" />
                <RegistryValue Root="HKCU" Key="Software\{{ cookiecutter.organization_name }}\{{ cookiecutter.formal_name }}" Name="installed" Type="integer" Value="1" KeyPath="yes" />
                <RemoveFolder Id="CleanUpShortCut1" Directory="ApplicationProgramsFolder" On="uninstall"/>
            </Component>
        </DirectoryRef>
        <DirectoryRef Id="DesktopFolder">
            <Component Id="ApplicationShortcutDesktop" Guid="*">
                <Shortcut Id="ApplicationShortcut2" Name="{{ cookiecutter.formal_name }}" Description="{{ cookiecutter.description }}" Target="[DIR_python]\python.exe" WorkingDirectory="AppDir" Arguments="app\start.py" />
                <RegistryValue Root="HKCU" Key="Software\{{ cookiecutter.organization_name }}\{{ cookiecutter.formal_name }}DesktopFolder" Name="installed" Type="integer" Value="1" KeyPath="yes" />
                <RemoveFolder Id="CleanUpShortCut2" Directory="DesktopFolder" On="uninstall"/>
            </Component>
        </DirectoryRef>

    <Feature Id="DefaultFeature" Level="1">
<!-- CONTENTREFS -->

        <ComponentRef Id="ApplicationShortcutStartMenu"/>
        <ComponentRef Id="ApplicationShortcutDesktop"/>
    </Feature>


    <Property Id="ALLUSERS" Value="1"></Property>
</Product>


Solution

  • Upgrade Code: This behavior is consistent with identical upgrade code, please verify if this is the case by using one of the approach shown here to list all upgrade codes for installed setups: How can I find the Upgrade Code for an installed MSI file?

    MSI File Hard Facts: Alternatively - or preferably - check the Upgrade table of the actual MSI files involved whether they are installed or not.

    Custom Action: I suppose it is also possible that there is a custom action in your installer which uninstalls the other product as a custom action step inserted somewhere in the installation sequences (only a few locations will work). Please inspect your MSI using Orca or some other MSI tool to determine what is in the tables: Custom Action and Upgrade. Please report any suspects.

    Launcher: The MSI in question is not launched from a setup.exe is it? Or from a batch file or some automated system for deployment?


    Update: Maybe have a look at this answer from yesterday. At least somewhat related: How to avoid having two versions of a product installed with Windows Installer / MSI?