Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle with detached container duplicates MSI's external cab files #6174

Closed
nirbar opened this issue May 18, 2020 · 4 comments
Closed

Bundle with detached container duplicates MSI's external cab files #6174

nirbar opened this issue May 18, 2020 · 4 comments
Assignees
Milestone

Comments

@nirbar
Copy link

nirbar commented May 18, 2020

  • Which version of WiX are you building with?
    3.11.2

  • Which version of Visual Studio are you building with (if any)?
    VS 2019 Community v16.4.3

  • Which version of the WiX Toolset Visual Studio Extension are you building with (if any)?
    VS 2019

  • Which version of .NET are you building with?
    .NET Framework 4.7.2

  • Describe the problem and the steps to reproduce it.
    When a bundle contains a detached container, and that container contains an MSI package with external CAB files, then these cab files are included in both the attached container and in the detached container.
    The result is a larger than expected bootstrapper

  • Describe the behavior you expected and how it differed from the actual behavior.
    I expect the detached container to contain the MSI and its external CAB files, while the attached container does not include the CAB files

@barnson
Copy link
Member

barnson commented May 18, 2020

How does an attached container come in? Can you attach a minimal repro project so we can see what you're describing?

@nirbar
Copy link
Author

nirbar commented May 19, 2020

Wix-issue-6174.zip
The attached solution has 3 projects:

  • Setup-100MB: MSI with 100MB file (you'll need to download one to build)
  • Setup-Small: Tiny MSI
  • Bootstrapper

The larger MSI is in a detached MSI. After building the bootstrapper you get:

  • Bootstrapper1.exe: 100MB
  • Setup100MB: 100MB

I'd expect the bootsrapper to be small and the Setup100MB cab file to weigh 100MB

@rseanhall
Copy link
Contributor

rseanhall commented May 19, 2020

The authoring wants the MsiPackage to be in a detached container.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Bootstrapper1" Version="1.0.0.0" Manufacturer="WiX" UpgradeCode="4ecf833d-7930-4db0-a80d-3a29d1f3797e">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />

    <Chain>
      <MsiPackage SourceFile="$(var.Setup-Small.TargetPath)"/>
      <PackageGroupRef Id="Setup100MB"/>
    </Chain>
  </Bundle>

  <Fragment>
    <PackageGroup Id="Setup100MB">
      <MsiPackage SourceFile="$(var.Setup-100MB.TargetPath)"/>
    </PackageGroup>
    <Container Id="Setup100MB" Name="Setup100MB" Type="detached">
      <PackageGroupRef Id="Setup100MB"/>
    </Container>
  </Fragment>
  
</Wix>

In the manifest, WiX puts the MSI in the detached container but puts the external cab file in the attached container.

<BurnManifest xmlns="http://schemas.microsoft.com/wix/2008/Burn">
  <Container Id="Setup100MB" FileSize="104959196" Hash="5678E13B33001B796C0DDE91C61104F1C7A0E11C" FilePath="Setup100MB" />
  <Container Id="WixAttachedContainer" FileSize="104959788" Hash="66150CBD7414FA4AABA0717ABF3C65C45C60934B" FilePath="Bootstrapper1.exe" AttachedIndex="1" Attached="yes" Primary="yes" />
  <Payload Id="Setup_Small.msi" FilePath="Setup_Small.msi" FileSize="32768" Hash="730657C6251938B0C5E0F323D599B45B21BE9A49"
           Packaging="embedded" SourcePath="a0" Container="WixAttachedContainer" />
  <Payload Id="Setup_100MB.msi" FilePath="Setup_100MB.msi" FileSize="32768" Hash="5BF32D80E9A4CDE9DEE3740BC5FFF1A020A6FCCA"
           Packaging="embedded" SourcePath="a1" Container="Setup100MB" />
  <Payload Id="cab6C67056A8149A5566D9808170F88F5DC" FilePath="cab1.cab" FileSize="596" Hash="DB0190043C13063D237CBEED4F3FEE8F000F8D5B"
           Packaging="embedded" SourcePath="a2" Container="WixAttachedContainer" />
  <Payload Id="cab3B47325AE0A55BD6FC259477C1DA9518" FilePath="cab1.cab" FileSize="104905671" Hash="266310BF1FB6E64A90176BA030D9333F632A8FB5"
           Packaging="embedded" SourcePath="a3" Container="WixAttachedContainer" />
  <Chain>
    <MsiPackage Id="Setup_Small.msi" Cache="yes" CacheId="{A20FE3AC-8FC5-497C-8558-3614DEC1F43C}v1.0.0.0" InstallSize="973" Size="33364" PerMachine="yes" Permanent="no" Vital="yes" RollbackBoundaryForward="WixDefaultBoundary" LogPathVariable="WixBundleLog_Setup_Small.msi" RollbackLogPathVariable="WixBundleRollbackLog_Setup_Small.msi" ProductCode="{A20FE3AC-8FC5-497C-8558-3614DEC1F43C}" Language="1033" Version="1.0.0.0" DisplayInternalUI="no">
      <PayloadRef Id="Setup_Small.msi" />
      <PayloadRef Id="cab6C67056A8149A5566D9808170F88F5DC" />
    </MsiPackage>
    <MsiPackage Id="Setup_100MB.msi" Cache="yes" CacheId="{4C5FBE53-C2D3-4387-8BDA-176BA409C579}v1.0.0.0" InstallSize="104857600" Size="104938439" PerMachine="yes" Permanent="no" Vital="yes" RollbackBoundaryBackward="WixDefaultBoundary" LogPathVariable="WixBundleLog_Setup_100MB.msi" RollbackLogPathVariable="WixBundleRollbackLog_Setup_100MB.msi" ProductCode="{4C5FBE53-C2D3-4387-8BDA-176BA409C579}" Language="1033" Version="1.0.0.0" DisplayInternalUI="no">
      <PayloadRef Id="Setup_100MB.msi" />
      <PayloadRef Id="cab3B47325AE0A55BD6FC259477C1DA9518" />
    </MsiPackage>
  </Chain>
</BurnManifest>

But WiX puts the file in both the external container (cab) and the attached container (cab).

@rseanhall
Copy link
Contributor

This is already fixed in v4. The v3 fix is more risky than I would like, especially considering how few people have complained about this.

@rseanhall rseanhall modified the milestones: v4.x, v4.0 Jan 3, 2021
@rseanhall rseanhall added this to Done in wix.4.0-preview.0 Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants