@joebigelow / wix / commits / 8e60e672

Fix Package/@Compressed for new (compressed) default.

Bob Arnson committed Jan 28, 2021 at 20:40 UTC 8e60e672e42202589f8827c06a69970b330d8d81
7 files changed +72 -18
src/WixToolset.Converters/WixConverter.cs
+9 -1
@@ -964,9 +964,17 @@ namespace WixToolset.Converters
964 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.");
965 }
966
967 + if (xSummaryInformation.Attribute("Compressed") == null)
968 + {
969 + xPackage.SetAttributeValue("Compressed", "no");
970 + }
971 + else
972 + {
973 + MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "yes");
974 + }
975 +
976 RemoveAttribute(xSummaryInformation, "AdminImage");
977 RemoveAttribute(xSummaryInformation, "Comments");
969 - MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "no");
978 RemoveAttribute(xSummaryInformation, "Id");
979 MoveAttribute(xSummaryInformation, "InstallerVersion", xPackage, defaultValue: "500");
980 MoveAttribute(xSummaryInformation, "InstallScope", xPackage, "Scope", defaultValue: "perMachine");
src/test/WixToolsetTest.Converters/ConditionFixture.cs
+1 -1
@@ -233,7 +233,7 @@ namespace WixToolsetTest.Converters
233 var expected = new[]
234 {
235 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
236 - " <Package>",
236 + " <Package Compressed=\"no\">",
237 " ",
238 " <Launch Condition=\"1&lt;2\" Message=\"Stop the install\" />",
239 " <Launch Condition=\"1=2\" Message=\"Do not stop\" />",
src/test/WixToolsetTest.Converters/ProductPackageFixture.cs
+54 -8
@@ -14,7 +14,7 @@ namespace WixToolsetTest.Converters
14 public class ProductPackageFixture : BaseConverterFixture
15 {
16 [Fact]
17 - public void FixesCompressed()
17 + public void FixesCompressedWhenYes()
18 {
19 var parse = String.Join(Environment.NewLine,
20 "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
@@ -27,7 +27,53 @@ namespace WixToolsetTest.Converters
27 var expected = new[]
28 {
29 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
30 - " <Package Compressed=\"yes\">",
30 + " <Package>",
31 + " ",
32 + " </Package>",
33 + "</Wix>"
34 + };
35 +
36 + AssertSuccess(parse, 4, expected);
37 + }
38 +
39 + [Fact]
40 + public void FixesCompressedWhenNo()
41 + {
42 + var parse = String.Join(Environment.NewLine,
43 + "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
44 + "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>",
45 + " <Product>",
46 + " <Package Compressed='no' />",
47 + " </Product>",
48 + "</Wix>");
49 +
50 + var expected = new[]
51 + {
52 + "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
53 + " <Package Compressed=\"no\">",
54 + " ",
55 + " </Package>",
56 + "</Wix>"
57 + };
58 +
59 + AssertSuccess(parse, 4, expected);
60 + }
61 +
62 + [Fact]
63 + public void FixesCompressedWhenOmitted()
64 + {
65 + var parse = String.Join(Environment.NewLine,
66 + "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
67 + "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>",
68 + " <Product>",
69 + " <Package />",
70 + " </Product>",
71 + "</Wix>");
72 +
73 + var expected = new[]
74 + {
75 + "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
76 + " <Package Compressed=\"no\">",
77 " ",
78 " </Package>",
79 "</Wix>"
@@ -64,7 +110,7 @@ namespace WixToolsetTest.Converters
110 var expected = new[]
111 {
112 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
67 - " <Package InstallerVersion=\"666\">",
113 + " <Package Compressed=\"no\" InstallerVersion=\"666\">",
114 " ",
115 " </Package>",
116 "</Wix>"
@@ -87,7 +133,7 @@ namespace WixToolsetTest.Converters
133 var expected = new[]
134 {
135 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
90 - " <Package>",
136 + " <Package Compressed=\"no\">",
137 " ",
138 " </Package>",
139 "</Wix>"
@@ -110,7 +156,7 @@ namespace WixToolsetTest.Converters
156 var expected = new[]
157 {
158 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
113 - " <Package>",
159 + " <Package Compressed=\"no\">",
160 " ",
161 " </Package>",
162 "</Wix>"
@@ -133,7 +179,7 @@ namespace WixToolsetTest.Converters
179 var expected = new[]
180 {
181 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
136 - " <Package InstallerVersion=\"200\">",
182 + " <Package Compressed=\"no\" InstallerVersion=\"200\">",
183 " ",
184 " </Package>",
185 "</Wix>"
@@ -156,7 +202,7 @@ namespace WixToolsetTest.Converters
202 var expected = new[]
203 {
204 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
159 - " <Package Scope=\"perUser\">",
205 + " <Package Compressed=\"no\" Scope=\"perUser\">",
206 " ",
207 " </Package>",
208 "</Wix>"
@@ -180,7 +226,7 @@ namespace WixToolsetTest.Converters
226 var expected = new[]
227 {
228 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
183 - " <Package>",
229 + " <Package Compressed=\"no\">",
230 " ",
231 " ",
232 " </Package>",
src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs
+2 -2
@@ -1,11 +1,11 @@
1 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
4
5 <?include WixVer.wxi ?>
6
7 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:swid="http://wixtoolset.org/schemas/v4/wxs/tag" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
8 - <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" Compressed="yes" InstallerVersion="200">
8 + <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" InstallerVersion="200">
9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11
src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs
+2 -2
@@ -1,11 +1,11 @@
1 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
4
5 <?include WixVer.wxi ?>
6
7 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:swid="http://wixtoolset.org/schemas/v4/wxs/tag" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
8 - <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" Compressed="yes" InstallerVersion="200">
8 + <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" InstallerVersion="200">
9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11
src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs
+2 -2
@@ -1,11 +1,11 @@
1 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
4
5 <?include WixVer.wxi ?>
6
7 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:swid="http://wixtoolset.org/schemas/v4/wxs/tag" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
8 - <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" Compressed="yes" InstallerVersion="200">
8 + <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" InstallerVersion="200">
9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11
src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs
+2 -2
@@ -1,11 +1,11 @@
1 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
1 +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2
3
4
5 <?include WixVer.wxi ?>
6
7 <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:swid="http://wixtoolset.org/schemas/v4/wxs/tag" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
8 - <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" Compressed="yes" InstallerVersion="200">
8 + <Package Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D" InstallerVersion="200">
9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11