diff options
| author | Bob Arnson <bob@firegiant.com> | 2020-08-25 14:58:01 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2020-08-25 15:01:08 -0400 |
| commit | c2d23a0d9c4d7b7205a288b1aa912b7f8d68702d (patch) | |
| tree | 6261ea801f5575b2f142595b8e5791c90c5ee381 /src | |
| parent | 732158ca8f82721c5e0ed772c4eb6bab39ac36ce (diff) | |
| download | wix-c2d23a0d9c4d7b7205a288b1aa912b7f8d68702d.tar.gz wix-c2d23a0d9c4d7b7205a288b1aa912b7f8d68702d.tar.bz2 wix-c2d23a0d9c4d7b7205a288b1aa912b7f8d68702d.zip | |
Fix custom table & custom action decompilation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Converters/WixConverter.cs | 9 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters/CustomActionFixture.cs | 2 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Converters/CustomTableFixture.cs | 22 |
3 files changed, 22 insertions, 11 deletions
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 | |||
| 47 | private static readonly XName ConditionElementName = WixNamespace + "Condition"; | 47 | private static readonly XName ConditionElementName = WixNamespace + "Condition"; |
| 48 | private static readonly XName CreateFolderElementName = WixNamespace + "CreateFolder"; | 48 | private static readonly XName CreateFolderElementName = WixNamespace + "CreateFolder"; |
| 49 | private static readonly XName CustomTableElementName = WixNamespace + "CustomTable"; | 49 | private static readonly XName CustomTableElementName = WixNamespace + "CustomTable"; |
| 50 | private static readonly XName DataElementName = WixNamespace + "Data"; | ||
| 50 | private static readonly XName DirectoryElementName = WixNamespace + "Directory"; | 51 | private static readonly XName DirectoryElementName = WixNamespace + "Directory"; |
| 51 | private static readonly XName ErrorElementName = WixNamespace + "Error"; | 52 | private static readonly XName ErrorElementName = WixNamespace + "Error"; |
| 52 | private static readonly XName FeatureElementName = WixNamespace + "Feature"; | 53 | private static readonly XName FeatureElementName = WixNamespace + "Feature"; |
| @@ -137,6 +138,7 @@ namespace WixToolset.Converters | |||
| 137 | { WixConverter.CustomTableElementName, this.ConvertCustomTableElement }, | 138 | { WixConverter.CustomTableElementName, this.ConvertCustomTableElement }, |
| 138 | { WixConverter.ControlElementName, this.ConvertControlElement }, | 139 | { WixConverter.ControlElementName, this.ConvertControlElement }, |
| 139 | { WixConverter.ComponentElementName, this.ConvertComponentElement }, | 140 | { WixConverter.ComponentElementName, this.ConvertComponentElement }, |
| 141 | { WixConverter.DataElementName, this.ConvertDataElement }, | ||
| 140 | { WixConverter.DirectoryElementName, this.ConvertDirectoryElement }, | 142 | { WixConverter.DirectoryElementName, this.ConvertDirectoryElement }, |
| 141 | { WixConverter.FeatureElementName, this.ConvertFeatureElement }, | 143 | { WixConverter.FeatureElementName, this.ConvertFeatureElement }, |
| 142 | { WixConverter.FileElementName, this.ConvertFileElement }, | 144 | { WixConverter.FileElementName, this.ConvertFileElement }, |
| @@ -155,7 +157,6 @@ namespace WixToolset.Converters | |||
| 155 | { WixConverter.PublishElementName, this.ConvertPublishElement }, | 157 | { WixConverter.PublishElementName, this.ConvertPublishElement }, |
| 156 | { WixConverter.MultiStringValueElementName, this.ConvertMultiStringValueElement }, | 158 | { WixConverter.MultiStringValueElementName, this.ConvertMultiStringValueElement }, |
| 157 | { WixConverter.RequiredPrivilegeElementName, this.ConvertRequiredPrivilegeElement }, | 159 | { WixConverter.RequiredPrivilegeElementName, this.ConvertRequiredPrivilegeElement }, |
| 158 | { WixConverter.RowElementName, this.ConvertRowElement }, | ||
| 159 | { WixConverter.CustomActionElementName, this.ConvertCustomActionElement }, | 160 | { WixConverter.CustomActionElementName, this.ConvertCustomActionElement }, |
| 160 | { WixConverter.ServiceArgumentElementName, this.ConvertServiceArgumentElement }, | 161 | { WixConverter.ServiceArgumentElementName, this.ConvertServiceArgumentElement }, |
| 161 | { WixConverter.SetDirectoryElementName, this.ConvertSetDirectoryElement }, | 162 | { WixConverter.SetDirectoryElementName, this.ConvertSetDirectoryElement }, |
| @@ -719,6 +720,8 @@ namespace WixToolset.Converters | |||
| 719 | 720 | ||
| 720 | private void ConvertRowElement(XElement element) => this.ConvertInnerTextToAttribute(element, "Value"); | 721 | private void ConvertRowElement(XElement element) => this.ConvertInnerTextToAttribute(element, "Value"); |
| 721 | 722 | ||
| 723 | private void ConvertDataElement(XElement element) => this.ConvertInnerTextToAttribute(element, "Value"); | ||
| 724 | |||
| 722 | private void ConvertSequenceElement(XElement element) | 725 | private void ConvertSequenceElement(XElement element) |
| 723 | { | 726 | { |
| 724 | foreach (var child in element.Elements()) | 727 | foreach (var child in element.Elements()) |
| @@ -801,7 +804,7 @@ namespace WixToolset.Converters | |||
| 801 | 804 | ||
| 802 | if (xScript != null && TryGetInnerText(xCustomAction, out var scriptText)) | 805 | if (xScript != null && TryGetInnerText(xCustomAction, out var scriptText)) |
| 803 | { | 806 | { |
| 804 | 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)) | 807 | 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)) |
| 805 | { | 808 | { |
| 806 | var scriptFolder = Path.GetDirectoryName(this.SourceFile) ?? String.Empty; | 809 | var scriptFolder = Path.GetDirectoryName(this.SourceFile) ?? String.Empty; |
| 807 | var id = xCustomAction.Attribute("Id")?.Value ?? Guid.NewGuid().ToString("N"); | 810 | var id = xCustomAction.Attribute("Id")?.Value ?? Guid.NewGuid().ToString("N"); |
| @@ -811,7 +814,7 @@ namespace WixToolset.Converters | |||
| 811 | File.WriteAllText(scriptFile, scriptText); | 814 | File.WriteAllText(scriptFile, scriptText); |
| 812 | 815 | ||
| 813 | RemoveChildren(xCustomAction); | 816 | RemoveChildren(xCustomAction); |
| 814 | xCustomAction.Add(new XAttribute("ScriptFile", scriptFile)); | 817 | xCustomAction.Add(new XAttribute("ScriptSourceFile", scriptFile)); |
| 815 | } | 818 | } |
| 816 | } | 819 | } |
| 817 | } | 820 | } |
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 | |||
| 60 | 60 | ||
| 61 | var expected = String.Join(Environment.NewLine, | 61 | var expected = String.Join(Environment.NewLine, |
| 62 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 62 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
| 63 | " <CustomAction Id=\"Foo\" Script=\"jscript\" ScriptFile=\"Foo.js\" />", | 63 | " <CustomAction Id=\"Foo\" Script=\"jscript\" ScriptSourceFile=\"Foo.js\" />", |
| 64 | "</Wix>"); | 64 | "</Wix>"); |
| 65 | 65 | ||
| 66 | var expectedScript = String.Join("\n", | 66 | 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 | |||
| 54 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | 54 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", |
| 55 | " <Fragment>", | 55 | " <Fragment>", |
| 56 | " <CustomTable Id='Custom1'>", | 56 | " <CustomTable Id='Custom1'>", |
| 57 | " <Row Id='Column1'>", | 57 | " <Row>", |
| 58 | " <Data Id='Column1'>", | ||
| 58 | " Some value", | 59 | " Some value", |
| 60 | " </Data>", | ||
| 59 | " </Row>", | 61 | " </Row>", |
| 60 | " </CustomTable>", | 62 | " </CustomTable>", |
| 61 | " </Fragment>", | 63 | " </Fragment>", |
| @@ -66,7 +68,9 @@ namespace WixToolsetTest.Converters | |||
| 66 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 68 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
| 67 | " <Fragment>", | 69 | " <Fragment>", |
| 68 | " <CustomTable Id=\"Custom1\">", | 70 | " <CustomTable Id=\"Custom1\">", |
| 69 | " <Row Id=\"Column1\" Value=\"Some value\" />", | 71 | " <Row>", |
| 72 | " <Data Id=\"Column1\" Value=\"Some value\" />", | ||
| 73 | " </Row>", | ||
| 70 | " </CustomTable>", | 74 | " </CustomTable>", |
| 71 | " </Fragment>", | 75 | " </Fragment>", |
| 72 | "</Wix>" | 76 | "</Wix>" |
| @@ -91,10 +95,12 @@ namespace WixToolsetTest.Converters | |||
| 91 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", | 95 | "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>", |
| 92 | " <Fragment>", | 96 | " <Fragment>", |
| 93 | " <CustomTable Id='Custom1'>", | 97 | " <CustomTable Id='Custom1'>", |
| 94 | " <Row Id='Column1'>", | 98 | " <Row>", |
| 95 | " <![CDATA[", | 99 | " <Data Id='Column1'>", |
| 96 | " Some value", | 100 | " <![CDATA[", |
| 97 | " ]]>", | 101 | " Some value", |
| 102 | " ]]>", | ||
| 103 | " </Data>", | ||
| 98 | " </Row>", | 104 | " </Row>", |
| 99 | " </CustomTable>", | 105 | " </CustomTable>", |
| 100 | " </Fragment>", | 106 | " </Fragment>", |
| @@ -105,7 +111,9 @@ namespace WixToolsetTest.Converters | |||
| 105 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | 111 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", |
| 106 | " <Fragment>", | 112 | " <Fragment>", |
| 107 | " <CustomTable Id=\"Custom1\">", | 113 | " <CustomTable Id=\"Custom1\">", |
| 108 | " <Row Id=\"Column1\" Value=\"Some value\" />", | 114 | " <Row>", |
| 115 | " <Data Id=\"Column1\" Value=\"Some value\" />", | ||
| 116 | " </Row>", | ||
| 109 | " </CustomTable>", | 117 | " </CustomTable>", |
| 110 | " </Fragment>", | 118 | " </Fragment>", |
| 111 | "</Wix>" | 119 | "</Wix>" |
