[wix-users] Custom Bootstrapper - avoiding auto uninstall of installed msi package when running bootstrapper 2nd time

Baumann Ingo i.baumann at commend.com
Tue Sep 13 07:48:30 PDT 2016


In my custom bootstrapper UI I'm providing checkboxes to select packages to install. According to the selected checkboxes, I'm setting string variables (A, B, C) to True/False before calling Engine.Plan(LaunchAction.Install).

Chain as below
<chain>
    <MsiPackage SourceFile="MSI Packages\A.msi" DisplayInternalUI="yes" Description="A Setup" DisplayName="A" InstallCondition="A="True"" Id="A" Permanent="no" Vital="yes" Visible="yes">
    </MsiPackage>
    <RollbackBoundary />
    <MsiPackage SourceFile="MSI Packages\B.msi" DisplayInternalUI="yes" Description="B Setup" DisplayName="B" InstallCondition="B="True"" Id="B" Permanent="no" Vital="yes" Visible="yes">
    </MsiPackage>
    <RollbackBoundary />
    <MsiPackage SourceFile="MSI Packages\C.msi" DisplayInternalUI="yes" Description="C Setup" DisplayName="C" InstallCondition="C="True"" Id="C" Permanent="no" Vital="yes" Visible="yes">
    </MsiPackage>
</chain>

I've checked the log for evaluation condition and looks fine. E.g.:
Condition 'A="True"' evaluates to false.

Installing an MSI with above explained conditioning works fine. But when I run the bootstrapper again and install another package, a previous package is getting uninstalled.


1.       Run bootstrapper and install A and C (see execute: Install in log below)

Planned package: A, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register

Planned package: B, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None

Planned package: C, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: No, uncache: No, dependency: Register

2.       Run bootstrapper again and install B will uninstall C (see execute: Uninstall in log below)
Planned package: A, state: Present, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: Unregister
Planned package: B, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
Planned package: C, state: Present, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, cache: No, uncache: Yes, dependency: Unregister

How can I avoid removal of a packages at all?
Is there a way to customize execution per package?

Many thanks,
Ingo


More information about the wix-users mailing list