From c2d23a0d9c4d7b7205a288b1aa912b7f8d68702d Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 25 Aug 2020 14:58:01 -0400 Subject: Fix custom table & custom action decompilation. --- src/WixToolset.Converters/WixConverter.cs | 9 ++++++--- .../CustomActionFixture.cs | 2 +- .../CustomTableFixture.cs | 22 +++++++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Converters/WixConverter.cs b/src/WixToolset.Converters/WixConverter.cs index e4903bcb..f6918702 100644 --- a/src/WixToolset.Converters/WixConverter.cs +++ b/src/WixToolset.Converters/WixConverter.cs @@ -47,6 +47,7 @@ namespace WixToolset.Converters private static readonly XName ConditionElementName = WixNamespace + "Condition"; private static readonly XName CreateFolderElementName = WixNamespace + "CreateFolder"; private static readonly XName CustomTableElementName = WixNamespace + "CustomTable"; + private static readonly XName DataElementName = WixNamespace + "Data"; private static readonly XName DirectoryElementName = WixNamespace + "Directory"; private static readonly XName ErrorElementName = WixNamespace + "Error"; private static readonly XName FeatureElementName = WixNamespace + "Feature"; @@ -137,6 +138,7 @@ namespace WixToolset.Converters { WixConverter.CustomTableElementName, this.ConvertCustomTableElement }, { WixConverter.ControlElementName, this.ConvertControlElement }, { WixConverter.ComponentElementName, this.ConvertComponentElement }, + { WixConverter.DataElementName, this.ConvertDataElement }, { WixConverter.DirectoryElementName, this.ConvertDirectoryElement }, { WixConverter.FeatureElementName, this.ConvertFeatureElement }, { WixConverter.FileElementName, this.ConvertFileElement }, @@ -155,7 +157,6 @@ namespace WixToolset.Converters { WixConverter.PublishElementName, this.ConvertPublishElement }, { WixConverter.MultiStringValueElementName, this.ConvertMultiStringValueElement }, { WixConverter.RequiredPrivilegeElementName, this.ConvertRequiredPrivilegeElement }, - { WixConverter.RowElementName, this.ConvertRowElement }, { WixConverter.CustomActionElementName, this.ConvertCustomActionElement }, { WixConverter.ServiceArgumentElementName, this.ConvertServiceArgumentElement }, { WixConverter.SetDirectoryElementName, this.ConvertSetDirectoryElement }, @@ -719,6 +720,8 @@ namespace WixToolset.Converters private void ConvertRowElement(XElement element) => this.ConvertInnerTextToAttribute(element, "Value"); + private void ConvertDataElement(XElement element) => this.ConvertInnerTextToAttribute(element, "Value"); + private void ConvertSequenceElement(XElement element) { foreach (var child in element.Elements()) @@ -801,7 +804,7 @@ namespace WixToolset.Converters if (xScript != null && TryGetInnerText(xCustomAction, out var scriptText)) { - if (this.OnError(ConverterTestType.InnerTextDeprecated, xCustomAction, "Using {0} element text is deprecated. Extract the text to a file and use the 'ScriptFile' attribute to reference it.", xCustomAction.Name.LocalName)) + if (this.OnError(ConverterTestType.InnerTextDeprecated, xCustomAction, "Using {0} element text is deprecated. Extract the text to a file and use the 'ScriptSourceFile' attribute to reference it.", xCustomAction.Name.LocalName)) { var scriptFolder = Path.GetDirectoryName(this.SourceFile) ?? String.Empty; var id = xCustomAction.Attribute("Id")?.Value ?? Guid.NewGuid().ToString("N"); @@ -811,7 +814,7 @@ namespace WixToolset.Converters File.WriteAllText(scriptFile, scriptText); RemoveChildren(xCustomAction); - xCustomAction.Add(new XAttribute("ScriptFile", scriptFile)); + xCustomAction.Add(new XAttribute("ScriptSourceFile", scriptFile)); } } } diff --git a/src/test/WixToolsetTest.Converters/CustomActionFixture.cs b/src/test/WixToolsetTest.Converters/CustomActionFixture.cs index e19de6e3..4ad7dcfd 100644 --- a/src/test/WixToolsetTest.Converters/CustomActionFixture.cs +++ b/src/test/WixToolsetTest.Converters/CustomActionFixture.cs @@ -60,7 +60,7 @@ namespace WixToolsetTest.Converters var expected = String.Join(Environment.NewLine, "", - " ", + " ", ""); var expectedScript = String.Join("\n", diff --git a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs index 10ee2748..4470a2ff 100644 --- a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs +++ b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs @@ -54,8 +54,10 @@ namespace WixToolsetTest.Converters "", " ", " ", - " ", + " ", + " ", " Some value", + " ", " ", " ", " ", @@ -66,7 +68,9 @@ namespace WixToolsetTest.Converters "", " ", " ", - " ", + " ", + " ", + " ", " ", " ", "" @@ -91,10 +95,12 @@ namespace WixToolsetTest.Converters "", " ", " ", - " ", - " ", + " ", + " ", + " ", + " ", " ", " ", " ", @@ -105,7 +111,9 @@ namespace WixToolsetTest.Converters "", " ", " ", - " ", + " ", + " ", + " ", " ", " ", "" -- cgit v1.2.3-55-g6feb