@joebigelow / wix-1 / commits / 04e2665c

Replace BinaryKey with BinaryRef and FileKey with FileRef.

Bob Arnson committed Sep 6, 2020 at 21:14 UTC 04e2665cf230390c458edcc91ad0bac4b43e9195
5 files changed +28 -10
src/WixToolset.Converters/WixConverter.cs
+19 -1
@@ -469,7 +469,7 @@ namespace WixToolset.Converters
469 if (modularization != null)
470 {
471 var camelCaseValue = LowercaseFirstChar(modularization.Value);
472 - if (category.Value != camelCaseValue &&
472 + if (modularization.Value != camelCaseValue &&
473 this.OnError(ConverterTestType.ColumnModularizeCamelCase, element, "The CustomTable Modularize attribute contains an incorrectly cased '{0}' value. Lowercase the first character instead.", modularization.Name))
474 {
475 modularization.Value = camelCaseValue;
@@ -759,6 +759,19 @@ namespace WixToolset.Converters
759 private void ConvertCustomActionElement(XElement xCustomAction)
760 {
761 var xBinaryKey = xCustomAction.Attribute("BinaryKey");
762 + if (xBinaryKey != null && this.OnError(ConverterTestType.CustomActionKeysAreNowRefs, xCustomAction, "The CustomAction attributes have been renamed from BinaryKey and FileKey to BinaryRef and FileRef."))
763 + {
764 + xCustomAction.SetAttributeValue("BinaryRef", xBinaryKey.Value);
765 + xBinaryKey.Remove();
766 + xBinaryKey = xCustomAction.Attribute("BinaryRef");
767 + }
768 +
769 + var xFileKey = xCustomAction.Attribute("FileKey");
770 + if (xFileKey != null && this.OnError(ConverterTestType.CustomActionKeysAreNowRefs, xCustomAction, "The CustomAction attributes have been renamed from BinaryKey and FileKey to BinaryRef and FileRef."))
771 + {
772 + xCustomAction.SetAttributeValue("FileRef", xFileKey.Value);
773 + xFileKey.Remove();
774 + }
775
776 if (xBinaryKey?.Value == "WixCA" || xBinaryKey?.Value == "UtilCA")
777 {
@@ -1282,6 +1295,11 @@ namespace WixToolset.Converters
1295 /// The string variable type was previously treated as formatted.
1296 /// </summary>
1297 AssignVariableTypeFormatted,
1298 +
1299 + /// <summary>
1300 + /// The CustomAction attributes have been renamed from BinaryKey and FileKey to BinaryRef and FileRef.
1301 + /// </summary>
1302 + CustomActionKeysAreNowRefs,
1303 }
1304 }
1305 }
src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs
+2 -2
@@ -108,7 +108,7 @@ namespace WixToolsetTest.Converters
108 File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName));
109
110 var result = RunConversion(targetFile);
111 - Assert.Equal(10, result.ExitCode);
111 + Assert.Equal(11, result.ExitCode);
112
113 var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n");
114 var actual = File.ReadAllText(targetFile).Replace("\r\n", "\n");
@@ -133,7 +133,7 @@ namespace WixToolsetTest.Converters
133
134 var result = RunConversion(targetFile);
135
136 - Assert.Equal(10, result.ExitCode);
136 + Assert.Equal(11, result.ExitCode);
137 Assert.Single(result.Messages.Where(message => message.ToString().EndsWith("(QtExecCmdTimeoutAmbiguous)")));
138
139 var expected = File.ReadAllText(Path.Combine(folder, afterFileName)).Replace("\r\n", "\n");
src/test/WixToolsetTest.Converters/CustomActionFixture.cs
+5 -5
@@ -25,10 +25,10 @@ namespace WixToolsetTest.Converters
25
26 var expected = String.Join(Environment.NewLine,
27 "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">",
28 - " <CustomAction Id=\"Foo\" BinaryKey=\"Wix4UtilCA_X86\" DllEntry=\"WixQuietExec\" />",
29 - " <CustomAction Id=\"Foo\" BinaryKey=\"Wix4UtilCA_X64\" DllEntry=\"WixQuietExec64\" />",
30 - " <CustomAction Id=\"Foo\" BinaryKey=\"Wix4UtilCA_X86\" DllEntry=\"WixQuietExec\" />",
31 - " <CustomAction Id=\"Foo\" BinaryKey=\"Wix4UtilCA_X64\" DllEntry=\"WixQuietExec64\" />",
28 + " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />",
29 + " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />",
30 + " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec\" BinaryRef=\"Wix4UtilCA_X86\" />",
31 + " <CustomAction Id=\"Foo\" DllEntry=\"WixQuietExec64\" BinaryRef=\"Wix4UtilCA_X64\" />",
32 "</Wix>");
33
34 var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo);
@@ -40,7 +40,7 @@ namespace WixToolsetTest.Converters
40
41 var actual = UnformattedDocumentString(document);
42
43 - Assert.Equal(7, errors);
43 + Assert.Equal(11, errors);
44 Assert.Equal(expected, actual);
45 }
46
src/test/WixToolsetTest.Converters/TestData/QtExec.bad/v4_expected.wxs
+1 -1
@@ -15,7 +15,7 @@
15
16 <Property Id="QtExecCmdTimeout" Value="600000" />
17 <CustomAction Id="InstallVSTemplateCommand" Property="WixQuietExecCmdLine" Value="&quot;[VSENVPRODUCT80]\devenv.exe&quot; /setup" />
18 - <CustomAction Id="InstallVSTemplate" BinaryKey="Wix4UtilCA_X86" DllEntry="WixQuietExec" Return="asyncWait" />
18 + <CustomAction Id="InstallVSTemplate" DllEntry="WixQuietExec" Return="asyncWait" BinaryRef="Wix4UtilCA_X86" />
19
20 <Feature Id="Feature_WiX" Title="WiX Toolset" Level="1">
21 <Component Id="Licensing" Directory="INSTALLFOLDER">
src/test/WixToolsetTest.Converters/TestData/QtExec/v4_expected.wxs
+1 -1
@@ -14,7 +14,7 @@
14 <MediaTemplate CabinetTemplate="core{0}.cab" />
15
16 <CustomAction Id="InstallVSTemplateCommand" Property="WixQuietExecCmdLine" Value="&quot;[VSENVPRODUCT80]\devenv.exe&quot; /setup" />
17 - <CustomAction Id="InstallVSTemplate" BinaryKey="Wix4UtilCA_X86" DllEntry="WixQuietExec" Return="asyncWait" />
17 + <CustomAction Id="InstallVSTemplate" DllEntry="WixQuietExec" Return="asyncWait" BinaryRef="Wix4UtilCA_X86" />
18
19 <Feature Id="Feature_WiX" Title="WiX Toolset" Level="1">
20 <Component Id="Licensing" Directory="INSTALLFOLDER">