Search code examples
c#wixwix3

WiX ExePackage always skipped within Chain


I have the following WiX Bundle-Chain:

<Chain>
  <ExePackage Id="epVisualCPP2013Redist"
        SourceFile="$(var.Visual2013CPPRedistDir)vcredist_x64.exe"
        Permanent="yes"
        Vital="yes"
        Cache="no"
        Compressed="yes"
        PerMachine="yes"
        DetectCondition="0"
        InstallCondition="1"/>
  <MsiPackage Id="mpTestMsiPackage"
        SourceFile="$(var.TestMsiPackage.TargetPath)"
        Vital="yes"
        Visible="yes"
        LogPathVariable="LogLocation"
        Permanent="no"
        Compressed="yes"/>
</Chain>

In this case, I'm trying to force an installation of the Visual C++ 2013 Redistributable Package (vcredist_x64.exe). The problem is, that it never gets installed, independent of what DetectCondition or InstallCondition are set to (including the case that I omit them). The package with Id="mpTestMsiPackage" gets installed correctly.

NOTE: I can already detect whether the redist. package is installed or not. Setting the condition appropriately is secondary at this point. For the moment, I want to be able to force the redist. package to always be installed.

Checking the logs, I find the following entries:

[D0D8:CE50][2023-08-19T01:05:38]i101: Detected package: epVisualCPP2013Redist, state: Absent, cached: None
...
[D0D8:CE50][2023-08-19T01:05:41]w321: Skipping dependency registration on package with no dependency providers: epVisualCPP2013Redist
...
[D0D8:CE50][2023-08-19T01:05:41]i201: Planned package: epVisualCPP2013Redist, state: Absent, default requested: Present, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None

If I do the following within my Bootstrapper Application, it installs as desired:

private void bootstrapperApplication_PlanPackageBegin(object sender, PlanPackageBeginEventArgs e)
{
    if (e.PackageId == "epVisualCPP2013Redist")
        e.State = RequestState.Present;
}

What am I missing? Is the ExePackage configured incorrectly or did I miss something in my Bootstrapper Application?

Any help greatly appreciated!


Solution

  • The bundle log is very clear:

    [D0D8:CE50][2023-08-19T01:05:41]i201: Planned package: epVisualCPP2013Redist, state: Absent, default requested: Present, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
    

    This part means ba requested: None your BoostrapperApplication code is forcing the package to Absent. You don't provide enough code to understand why that might be happening but go debug your BA.