aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2021-01-28 20:40:46 -0500
committerBob Arnson <bob@firegiant.com>2021-01-28 20:48:48 -0500
commit8e60e672e42202589f8827c06a69970b330d8d81 (patch)
tree025fdeeb17b7c27d18b5bb93d1a6095e3efc3404
parent2accc355d9dadb2688cf226f8736232d583281aa (diff)
downloadwix-8e60e672e42202589f8827c06a69970b330d8d81.tar.gz
wix-8e60e672e42202589f8827c06a69970b330d8d81.tar.bz2
wix-8e60e672e42202589f8827c06a69970b330d8d81.zip
Fix Package/@Compressed for new (compressed) default.
-rw-r--r--src/WixToolset.Converters/WixConverter.cs10
-rw-r--r--src/test/WixToolsetTest.Converters/ConditionFixture.cs2
-rw-r--r--src/test/WixToolsetTest.Converters/ProductPackageFixture.cs62
-rw-r--r--src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs4
-rw-r--r--src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs4
-rw-r--r--src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs4
-rw-r--r--src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs4
7 files changed, 72 insertions, 18 deletions
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
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."); 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 } 965 }
966 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
967 RemoveAttribute(xSummaryInformation, "AdminImage"); 976 RemoveAttribute(xSummaryInformation, "AdminImage");
968 RemoveAttribute(xSummaryInformation, "Comments"); 977 RemoveAttribute(xSummaryInformation, "Comments");
969 MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "no");
970 RemoveAttribute(xSummaryInformation, "Id"); 978 RemoveAttribute(xSummaryInformation, "Id");
971 MoveAttribute(xSummaryInformation, "InstallerVersion", xPackage, defaultValue: "500"); 979 MoveAttribute(xSummaryInformation, "InstallerVersion", xPackage, defaultValue: "500");
972 MoveAttribute(xSummaryInformation, "InstallScope", xPackage, "Scope", defaultValue: "perMachine"); 980 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
233 var expected = new[] 233 var expected = new[]
234 { 234 {
235 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 235 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
236 " <Package>", 236 " <Package Compressed=\"no\">",
237 " ", 237 " ",
238 " <Launch Condition=\"1&lt;2\" Message=\"Stop the install\" />", 238 " <Launch Condition=\"1&lt;2\" Message=\"Stop the install\" />",
239 " <Launch Condition=\"1=2\" Message=\"Do not stop\" />", 239 " <Launch Condition=\"1=2\" Message=\"Do not stop\" />",
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
14 public class ProductPackageFixture : BaseConverterFixture 14 public class ProductPackageFixture : BaseConverterFixture
15 { 15 {
16 [Fact] 16 [Fact]
17 public void FixesCompressed() 17 public void FixesCompressedWhenYes()
18 { 18 {
19 var parse = String.Join(Environment.NewLine, 19 var parse = String.Join(Environment.NewLine,
20 "<?xml version=\"1.0\" encoding=\"utf-16\"?>", 20 "<?xml version=\"1.0\" encoding=\"utf-16\"?>",
@@ -27,7 +27,53 @@ namespace WixToolsetTest.Converters
27 var expected = new[] 27 var expected = new[]
28 { 28 {
29 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 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\">",
31 " ", 77 " ",
32 " </Package>", 78 " </Package>",
33 "</Wix>" 79 "</Wix>"
@@ -64,7 +110,7 @@ namespace WixToolsetTest.Converters
64 var expected = new[] 110 var expected = new[]
65 { 111 {
66 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 112 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
67 " <Package InstallerVersion=\"666\">", 113 " <Package Compressed=\"no\" InstallerVersion=\"666\">",
68 " ", 114 " ",
69 " </Package>", 115 " </Package>",
70 "</Wix>" 116 "</Wix>"
@@ -87,7 +133,7 @@ namespace WixToolsetTest.Converters
87 var expected = new[] 133 var expected = new[]
88 { 134 {
89 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 135 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
90 " <Package>", 136 " <Package Compressed=\"no\">",
91 " ", 137 " ",
92 " </Package>", 138 " </Package>",
93 "</Wix>" 139 "</Wix>"
@@ -110,7 +156,7 @@ namespace WixToolsetTest.Converters
110 var expected = new[] 156 var expected = new[]
111 { 157 {
112 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 158 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
113 " <Package>", 159 " <Package Compressed=\"no\">",
114 " ", 160 " ",
115 " </Package>", 161 " </Package>",
116 "</Wix>" 162 "</Wix>"
@@ -133,7 +179,7 @@ namespace WixToolsetTest.Converters
133 var expected = new[] 179 var expected = new[]
134 { 180 {
135 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 181 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
136 " <Package InstallerVersion=\"200\">", 182 " <Package Compressed=\"no\" InstallerVersion=\"200\">",
137 " ", 183 " ",
138 " </Package>", 184 " </Package>",
139 "</Wix>" 185 "</Wix>"
@@ -156,7 +202,7 @@ namespace WixToolsetTest.Converters
156 var expected = new[] 202 var expected = new[]
157 { 203 {
158 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 204 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
159 " <Package Scope=\"perUser\">", 205 " <Package Compressed=\"no\" Scope=\"perUser\">",
160 " ", 206 " ",
161 " </Package>", 207 " </Package>",
162 "</Wix>" 208 "</Wix>"
@@ -180,7 +226,7 @@ namespace WixToolsetTest.Converters
180 var expected = new[] 226 var expected = new[]
181 { 227 {
182 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", 228 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
183 " <Package>", 229 " <Package Compressed=\"no\">",
184 " ", 230 " ",
185 " ", 231 " ",
186 " </Package>", 232 " </Package>",
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 @@
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 2
3 3
4 4
5<?include WixVer.wxi ?> 5<?include WixVer.wxi ?>
6 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"> 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 9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> 10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11 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 @@
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 2
3 3
4 4
5<?include WixVer.wxi ?> 5<?include WixVer.wxi ?>
6 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"> 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 9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> 10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11 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 @@
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 2
3 3
4 4
5<?include WixVer.wxi ?> 5<?include WixVer.wxi ?>
6 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"> 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 9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> 10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11 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 @@
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 2
3 3
4 4
5<?include WixVer.wxi ?> 5<?include WixVer.wxi ?>
6 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"> 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 9
10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> 10 <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" />
11 11