diff options
| author | Bob Arnson <bob@firegiant.com> | 2020-11-04 19:10:55 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2020-11-04 19:12:51 -0500 |
| commit | 6a96c2ee082c37fd12d071514cab450f0c18618a (patch) | |
| tree | fea7dcc45a0a994c7627352af21c8c93f8a55442 /src | |
| parent | 06b0b7b3e5504d062fc2226dd9a64dc4efa41f47 (diff) | |
| download | wix-6a96c2ee082c37fd12d071514cab450f0c18618a.tar.gz wix-6a96c2ee082c37fd12d071514cab450f0c18618a.tar.bz2 wix-6a96c2ee082c37fd12d071514cab450f0c18618a.zip | |
Warn about new InstallerVersion default.
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Converters/WixConverter.cs | 17 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters/ConditionFixture.cs | 2 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters/ProductPackageFixture.cs | 29 |
3 files changed, 44 insertions, 4 deletions
diff --git a/src/WixToolset.Converters/WixConverter.cs b/src/WixToolset.Converters/WixConverter.cs index c713045e..be09a683 100644 --- a/src/WixToolset.Converters/WixConverter.cs +++ b/src/WixToolset.Converters/WixConverter.cs | |||
| @@ -687,6 +687,12 @@ namespace WixToolset.Converters | |||
| 687 | { | 687 | { |
| 688 | xSummaryInformation.Name = SummaryInformationElementName; | 688 | xSummaryInformation.Name = SummaryInformationElementName; |
| 689 | 689 | ||
| 690 | var xInstallerVersion = xSummaryInformation.Attribute("InstallerVersion"); | ||
| 691 | if (this.SourceVersion < 4 && xInstallerVersion == null) | ||
| 692 | { | ||
| 693 | 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 Module element."); | ||
| 694 | } | ||
| 695 | |||
| 690 | RemoveAttribute(xSummaryInformation, "AdminImage"); | 696 | RemoveAttribute(xSummaryInformation, "AdminImage"); |
| 691 | RemoveAttribute(xSummaryInformation, "Comments"); | 697 | RemoveAttribute(xSummaryInformation, "Comments"); |
| 692 | MoveAttribute(xSummaryInformation, "Id", xModule, "Guid"); | 698 | MoveAttribute(xSummaryInformation, "Id", xModule, "Guid"); |
| @@ -750,6 +756,12 @@ namespace WixToolset.Converters | |||
| 750 | { | 756 | { |
| 751 | xSummaryInformation.Name = SummaryInformationElementName; | 757 | xSummaryInformation.Name = SummaryInformationElementName; |
| 752 | 758 | ||
| 759 | var xInstallerVersion = xSummaryInformation.Attribute("InstallerVersion"); | ||
| 760 | if (this.SourceVersion < 4 && xInstallerVersion == null) | ||
| 761 | { | ||
| 762 | 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."); | ||
| 763 | } | ||
| 764 | |||
| 753 | RemoveAttribute(xSummaryInformation, "AdminImage"); | 765 | RemoveAttribute(xSummaryInformation, "AdminImage"); |
| 754 | RemoveAttribute(xSummaryInformation, "Comments"); | 766 | RemoveAttribute(xSummaryInformation, "Comments"); |
| 755 | MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "no"); | 767 | MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "no"); |
| @@ -1456,6 +1468,11 @@ namespace WixToolset.Converters | |||
| 1456 | /// DisplayInternalUI can't be converted. | 1468 | /// DisplayInternalUI can't be converted. |
| 1457 | /// </summary> | 1469 | /// </summary> |
| 1458 | DisplayInternalUiNotConvertable, | 1470 | DisplayInternalUiNotConvertable, |
| 1471 | |||
| 1472 | /// <summary> | ||
| 1473 | /// InstallerVersion has breaking change when missing. | ||
| 1474 | /// </summary> | ||
| 1475 | InstallerVersionBehaviorChange, | ||
| 1459 | } | 1476 | } |
| 1460 | } | 1477 | } |
| 1461 | } | 1478 | } |
diff --git a/src/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/test/WixToolsetTest.Converters/ConditionFixture.cs index 75ceec31..e5f33b04 100644 --- a/src/test/WixToolsetTest.Converters/ConditionFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConditionFixture.cs | |||
| @@ -247,7 +247,7 @@ namespace WixToolsetTest.Converters | |||
| 247 | var converter = new WixConverter(messaging, 2, null, null); | 247 | var converter = new WixConverter(messaging, 2, null, null); |
| 248 | 248 | ||
| 249 | var errors = converter.ConvertDocument(document); | 249 | var errors = converter.ConvertDocument(document); |
| 250 | Assert.Equal(5, errors); | 250 | Assert.Equal(6, errors); |
| 251 | 251 | ||
| 252 | var actualLines = UnformattedDocumentLines(document); | 252 | var actualLines = UnformattedDocumentLines(document); |
| 253 | WixAssert.CompareLineByLine(expected, actualLines); | 253 | WixAssert.CompareLineByLine(expected, actualLines); |
diff --git a/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs b/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs index 9407ff16..94681a4c 100644 --- a/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs +++ b/src/test/WixToolsetTest.Converters/ProductPackageFixture.cs | |||
| @@ -33,7 +33,7 @@ namespace WixToolsetTest.Converters | |||
| 33 | "</Wix>" | 33 | "</Wix>" |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | AssertSuccess(parse, 3, expected); | 36 | AssertSuccess(parse, 4, expected); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | private static void AssertSuccess(string input, int expectedErrorCount, string[] expected) | 39 | private static void AssertSuccess(string input, int expectedErrorCount, string[] expected) |
| @@ -97,6 +97,29 @@ namespace WixToolsetTest.Converters | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | [Fact] | 99 | [Fact] |
| 100 | public void FixesImplicitInstallerVersion() | ||
| 101 | { | ||
| 102 | var parse = String.Join(Environment.NewLine, | ||
| 103 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | ||
| 104 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | ||
| 105 | " <Product>", | ||
| 106 | " <Package />", | ||
| 107 | " </Product>", | ||
| 108 | "</Wix>"); | ||
| 109 | |||
| 110 | var expected = new[] | ||
| 111 | { | ||
| 112 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 113 | " <Package>", | ||
| 114 | " ", | ||
| 115 | " </Package>", | ||
| 116 | "</Wix>" | ||
| 117 | }; | ||
| 118 | |||
| 119 | AssertSuccess(parse, 4, expected); | ||
| 120 | } | ||
| 121 | |||
| 122 | [Fact] | ||
| 100 | public void FixesNonDefaultInstallerVersion() | 123 | public void FixesNonDefaultInstallerVersion() |
| 101 | { | 124 | { |
| 102 | var parse = String.Join(Environment.NewLine, | 125 | var parse = String.Join(Environment.NewLine, |
| @@ -139,7 +162,7 @@ namespace WixToolsetTest.Converters | |||
| 139 | "</Wix>" | 162 | "</Wix>" |
| 140 | }; | 163 | }; |
| 141 | 164 | ||
| 142 | AssertSuccess(parse, 3, expected); | 165 | AssertSuccess(parse, 4, expected); |
| 143 | } | 166 | } |
| 144 | 167 | ||
| 145 | [Fact] | 168 | [Fact] |
| @@ -164,7 +187,7 @@ namespace WixToolsetTest.Converters | |||
| 164 | "</Wix>" | 187 | "</Wix>" |
| 165 | }; | 188 | }; |
| 166 | 189 | ||
| 167 | AssertSuccess(parse, 3, expected); | 190 | AssertSuccess(parse, 4, expected); |
| 168 | } | 191 | } |
| 169 | 192 | ||
| 170 | [Fact] | 193 | [Fact] |
