diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-23 01:11:19 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-23 16:56:04 -0700 |
| commit | 9c235551b2fb961cf10ecb307c252fd5de377513 (patch) | |
| tree | cb1e112e14212655f7dcf985009a158578a967b0 /src | |
| parent | 7987d2f7e2d47427d7571ab7cc3640d7b0bbb7ff (diff) | |
| download | wix-9c235551b2fb961cf10ecb307c252fd5de377513.tar.gz wix-9c235551b2fb961cf10ecb307c252fd5de377513.tar.bz2 wix-9c235551b2fb961cf10ecb307c252fd5de377513.zip | |
Remove explicit auto-GUIDs
Diffstat (limited to 'src')
7 files changed, 30 insertions, 7 deletions
diff --git a/src/WixToolset.Converters/Wix3Converter.cs b/src/WixToolset.Converters/Wix3Converter.cs index 27c29e4d..2d603c4f 100644 --- a/src/WixToolset.Converters/Wix3Converter.cs +++ b/src/WixToolset.Converters/Wix3Converter.cs | |||
| @@ -407,6 +407,15 @@ namespace WixToolset.Converters | |||
| 407 | 407 | ||
| 408 | private void ConvertComponentElement(XElement element) | 408 | private void ConvertComponentElement(XElement element) |
| 409 | { | 409 | { |
| 410 | var guid = element.Attribute("Guid"); | ||
| 411 | if (guid != null && guid.Value == "*") | ||
| 412 | { | ||
| 413 | if (this.OnError(ConverterTestType.AutoGuidUnnecessary, element, "Using '*' for the Component Guid attribute is unnecessary. Remove the attribute to remove the redundancy.")) | ||
| 414 | { | ||
| 415 | guid.Remove(); | ||
| 416 | } | ||
| 417 | } | ||
| 418 | |||
| 410 | var xCondition = element.Element(ConditionElementName); | 419 | var xCondition = element.Element(ConditionElementName); |
| 411 | if (xCondition != null) | 420 | if (xCondition != null) |
| 412 | { | 421 | { |
| @@ -523,6 +532,15 @@ namespace WixToolset.Converters | |||
| 523 | 532 | ||
| 524 | private void ConvertProductElement(XElement element) | 533 | private void ConvertProductElement(XElement element) |
| 525 | { | 534 | { |
| 535 | var id = element.Attribute("Id"); | ||
| 536 | if (id != null && id.Value == "*") | ||
| 537 | { | ||
| 538 | if (this.OnError(ConverterTestType.AutoGuidUnnecessary, element, "Using '*' for the Product Id attribute is unnecessary. Remove the attribute to remove the redundancy.")) | ||
| 539 | { | ||
| 540 | id.Remove(); | ||
| 541 | } | ||
| 542 | } | ||
| 543 | |||
| 526 | var xCondition = element.Element(ConditionElementName); | 544 | var xCondition = element.Element(ConditionElementName); |
| 527 | if (xCondition != null) | 545 | if (xCondition != null) |
| 528 | { | 546 | { |
| @@ -1029,6 +1047,11 @@ namespace WixToolset.Converters | |||
| 1029 | /// Inner text value should move to an attribute. | 1047 | /// Inner text value should move to an attribute. |
| 1030 | /// </summary> | 1048 | /// </summary> |
| 1031 | InnerTextDeprecated, | 1049 | InnerTextDeprecated, |
| 1050 | |||
| 1051 | /// <summary> | ||
| 1052 | /// Explicit auto-GUID unnecessary. | ||
| 1053 | /// </summary> | ||
| 1054 | AutoGuidUnnecessary, | ||
| 1032 | } | 1055 | } |
| 1033 | } | 1056 | } |
| 1034 | } | 1057 | } |
diff --git a/src/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/test/WixToolsetTest.Converters/ConditionFixture.cs index bd7f52a8..6a5ce1f9 100644 --- a/src/test/WixToolsetTest.Converters/ConditionFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConditionFixture.cs | |||
| @@ -171,7 +171,7 @@ namespace WixToolsetTest.Converters | |||
| 171 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", | 171 | "<?xml version=\"1.0\" encoding=\"utf-16\"?>", |
| 172 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | 172 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", |
| 173 | " <Fragment>", | 173 | " <Fragment>", |
| 174 | " <Component Id='Comp1' Directory='ApplicationFolder'>", | 174 | " <Component Id='Comp1' Guid='*' Directory='ApplicationFolder'>", |
| 175 | " <PermissionEx Sddl='sddl'>", | 175 | " <PermissionEx Sddl='sddl'>", |
| 176 | " <Condition>1<2</Condition>", | 176 | " <Condition>1<2</Condition>", |
| 177 | " </PermissionEx>", | 177 | " </PermissionEx>", |
| @@ -199,7 +199,7 @@ namespace WixToolsetTest.Converters | |||
| 199 | var converter = new Wix3Converter(messaging, 2, null, null); | 199 | var converter = new Wix3Converter(messaging, 2, null, null); |
| 200 | 200 | ||
| 201 | var errors = converter.ConvertDocument(document); | 201 | var errors = converter.ConvertDocument(document); |
| 202 | Assert.Equal(3, errors); | 202 | Assert.Equal(4, errors); |
| 203 | 203 | ||
| 204 | var actualLines = UnformattedDocumentLines(document); | 204 | var actualLines = UnformattedDocumentLines(document); |
| 205 | CompareLineByLine(expected, actualLines); | 205 | CompareLineByLine(expected, actualLines); |
diff --git a/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs b/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs index 860c195f..d05f8e8f 100644 --- a/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs | |||
| @@ -58,7 +58,7 @@ namespace WixToolsetTest.Converters | |||
| 58 | var converter = new Wix3Converter(messaging, 4); | 58 | var converter = new Wix3Converter(messaging, 4); |
| 59 | var errors = converter.ConvertFile(targetFile, true); | 59 | var errors = converter.ConvertFile(targetFile, true); |
| 60 | 60 | ||
| 61 | Assert.Equal(5, errors); | 61 | Assert.Equal(6, errors); |
| 62 | 62 | ||
| 63 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); | 63 | var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n"); |
| 64 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); | 64 | var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n"); |
diff --git a/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs b/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs index dcd43e35..72c78653 100644 --- a/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/Preprocessor/ConvertedPreprocessor.wxs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <?include WixVer.wxi ?> | 6 | <?include WixVer.wxi ?> |
| 7 | 7 | ||
| 8 | <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 | <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"> |
| 9 | <Product Id="*" Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> | 9 | <Product Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> |
| 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> | 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> |
| 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> | 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> |
| 12 | 12 | ||
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 b28c94e4..20a5b1d0 100644 --- a/src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <?include WixVer.wxi ?> | 6 | <?include WixVer.wxi ?> |
| 7 | 7 | ||
| 8 | <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 | <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"> |
| 9 | <Product Id="*" Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> | 9 | <Product Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> |
| 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> | 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> |
| 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> | 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> |
| 12 | 12 | ||
diff --git a/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs b/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs index 99cc2151..cb42ea7d 100644 --- a/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <?include WixVer.wxi ?> | 6 | <?include WixVer.wxi ?> |
| 7 | 7 | ||
| 8 | <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 | <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"> |
| 9 | <Product Id="*" Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> | 9 | <Product Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> |
| 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> | 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> |
| 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> | 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> |
| 12 | 12 | ||
diff --git a/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs b/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs index aacb68fa..0c4fd1fb 100644 --- a/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs +++ b/src/test/WixToolsetTest.Converters/TestData/SingleFile/ConvertedSingleFile.wxs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <?include WixVer.wxi ?> | 6 | <?include WixVer.wxi ?> |
| 7 | 7 | ||
| 8 | <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 | <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"> |
| 9 | <Product Id="*" Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> | 9 | <Product Name="!(loc.ShortProduct) v$(var.WixMajorMinor) Core" Language="1033" Manufacturer="!(loc.Company)" Version="$(var.WixMsiProductVersion)" UpgradeCode="3618724B-2523-44F9-A908-866AA619504D"> |
| 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> | 10 | <Package Compressed="yes" InstallerVersion="200" SummaryCodepage="1252" InstallScope="perMachine" /> |
| 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> | 11 | <swid:Tag Regid="!(loc.Regid)" InstallDirectory="INSTALLFOLDER" /> |
| 12 | 12 | ||
