简体   繁体   中英

How can I modify MSI features in a WiX burn bootstrapper?

Bundle.wxl:

<Bundle Name="$(var.SetupName)"
        Version="$(var.ProductVersion)"
        Manufacturer="$(var.CompanyName)"
        UpgradeCode="$(var.UpgradeCode)">

    <Variable bal:Overridable="yes" Name="AddLocal"/>
    <Variable bal:Overridable="yes" Name="Remove"/>
    <Chain>
        <MsiPackage Id ="Hello.msi" Name="MyApp.msi" SourceFile="$(var.MyApp.TargetPath)" EnableFeatureSelection="yes" >
            <MsiProperty Name="ADDLOCAL" Value="[AddLocal]"/>
            <MsiProperty Name="REMOVE" Value="[Remove]"/>
        </MsiPackage>
    </Chain>
</Bundle>

String Variable AddLocal defines by checkboxes from UI Bootstrapper and sends value to the Bundle.wxl like this:

BootstrapperApplication.Engine.StringVariables["AddLocal"] = "FIRST,SECOND"; The same situation with the Remove variable: BootstrapperApplication.Engine.StringVariables["Remove"] = "THIRD";

After variables are set I run BootstrapperApplication.Engine.Plan(LaunchAction.Modify); but nothing is changed with my features.

Log file contains strings like this:

Planned feature: FIRST, state: Absent, default requested: Unknown, ba requested: Unknown, execute action: None, rollback action: None

Planned feature: SECOND, state: Absent, default requested: Unknown, ba requested: Unknown, execute action: None, rollback action: None

Planned feature: THIRD, state: Absent, default requested: Unknown, ba requested: Unknown, execute action: None, rollback action: None

However, Product.wxs contains features with id="FIRST", id="SECOND", id="THIRD".

Finally I found the solution. Variables ADDLOCAL and REMOVE is wrong way. It helped me: WiX .NET Bootstrapper - Feature Selection .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM