[wix-users] PackageGroup tries to run both ExePackages on uninstall

Jon Seanor jseanor at gmail.com
Sat Feb 2 05:05:38 PST 2019


Hi

I'm trying to author a package that performs new installations and also
upgrade existing installations.

My bundle includes a 3rd party installer (referred to in the code below as
"an_installer.exe").
The 3rd party installer has different cmd line parameters that must be
specified when upgrading, and must not be used for new installations.

New installations are working as expected:
1) the "new_customer" PackageGroup runs.
2) the "existing_customer" PackageGroup does not run.

Upgrades are working as expected:
1) the "new_customer" PackageGroup does not run.
2) the "existing_customer" PackageGroup runs.

However, after upgrading, when you uninstall, BOTH PackageGroup are
scheduled for uninstall
1) the "new_customer" PackageGroup runs, then
2) the "existing_customer" PackageGroup runs and throws an error.

I'm not sure how to author the code so that only one PackageGroup executes
during uninstall.
I don't mind which one executes on uninstall, as long as exactly one does.


Does anyone have any insight into how to do this correctly?


<?xml version="1.0"?>
<?include GlobalDef.wxi ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:depends="
http://schemas.microsoft.com/wix/DependencyExtension">
    <Fragment>
        <PackageGroup Id="new_customer">
            <ExePackage
                        Id="new_customer"
                        Permanent="no"
                        PerMachine="yes"
                        SourceFile="an_installer.exe"
                        InstallCommand=''
                        UninstallCommand="/uninstall"
                        DetectCondition="AncestorFound=2"
                        InstallCondition="Install=1" >
                <ExitCode Value ="3010" Behavior="scheduleReboot" />

            </ExePackage>
        </PackageGroup>

        <PackageGroup Id="existing_customer">
            <ExePackage
                Id="existing_customer_upgrade"
                Permanent="no"
                PerMachine="yes"
                SourceFile="an_installer.exe"
                InstallCommand='/upgrade /other_upgrade_parameters_here'
                UninstallCommand="/uninstall"
                DetectCondition="AncestorFound=5"
                InstallCondition="Install=1">
                <ExitCode Value ="3010" Behavior="forceReboot" />
            </ExePackage>
        </PackageGroup>
    </Fragment>
</Wix>


More information about the wix-users mailing list