From 8e60e672e42202589f8827c06a69970b330d8d81 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Thu, 28 Jan 2021 20:40:46 -0500 Subject: Fix Package/@Compressed for new (compressed) default. --- src/WixToolset.Converters/WixConverter.cs | 10 +++- .../WixToolsetTest.Converters/ConditionFixture.cs | 2 +- .../ProductPackageFixture.cs | 62 +++++++++++++++++++--- .../Preprocessor/ConvertedPreprocessor.wxs | 4 +- .../TestData/QtExec.bad/v4_expected.wxs | 4 +- .../TestData/QtExec/v4_expected.wxs | 4 +- .../TestData/SingleFile/ConvertedSingleFile.wxs | 4 +- 7 files changed, 72 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Converters/WixConverter.cs b/src/WixToolset.Converters/WixConverter.cs index a7f08b88..c78e2245 100644 --- a/src/WixToolset.Converters/WixConverter.cs +++ b/src/WixToolset.Converters/WixConverter.cs @@ -964,9 +964,17 @@ namespace WixToolset.Converters this.OnError(ConverterTestType.InstallerVersionBehaviorChange, element, "Breaking change: The default value for Package/@InstallerVersion has been changed to '500' regardless of build platform. If you need a lower version, set it manually in the Package element."); } + if (xSummaryInformation.Attribute("Compressed") == null) + { + xPackage.SetAttributeValue("Compressed", "no"); + } + else + { + MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "yes"); + } + RemoveAttribute(xSummaryInformation, "AdminImage"); RemoveAttribute(xSummaryInformation, "Comments"); - MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "no"); RemoveAttribute(xSummaryInformation, "Id"); MoveAttribute(xSummaryInformation, "InstallerVersion", xPackage, defaultValue: "500"); MoveAttribute(xSummaryInformation, "InstallScope", xPackage, "Scope", defaultValue: "perMachine"); diff --git a/src/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/test/WixToolsetTest.Converters/ConditionFixture.cs index e5f33b04..d3f65aeb 100644 --- a/src/test/WixToolsetTest.Converters/ConditionFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConditionFixture.cs @@ -233,7 +233,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", " ", diff --git a/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs b/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs index 94681a4c..e01b9789 100644 --- a/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs +++ b/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs @@ -14,7 +14,7 @@ namespace WixToolsetTest.Converters public class ProductPackageFixture : BaseConverterFixture { [Fact] - public void FixesCompressed() + public void FixesCompressedWhenYes() { var parse = String.Join(Environment.NewLine, "", @@ -27,7 +27,53 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", + " ", + " ", + "" + }; + + AssertSuccess(parse, 4, expected); + } + + [Fact] + public void FixesCompressedWhenNo() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var expected = new[] + { + "", + " ", + " ", + " ", + "" + }; + + AssertSuccess(parse, 4, expected); + } + + [Fact] + public void FixesCompressedWhenOmitted() + { + var parse = String.Join(Environment.NewLine, + "", + "", + " ", + " ", + " ", + ""); + + var expected = new[] + { + "", + " ", " ", " ", "" @@ -64,7 +110,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", "" @@ -87,7 +133,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", "" @@ -110,7 +156,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", "" @@ -133,7 +179,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", "" @@ -156,7 +202,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", "" @@ -180,7 +226,7 @@ namespace WixToolsetTest.Converters var expected = new[] { "", - " ", + " ", " ", " ", " ", diff --git a/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs index e601ae2a..b2302b4c 100644 --- a/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs @@ -1,11 +1,11 @@ - + - + diff --git a/src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs b/src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs index 169eb07e..f26b5d1a 100644 --- a/src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs @@ -1,11 +1,11 @@ - + - + diff --git a/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs b/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs index 71df9fd9..f5a02e2b 100644 --- a/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs @@ -1,11 +1,11 @@ - + - + diff --git a/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs b/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs index b52f5855..9a83c237 100644 --- a/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs @@ -1,11 +1,11 @@ - + - + -- cgit v1.2.3-55-g6feb