Skip to content

Commit

Permalink
Pass compression level to extension containers
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbar committed Sep 23, 2024
1 parent bf8d6bd commit d39ef1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace WixToolset.Extensibility
using System.Security.Cryptography;
using System.Text;
using System.Xml;
using WixToolset.Data;
using WixToolset.Data.Symbols;
using WixToolset.Extensibility.Data;
using WixToolset.Extensibility.Services;
Expand Down Expand Up @@ -52,9 +53,10 @@ public virtual void PreBackendBind(IBindContext context)
/// </summary>
/// <param name="container">The container symbol.</param>
/// <param name="containerPayloads">Collection of payloads that should be compressed in the container.</param>
/// <param name="level">Compression level. It is up to extension developers to map CompressionLevel values to a relevant compression level of their extension.</param>
/// <param name="sha512">SHA512 hash of the container file.</param>
/// <param name="size">File size of the container file.</param>
public abstract void CreateContainer(WixBundleContainerSymbol container, IEnumerable<WixBundlePayloadSymbol> containerPayloads, out string sha512, out long size);
public abstract void CreateContainer(WixBundleContainerSymbol container, IEnumerable<WixBundlePayloadSymbol> containerPayloads, CompressionLevel? level, out string sha512, out long size);

/// <summary>
/// Extract the container to a folder. Called on 'burn extract' command.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace WixToolset.Extensibility
{
using System.Collections.Generic;
using System.Xml;
using WixToolset.Data;
using WixToolset.Data.Symbols;
using WixToolset.Extensibility.Data;

Expand All @@ -28,9 +29,10 @@ public interface IBurnContainerExtension
/// </summary>
/// <param name="container">The container symbol.</param>
/// <param name="containerPayloads">Collection of payloads that should be compressed in the container.</param>
/// <param name="level">Compression level. It is up to extension developers to map CompressionLevel values to a relevant compression level of their extension.</param>
/// <param name="sha512">SHA512 hash of the container file.</param>
/// <param name="size">File size of the container file.</param>
void CreateContainer(WixBundleContainerSymbol container, IEnumerable<WixBundlePayloadSymbol> containerPayloads, out string sha512, out long size);
void CreateContainer(WixBundleContainerSymbol container, IEnumerable<WixBundlePayloadSymbol> containerPayloads, CompressionLevel? level, out string sha512, out long size);

/// <summary>
/// Extract the container to a folder. Called on 'burn extract' command.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private void CreateContainer(WixBundleContainerSymbol container, IEnumerable<Wix
return;
}

containerExtension.CreateContainer(container, containerPayloads, out string sha512, out long size);
containerExtension.CreateContainer(container, containerPayloads, this.DefaultCompressionLevel, out string sha512, out long size);

container.Hash = sha512;
container.Size = size;
Expand Down

0 comments on commit d39ef1e

Please sign in to comment.