diff options
| author | Bob Arnson <bob@firegiant.com> | 2021-01-26 11:39:56 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2021-01-26 11:46:20 -0500 |
| commit | 870d523687cbeeab3432abdb5a07a5250c5e1bc4 (patch) | |
| tree | 6a1a69e6ddaea1c0dfa3ec4b49534cd856f2ecc9 /src | |
| parent | 0741acf89631bf226acb2d226981f0de0065c1f1 (diff) | |
| download | wix-870d523687cbeeab3432abdb5a07a5250c5e1bc4.tar.gz wix-870d523687cbeeab3432abdb5a07a5250c5e1bc4.tar.bz2 wix-870d523687cbeeab3432abdb5a07a5250c5e1bc4.zip | |
Add DefaultCompressionLevel support.
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs | 2 | ||||
| -rw-r--r-- | src/WixToolset.Core/CommandLine/BuildCommand.cs | 20 | ||||
| -rw-r--r-- | src/WixToolset.Core/Compiler.cs | 2 | ||||
| -rw-r--r-- | src/WixToolset.Core/Compiler_2.cs | 2 |
4 files changed, 22 insertions, 4 deletions
diff --git a/src/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs b/src/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs index a23a116b..8f361626 100644 --- a/src/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs +++ b/src/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs | |||
| @@ -64,7 +64,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
| 64 | files.AddRange(this.Payloads.Select(p => new CabinetCompressFile(p.SourceFile.Path, p.EmbeddedId))); | 64 | files.AddRange(this.Payloads.Select(p => new CabinetCompressFile(p.SourceFile.Path, p.EmbeddedId))); |
| 65 | 65 | ||
| 66 | var cab = new Cabinet(cabinetPath); | 66 | var cab = new Cabinet(cabinetPath); |
| 67 | cab.Compress(files, this.CompressionLevel ?? Data.CompressionLevel.Mszip); | 67 | cab.Compress(files, this.CompressionLevel ?? Data.CompressionLevel.Medium); |
| 68 | 68 | ||
| 69 | // Now that the container is created, set the outputs of the command. | 69 | // Now that the container is created, set the outputs of the command. |
| 70 | var fileInfo = new FileInfo(cabinetPath); | 70 | var fileInfo = new FileInfo(cabinetPath); |
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 065467bd..2216a80f 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
| @@ -50,6 +50,8 @@ namespace WixToolset.Core.CommandLine | |||
| 50 | 50 | ||
| 51 | private string OutputFile { get; set; } | 51 | private string OutputFile { get; set; } |
| 52 | 52 | ||
| 53 | private CompressionLevel? DefaultCompressionLevel { get; set; } | ||
| 54 | |||
| 53 | private string ContentsFile { get; set; } | 55 | private string ContentsFile { get; set; } |
| 54 | 56 | ||
| 55 | private string OutputsFile { get; set; } | 57 | private string OutputsFile { get; set; } |
| @@ -82,6 +84,8 @@ namespace WixToolset.Core.CommandLine | |||
| 82 | 84 | ||
| 83 | this.BuiltOutputsFile = this.commandLine.BuiltOutputsFile; | 85 | this.BuiltOutputsFile = this.commandLine.BuiltOutputsFile; |
| 84 | 86 | ||
| 87 | this.DefaultCompressionLevel = this.commandLine.DefaultCompressionLevel; | ||
| 88 | |||
| 85 | var preprocessorVariables = this.commandLine.GatherPreprocessorVariables(); | 89 | var preprocessorVariables = this.commandLine.GatherPreprocessorVariables(); |
| 86 | 90 | ||
| 87 | var sourceFiles = this.commandLine.GatherSourceFiles(this.IntermediateFolder); | 91 | var sourceFiles = this.commandLine.GatherSourceFiles(this.IntermediateFolder); |
| @@ -335,7 +339,7 @@ namespace WixToolset.Core.CommandLine | |||
| 335 | //context.CabbingThreadCount = this.CabbingThreadCount; | 339 | //context.CabbingThreadCount = this.CabbingThreadCount; |
| 336 | context.CabCachePath = cabCachePath; | 340 | context.CabCachePath = cabCachePath; |
| 337 | context.Codepage = resolveResult.Codepage; | 341 | context.Codepage = resolveResult.Codepage; |
| 338 | //context.DefaultCompressionLevel = this.DefaultCompressionLevel; | 342 | context.DefaultCompressionLevel = this.DefaultCompressionLevel; |
| 339 | context.DelayedFields = resolveResult.DelayedFields; | 343 | context.DelayedFields = resolveResult.DelayedFields; |
| 340 | context.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; | 344 | context.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; |
| 341 | context.Extensions = this.ExtensionManager.GetServices<IBinderExtension>(); | 345 | context.Extensions = this.ExtensionManager.GetServices<IBinderExtension>(); |
| @@ -529,6 +533,8 @@ namespace WixToolset.Core.CommandLine | |||
| 529 | 533 | ||
| 530 | public string OutputType { get; private set; } | 534 | public string OutputType { get; private set; } |
| 531 | 535 | ||
| 536 | public CompressionLevel? DefaultCompressionLevel { get; private set; } | ||
| 537 | |||
| 532 | public string ContentsFile { get; private set; } | 538 | public string ContentsFile { get; private set; } |
| 533 | 539 | ||
| 534 | public string OutputsFile { get; private set; } | 540 | public string OutputsFile { get; private set; } |
| @@ -611,6 +617,18 @@ namespace WixToolset.Core.CommandLine | |||
| 611 | parser.GetNextArgumentOrError(arg, this.Defines); | 617 | parser.GetNextArgumentOrError(arg, this.Defines); |
| 612 | return true; | 618 | return true; |
| 613 | 619 | ||
| 620 | case "dcl": | ||
| 621 | case "defaultcompressionlevel": | ||
| 622 | { | ||
| 623 | var value = parser.GetNextArgumentOrError(arg); | ||
| 624 | if (Enum.TryParse(value, true, out CompressionLevel compressionLevel)) | ||
| 625 | { | ||
| 626 | this.DefaultCompressionLevel = compressionLevel; | ||
| 627 | return true; | ||
| 628 | } | ||
| 629 | return false; | ||
| 630 | } | ||
| 631 | |||
| 614 | case "i": | 632 | case "i": |
| 615 | case "includepath": | 633 | case "includepath": |
| 616 | parser.GetNextArgumentOrError(arg, this.IncludeSearchPaths); | 634 | parser.GetNextArgumentOrError(arg, this.IncludeSearchPaths); |
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 14b28034..003617cc 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
| @@ -7319,7 +7319,7 @@ namespace WixToolset.Core | |||
| 7319 | string volumeLabel = null; | 7319 | string volumeLabel = null; |
| 7320 | int? maximumUncompressedMediaSize = null; | 7320 | int? maximumUncompressedMediaSize = null; |
| 7321 | int? maximumCabinetSizeForLargeFileSplitting = null; | 7321 | int? maximumCabinetSizeForLargeFileSplitting = null; |
| 7322 | CompressionLevel? compressionLevel = null; // this defaults to mszip in Binder | 7322 | CompressionLevel? compressionLevel = null; // this defaults to 'medium' in the MSI and Burn backends |
| 7323 | 7323 | ||
| 7324 | var embedCab = patch ? YesNoType.Yes : YesNoType.NotSet; | 7324 | var embedCab = patch ? YesNoType.Yes : YesNoType.NotSet; |
| 7325 | 7325 | ||
diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index af56f0ef..f5f450cb 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs | |||
| @@ -4958,7 +4958,7 @@ namespace WixToolset.Core | |||
| 4958 | case "": | 4958 | case "": |
| 4959 | break; | 4959 | break; |
| 4960 | default: | 4960 | default: |
| 4961 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attribute.Name.LocalName, compressionLevel, "high", "low", "medium", "mszip", "none")); | 4961 | this.Core.Write(ErrorMessages.IllegalCompressionLevel(sourceLineNumbers, compressionLevel)); |
| 4962 | break; | 4962 | break; |
| 4963 | } | 4963 | } |
| 4964 | 4964 | ||
