diff options
| author | Rob Mensching <rob@firegiant.com> | 2022-12-06 15:55:18 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2022-12-06 17:29:07 -0800 |
| commit | fb0a8b74b598331dcf037d97a3adf89f5fe5ba92 (patch) | |
| tree | e66f9b50a04a2589602c89cab8449e2bb9a8e88d /src | |
| parent | aa591db212c3df5a5c9f501c01fb1fbf2deadb7c (diff) | |
| download | wix-fb0a8b74b598331dcf037d97a3adf89f5fe5ba92.tar.gz wix-fb0a8b74b598331dcf037d97a3adf89f5fe5ba92.tar.bz2 wix-fb0a8b74b598331dcf037d97a3adf89f5fe5ba92.zip | |
Correctly harvest registry files with multisz
Fixes 7044
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/heat/RegFileHarvester.cs | 2 | ||||
| -rw-r--r-- | src/tools/heat/RegistryHarvester.cs | 4 | ||||
| -rw-r--r-- | src/tools/heat/Serialize/wix.cs | 24 | ||||
| -rw-r--r-- | src/tools/heat/UtilFinalizeHarvesterMutator.cs | 4 | ||||
| -rw-r--r-- | src/tools/heat/UtilMutator.cs | 2 | ||||
| -rw-r--r-- | src/tools/test/WixToolsetTest.Heat/HeatFixture.cs | 111 | ||||
| -rw-r--r-- | src/tools/test/WixToolsetTest.Heat/TestData/RegFile/Expected.wxs | 51 | ||||
| -rw-r--r-- | src/tools/test/WixToolsetTest.Heat/TestData/RegFile/ExpectedWithComponentGroup.wxs | 54 | ||||
| -rw-r--r-- | src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.reg | 41 | ||||
| -rw-r--r-- | src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.xslt | 23 |
10 files changed, 286 insertions, 30 deletions
diff --git a/src/tools/heat/RegFileHarvester.cs b/src/tools/heat/RegFileHarvester.cs index fcb4a9c2..49cf4c01 100644 --- a/src/tools/heat/RegFileHarvester.cs +++ b/src/tools/heat/RegFileHarvester.cs | |||
| @@ -200,7 +200,7 @@ namespace WixToolset.Harvesters | |||
| 200 | foreach (string part in parts) | 200 | foreach (string part in parts) |
| 201 | { | 201 | { |
| 202 | Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); | 202 | Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); |
| 203 | multiStringValue.Content = part; | 203 | multiStringValue.Value = part; |
| 204 | registryValue.AddChild(multiStringValue); | 204 | registryValue.AddChild(multiStringValue); |
| 205 | } | 205 | } |
| 206 | 206 | ||
diff --git a/src/tools/heat/RegistryHarvester.cs b/src/tools/heat/RegistryHarvester.cs index 0dfd3a29..71dd3962 100644 --- a/src/tools/heat/RegistryHarvester.cs +++ b/src/tools/heat/RegistryHarvester.cs | |||
| @@ -295,7 +295,7 @@ namespace WixToolset.Harvesters | |||
| 295 | { | 295 | { |
| 296 | Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); | 296 | Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); |
| 297 | 297 | ||
| 298 | multiStringValue.Content = String.Empty; | 298 | multiStringValue.Value = String.Empty; |
| 299 | 299 | ||
| 300 | registryValue.AddChild(multiStringValue); | 300 | registryValue.AddChild(multiStringValue); |
| 301 | } | 301 | } |
| @@ -305,7 +305,7 @@ namespace WixToolset.Harvesters | |||
| 305 | { | 305 | { |
| 306 | Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); | 306 | Wix.MultiStringValue multiStringValue = new Wix.MultiStringValue(); |
| 307 | 307 | ||
| 308 | multiStringValue.Content = multiStringValueContent; | 308 | multiStringValue.Value = multiStringValueContent; |
| 309 | 309 | ||
| 310 | registryValue.AddChild(multiStringValue); | 310 | registryValue.AddChild(multiStringValue); |
| 311 | } | 311 | } |
diff --git a/src/tools/heat/Serialize/wix.cs b/src/tools/heat/Serialize/wix.cs index a3d9b33b..cb62079d 100644 --- a/src/tools/heat/Serialize/wix.cs +++ b/src/tools/heat/Serialize/wix.cs | |||
| @@ -27422,9 +27422,9 @@ namespace WixToolset.Harvesters.Serialize | |||
| 27422 | 27422 | ||
| 27423 | private ISchemaElement parentElement; | 27423 | private ISchemaElement parentElement; |
| 27424 | 27424 | ||
| 27425 | private string contentField; | 27425 | private string valueField; |
| 27426 | 27426 | ||
| 27427 | private bool contentFieldSet; | 27427 | private bool valueFieldSet; |
| 27428 | 27428 | ||
| 27429 | public virtual ISchemaElement ParentElement | 27429 | public virtual ISchemaElement ParentElement |
| 27430 | { | 27430 | { |
| @@ -27441,18 +27441,18 @@ namespace WixToolset.Harvesters.Serialize | |||
| 27441 | /// <summary> | 27441 | /// <summary> |
| 27442 | /// Use several of these elements to specify each registry value in a multiString registry value. This element | 27442 | /// Use several of these elements to specify each registry value in a multiString registry value. This element |
| 27443 | /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The | 27443 | /// cannot be used if the Value attribute is specified unless the Type attribute is set to 'multiString'. The |
| 27444 | /// values should go in the text area of the MultiStringValue element. | 27444 | /// values should go in the Value attribute of the MultiStringValue element. |
| 27445 | /// </summary> | 27445 | /// </summary> |
| 27446 | public string Content | 27446 | public string Value |
| 27447 | { | 27447 | { |
| 27448 | get | 27448 | get |
| 27449 | { | 27449 | { |
| 27450 | return this.contentField; | 27450 | return this.valueField; |
| 27451 | } | 27451 | } |
| 27452 | set | 27452 | set |
| 27453 | { | 27453 | { |
| 27454 | this.contentFieldSet = true; | 27454 | this.valueFieldSet = true; |
| 27455 | this.contentField = value; | 27455 | this.valueField = value; |
| 27456 | } | 27456 | } |
| 27457 | } | 27457 | } |
| 27458 | 27458 | ||
| @@ -27463,10 +27463,10 @@ namespace WixToolset.Harvesters.Serialize | |||
| 27463 | { | 27463 | { |
| 27464 | throw new ArgumentNullException("name"); | 27464 | throw new ArgumentNullException("name"); |
| 27465 | } | 27465 | } |
| 27466 | if (("Content" == name)) | 27466 | if (("Value" == name)) |
| 27467 | { | 27467 | { |
| 27468 | this.contentField = value; | 27468 | this.valueField = value; |
| 27469 | this.contentFieldSet = true; | 27469 | this.valueFieldSet = true; |
| 27470 | } | 27470 | } |
| 27471 | } | 27471 | } |
| 27472 | 27472 | ||
| @@ -27480,9 +27480,9 @@ namespace WixToolset.Harvesters.Serialize | |||
| 27480 | throw new ArgumentNullException("writer"); | 27480 | throw new ArgumentNullException("writer"); |
| 27481 | } | 27481 | } |
| 27482 | writer.WriteStartElement("MultiStringValue", "http://wixtoolset.org/schemas/v4/wxs"); | 27482 | writer.WriteStartElement("MultiStringValue", "http://wixtoolset.org/schemas/v4/wxs"); |
| 27483 | if (this.contentFieldSet) | 27483 | if (this.valueFieldSet) |
| 27484 | { | 27484 | { |
| 27485 | writer.WriteString(this.contentField); | 27485 | writer.WriteAttributeString("Value", this.valueField); |
| 27486 | } | 27486 | } |
| 27487 | writer.WriteEndElement(); | 27487 | writer.WriteEndElement(); |
| 27488 | } | 27488 | } |
diff --git a/src/tools/heat/UtilFinalizeHarvesterMutator.cs b/src/tools/heat/UtilFinalizeHarvesterMutator.cs index 5af56e89..61bb8731 100644 --- a/src/tools/heat/UtilFinalizeHarvesterMutator.cs +++ b/src/tools/heat/UtilFinalizeHarvesterMutator.cs | |||
| @@ -1076,9 +1076,9 @@ namespace WixToolset.Harvesters | |||
| 1076 | foreach (Wix.MultiStringValue multiStringValue in registryValue.Children) | 1076 | foreach (Wix.MultiStringValue multiStringValue in registryValue.Children) |
| 1077 | { | 1077 | { |
| 1078 | // first replace file paths with their MSI tokens | 1078 | // first replace file paths with their MSI tokens |
| 1079 | multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)this.filePaths); | 1079 | multiStringValue.Value = this.MutateRegistryString(multiStringValue.Value, (ICollection)this.filePaths); |
| 1080 | // next replace directory paths with their MSI tokens | 1080 | // next replace directory paths with their MSI tokens |
| 1081 | multiStringValue.Content = this.MutateRegistryString(multiStringValue.Content, (ICollection)reversedDirectoryPaths); | 1081 | multiStringValue.Value = this.MutateRegistryString(multiStringValue.Value, (ICollection)reversedDirectoryPaths); |
| 1082 | } | 1082 | } |
| 1083 | } | 1083 | } |
| 1084 | else | 1084 | else |
diff --git a/src/tools/heat/UtilMutator.cs b/src/tools/heat/UtilMutator.cs index 287f5f5e..80fd470c 100644 --- a/src/tools/heat/UtilMutator.cs +++ b/src/tools/heat/UtilMutator.cs | |||
| @@ -246,7 +246,7 @@ namespace WixToolset.Harvesters | |||
| 246 | c.Directory = parentDirectory.Id; | 246 | c.Directory = parentDirectory.Id; |
| 247 | parentDirectory.RemoveChild(c); | 247 | parentDirectory.RemoveChild(c); |
| 248 | } | 248 | } |
| 249 | else if (c.ParentElement is Wix.DirectoryRef) | 249 | else if (c.ParentElement is Wix.DirectoryRef || c.ParentElement is Wix.StandardDirectory) |
| 250 | { | 250 | { |
| 251 | var parentDirectory = c.ParentElement as Wix.DirectoryBase; | 251 | var parentDirectory = c.ParentElement as Wix.DirectoryBase; |
| 252 | 252 | ||
diff --git a/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs b/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs index 388d4dc0..d517e209 100644 --- a/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs +++ b/src/tools/test/WixToolsetTest.Heat/HeatFixture.cs | |||
| @@ -30,7 +30,6 @@ namespace WixToolsetTest.Heat | |||
| 30 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | 30 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); |
| 31 | WixAssert.CompareLineByLine(new[] | 31 | WixAssert.CompareLineByLine(new[] |
| 32 | { | 32 | { |
| 33 | "<?xml version='1.0' encoding='utf-8'?>", | ||
| 34 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | 33 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", |
| 35 | " <Fragment>", | 34 | " <Fragment>", |
| 36 | " <StandardDirectory Id='TARGETDIR'>", | 35 | " <StandardDirectory Id='TARGETDIR'>", |
| @@ -50,7 +49,7 @@ namespace WixToolsetTest.Heat | |||
| 50 | } | 49 | } |
| 51 | 50 | ||
| 52 | [Fact] | 51 | [Fact] |
| 53 | public void CanHarvestSimpleDirectoryToInstallFolder() | 52 | public void CanHarvestSimpleDirectoryToComponentGroup() |
| 54 | { | 53 | { |
| 55 | var folder = TestData.Get("TestData", "SingleFile"); | 54 | var folder = TestData.Get("TestData", "SingleFile"); |
| 56 | 55 | ||
| @@ -61,7 +60,7 @@ namespace WixToolsetTest.Heat | |||
| 61 | var args = new[] | 60 | var args = new[] |
| 62 | { | 61 | { |
| 63 | "dir", folder, | 62 | "dir", folder, |
| 64 | "-dr", "INSTALLFOLDER", | 63 | "-cg", "CG1", |
| 65 | "-o", outputPath | 64 | "-o", outputPath |
| 66 | }; | 65 | }; |
| 67 | 66 | ||
| @@ -71,19 +70,18 @@ namespace WixToolsetTest.Heat | |||
| 71 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | 70 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); |
| 72 | WixAssert.CompareLineByLine(new[] | 71 | WixAssert.CompareLineByLine(new[] |
| 73 | { | 72 | { |
| 74 | "<?xml version='1.0' encoding='utf-8'?>", | ||
| 75 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | 73 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", |
| 76 | " <Fragment>", | 74 | " <Fragment>", |
| 77 | " <DirectoryRef Id='INSTALLFOLDER'>", | 75 | " <StandardDirectory Id='TARGETDIR'>", |
| 78 | " <Directory Id='dirlooNEIrtEBL2w_RhFEIgiKcUlxE' Name='SingleFile' />", | 76 | " <Directory Id='dirwsJn0Cqs9KdlDSFdQsu9ygYvMF8' Name='SingleFile' />", |
| 79 | " </DirectoryRef>", | 77 | " </StandardDirectory>", |
| 80 | " </Fragment>", | 78 | " </Fragment>", |
| 81 | " <Fragment>", | 79 | " <Fragment>", |
| 82 | " <DirectoryRef Id='dirlooNEIrtEBL2w_RhFEIgiKcUlxE'>", | 80 | " <ComponentGroup Id='CG1'>", |
| 83 | " <Component Id='cmpxHVF6oXohc0EWgRphmYZvw5.GGU' Guid='PUT-GUID-HERE'>", | 81 | " <Component Id='cmp0i3dThrp4nheCteEmXvHxBDa_VE' Directory='dirwsJn0Cqs9KdlDSFdQsu9ygYvMF8' Guid='PUT-GUID-HERE'>", |
| 84 | " <File Id='filk_7KUAfL4VfzxSRsGFf_XOBHln0' KeyPath='yes' Source='SourceDir\\a.txt' />", | 82 | " <File Id='filziMcXYgrmcbVF8PuTUfIB9Vgqo0' KeyPath='yes' Source='SourceDir\\a.txt' />", |
| 85 | " </Component>", | 83 | " </Component>", |
| 86 | " </DirectoryRef>", | 84 | " </ComponentGroup>", |
| 87 | " </Fragment>", | 85 | " </Fragment>", |
| 88 | "</Wix>", | 86 | "</Wix>", |
| 89 | }, wxs); | 87 | }, wxs); |
| @@ -91,6 +89,47 @@ namespace WixToolsetTest.Heat | |||
| 91 | } | 89 | } |
| 92 | 90 | ||
| 93 | [Fact] | 91 | [Fact] |
| 92 | public void CanHarvestSimpleDirectoryToInstallFolder() | ||
| 93 | { | ||
| 94 | var folder = TestData.Get("TestData", "SingleFile"); | ||
| 95 | |||
| 96 | using (var fs = new DisposableFileSystem()) | ||
| 97 | { | ||
| 98 | var outputPath = Path.Combine(fs.GetFolder(), "out.wxs"); | ||
| 99 | |||
| 100 | var args = new[] | ||
| 101 | { | ||
| 102 | "dir", folder, | ||
| 103 | "-dr", "INSTALLFOLDER", | ||
| 104 | "-indent", "2", | ||
| 105 | "-o", outputPath | ||
| 106 | }; | ||
| 107 | |||
| 108 | var result = HeatRunner.Execute(args); | ||
| 109 | result.AssertSuccess(); | ||
| 110 | |||
| 111 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | ||
| 112 | WixAssert.CompareLineByLine(new[] | ||
| 113 | { | ||
| 114 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | ||
| 115 | " <Fragment>", | ||
| 116 | " <DirectoryRef Id='INSTALLFOLDER'>", | ||
| 117 | " <Directory Id='dirlooNEIrtEBL2w_RhFEIgiKcUlxE' Name='SingleFile' />", | ||
| 118 | " </DirectoryRef>", | ||
| 119 | " </Fragment>", | ||
| 120 | " <Fragment>", | ||
| 121 | " <DirectoryRef Id='dirlooNEIrtEBL2w_RhFEIgiKcUlxE'>", | ||
| 122 | " <Component Id='cmpxHVF6oXohc0EWgRphmYZvw5.GGU' Guid='PUT-GUID-HERE'>", | ||
| 123 | " <File Id='filk_7KUAfL4VfzxSRsGFf_XOBHln0' KeyPath='yes' Source='SourceDir\\a.txt' />", | ||
| 124 | " </Component>", | ||
| 125 | " </DirectoryRef>", | ||
| 126 | " </Fragment>", | ||
| 127 | "</Wix>", | ||
| 128 | }, wxs); | ||
| 129 | } | ||
| 130 | } | ||
| 131 | |||
| 132 | [Fact] | ||
| 94 | public void CanHarvestFile() | 133 | public void CanHarvestFile() |
| 95 | { | 134 | { |
| 96 | var folder = TestData.Get("TestData", "SingleFile"); | 135 | var folder = TestData.Get("TestData", "SingleFile"); |
| @@ -114,7 +153,6 @@ namespace WixToolsetTest.Heat | |||
| 114 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | 153 | var wxs = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); |
| 115 | WixAssert.CompareLineByLine(new[] | 154 | WixAssert.CompareLineByLine(new[] |
| 116 | { | 155 | { |
| 117 | "<?xml version='1.0' encoding='utf-8'?>", | ||
| 118 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", | 156 | "<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>", |
| 119 | " <Fragment>", | 157 | " <Fragment>", |
| 120 | " <StandardDirectory Id='ProgramFiles6432Folder'>", | 158 | " <StandardDirectory Id='ProgramFiles6432Folder'>", |
| @@ -132,5 +170,54 @@ namespace WixToolsetTest.Heat | |||
| 132 | }, wxs); | 170 | }, wxs); |
| 133 | } | 171 | } |
| 134 | } | 172 | } |
| 173 | |||
| 174 | [Fact] | ||
| 175 | public void CanHarvestRegistry() | ||
| 176 | { | ||
| 177 | var folder = TestData.Get("TestData", "RegFile"); | ||
| 178 | |||
| 179 | using (var fs = new DisposableFileSystem()) | ||
| 180 | { | ||
| 181 | var outputPath = Path.Combine(fs.GetFolder(), "out.wxs"); | ||
| 182 | |||
| 183 | var args = new[] | ||
| 184 | { | ||
| 185 | "reg", Path.Combine(folder, "input.reg"), | ||
| 186 | "-o", outputPath | ||
| 187 | }; | ||
| 188 | |||
| 189 | var result = HeatRunner.Execute(args); | ||
| 190 | result.AssertSuccess(); | ||
| 191 | |||
| 192 | var actual = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | ||
| 193 | var expected = File.ReadAllLines(Path.Combine(folder, "Expected.wxs")).Select(s => s.Replace("\"", "'")).ToArray(); | ||
| 194 | WixAssert.CompareLineByLine(expected, actual); | ||
| 195 | } | ||
| 196 | } | ||
| 197 | |||
| 198 | [Fact] | ||
| 199 | public void CanHarvestRegistryIntoComponentGroup() | ||
| 200 | { | ||
| 201 | var folder = TestData.Get("TestData", "RegFile"); | ||
| 202 | |||
| 203 | using (var fs = new DisposableFileSystem()) | ||
| 204 | { | ||
| 205 | var outputPath = Path.Combine(fs.GetFolder(), "out.wxs"); | ||
| 206 | |||
| 207 | var args = new[] | ||
| 208 | { | ||
| 209 | "reg", Path.Combine(folder, "input.reg"), | ||
| 210 | "-cg", "CG1", | ||
| 211 | "-o", outputPath | ||
| 212 | }; | ||
| 213 | |||
| 214 | var result = HeatRunner.Execute(args); | ||
| 215 | result.AssertSuccess(); | ||
| 216 | |||
| 217 | var actual = File.ReadAllLines(outputPath).Select(s => s.Replace("\"", "'")).ToArray(); | ||
| 218 | var expected = File.ReadAllLines(Path.Combine(folder, "ExpectedWithComponentGroup.wxs")).Select(s => s.Replace("\"", "'")).ToArray(); | ||
| 219 | WixAssert.CompareLineByLine(expected, actual); | ||
| 220 | } | ||
| 221 | } | ||
| 135 | } | 222 | } |
| 136 | } | 223 | } |
diff --git a/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/Expected.wxs b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/Expected.wxs new file mode 100644 index 00000000..2bc48bca --- /dev/null +++ b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/Expected.wxs | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Fragment> | ||
| 3 | <StandardDirectory Id="TARGETDIR"> | ||
| 4 | <Component Id="cmpojwP28s4WmDsBqWw98dt3GqX0Qc" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 5 | <RegistryKey ForceCreateOnInstall="yes" Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web" Root="HKLM" /> | ||
| 6 | </Component> | ||
| 7 | <Component Id="cmplcKhDXbrKnnKie3DODK0NdtNNOg" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 8 | <RegistryKey ForceCreateOnInstall="yes" Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters" Root="HKLM" /> | ||
| 9 | </Component> | ||
| 10 | <Component Id="cmpQwsceagjGFkCYf0mDbar_x8di7o" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 11 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Java" Root="HKLM"> | ||
| 12 | <RegistryValue Name="Options" Type="multiString"> | ||
| 13 | <MultiStringValue Value="-Ddaemon.clojure.ns=panther.was.web.daemon" /> | ||
| 14 | </RegistryValue> | ||
| 15 | <RegistryValue Name="Options9" Type="multiString"> | ||
| 16 | <MultiStringValue Value="--add-modules=java.corba" /> | ||
| 17 | </RegistryValue> | ||
| 18 | <RegistryValue Name="Classpath" Value="%WAS_DEPS_CLASSPATH%\*;%ServiceBasePath%\Sensors\service.jvm.web-standalone.jar" Type="string" /> | ||
| 19 | <RegistryValue Name="JvmMx" Value="4096" Type="integer" /> | ||
| 20 | </RegistryKey> | ||
| 21 | </Component> | ||
| 22 | <Component Id="cmpmdi0PQPGI0rXbHgRjCLk1kVRjDY" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 23 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Log" Root="HKLM"> | ||
| 24 | <RegistryValue Name="Prefix" Value="service.jvm.web" Type="string" /> | ||
| 25 | </RegistryKey> | ||
| 26 | </Component> | ||
| 27 | <Component Id="cmpZMMSl80BpzgFJnOoQHZhE6TKx5c" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 28 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Start" Root="HKLM"> | ||
| 29 | <RegistryValue Name="Class" Value="service.was.webDaemon" Type="string" /> | ||
| 30 | <RegistryValue Name="Params" Type="multiString"> | ||
| 31 | <MultiStringValue Value="--store-path" /> | ||
| 32 | <MultiStringValue Value=""%ProgramData%\softek\panther\panther.was.web\store.jks"" /> | ||
| 33 | </RegistryValue> | ||
| 34 | <RegistryValue Name="Method" Value="startWindows" Type="string" /> | ||
| 35 | <RegistryValue Name="Mode" Value="jvm" Type="string" /> | ||
| 36 | </RegistryKey> | ||
| 37 | </Component> | ||
| 38 | <Component Id="cmphc0PosUreNHPfVVRiTRupYb3SzQ" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 39 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Stop" Root="HKLM"> | ||
| 40 | <RegistryValue Name="Class" Value="service.was.webDaemon" Type="string" /> | ||
| 41 | <RegistryValue Name="Method" Value="stopWindows" Type="string" /> | ||
| 42 | <RegistryValue Name="Mode" Value="jvm" Type="string" /> | ||
| 43 | <RegistryValue Name="Timeout" Value="2500" Type="integer" /> | ||
| 44 | </RegistryKey> | ||
| 45 | </Component> | ||
| 46 | <Component Id="cmpvXIwMqQZoA011CevdgYD.oX.O1Y" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 47 | <RegistryKey ForceCreateOnInstall="yes" Key="SYSTEM\CurrentControlSet\Services\service.jvm.web\Parameters" Root="HKLM" /> | ||
| 48 | </Component> | ||
| 49 | </StandardDirectory> | ||
| 50 | </Fragment> | ||
| 51 | </Wix> | ||
diff --git a/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/ExpectedWithComponentGroup.wxs b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/ExpectedWithComponentGroup.wxs new file mode 100644 index 00000000..bb94a265 --- /dev/null +++ b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/ExpectedWithComponentGroup.wxs | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Fragment> | ||
| 3 | <StandardDirectory Id='TARGETDIR' /> | ||
| 4 | </Fragment> | ||
| 5 | <Fragment> | ||
| 6 | <ComponentGroup Id="CG1"> | ||
| 7 | <Component Id="cmpojwP28s4WmDsBqWw98dt3GqX0Qc" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 8 | <RegistryKey ForceCreateOnInstall="yes" Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web" Root="HKLM" /> | ||
| 9 | </Component> | ||
| 10 | <Component Id="cmplcKhDXbrKnnKie3DODK0NdtNNOg" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 11 | <RegistryKey ForceCreateOnInstall="yes" Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters" Root="HKLM" /> | ||
| 12 | </Component> | ||
| 13 | <Component Id="cmpQwsceagjGFkCYf0mDbar_x8di7o" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 14 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Java" Root="HKLM"> | ||
| 15 | <RegistryValue Name="Options" Type="multiString"> | ||
| 16 | <MultiStringValue Value="-Ddaemon.clojure.ns=panther.was.web.daemon" /> | ||
| 17 | </RegistryValue> | ||
| 18 | <RegistryValue Name="Options9" Type="multiString"> | ||
| 19 | <MultiStringValue Value="--add-modules=java.corba" /> | ||
| 20 | </RegistryValue> | ||
| 21 | <RegistryValue Name="Classpath" Value="%WAS_DEPS_CLASSPATH%\*;%ServiceBasePath%\Sensors\service.jvm.web-standalone.jar" Type="string" /> | ||
| 22 | <RegistryValue Name="JvmMx" Value="4096" Type="integer" /> | ||
| 23 | </RegistryKey> | ||
| 24 | </Component> | ||
| 25 | <Component Id="cmpmdi0PQPGI0rXbHgRjCLk1kVRjDY" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 26 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Log" Root="HKLM"> | ||
| 27 | <RegistryValue Name="Prefix" Value="service.jvm.web" Type="string" /> | ||
| 28 | </RegistryKey> | ||
| 29 | </Component> | ||
| 30 | <Component Id="cmpZMMSl80BpzgFJnOoQHZhE6TKx5c" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 31 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Start" Root="HKLM"> | ||
| 32 | <RegistryValue Name="Class" Value="service.was.webDaemon" Type="string" /> | ||
| 33 | <RegistryValue Name="Params" Type="multiString"> | ||
| 34 | <MultiStringValue Value="--store-path" /> | ||
| 35 | <MultiStringValue Value=""%ProgramData%\softek\panther\panther.was.web\store.jks"" /> | ||
| 36 | </RegistryValue> | ||
| 37 | <RegistryValue Name="Method" Value="startWindows" Type="string" /> | ||
| 38 | <RegistryValue Name="Mode" Value="jvm" Type="string" /> | ||
| 39 | </RegistryKey> | ||
| 40 | </Component> | ||
| 41 | <Component Id="cmphc0PosUreNHPfVVRiTRupYb3SzQ" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 42 | <RegistryKey Key="SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Stop" Root="HKLM"> | ||
| 43 | <RegistryValue Name="Class" Value="service.was.webDaemon" Type="string" /> | ||
| 44 | <RegistryValue Name="Method" Value="stopWindows" Type="string" /> | ||
| 45 | <RegistryValue Name="Mode" Value="jvm" Type="string" /> | ||
| 46 | <RegistryValue Name="Timeout" Value="2500" Type="integer" /> | ||
| 47 | </RegistryKey> | ||
| 48 | </Component> | ||
| 49 | <Component Id="cmpvXIwMqQZoA011CevdgYD.oX.O1Y" Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes"> | ||
| 50 | <RegistryKey ForceCreateOnInstall="yes" Key="SYSTEM\CurrentControlSet\Services\service.jvm.web\Parameters" Root="HKLM" /> | ||
| 51 | </Component> | ||
| 52 | </ComponentGroup> | ||
| 53 | </Fragment> | ||
| 54 | </Wix> | ||
diff --git a/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.reg b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.reg new file mode 100644 index 00000000..85ebe01e --- /dev/null +++ b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.reg | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | Windows Registry Editor Version 5.00 | ||
| 2 | |||
| 3 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web] | ||
| 4 | |||
| 5 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters] | ||
| 6 | |||
| 7 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Java] | ||
| 8 | "Options"=hex(7):2d,00,44,00,64,00,61,00,65,00,6d,00,6f,00,6e,00,2e,00,63,00,\ | ||
| 9 | 6c,00,6f,00,6a,00,75,00,72,00,65,00,2e,00,6e,00,73,00,3d,00,70,00,61,00,6e,\ | ||
| 10 | 00,74,00,68,00,65,00,72,00,2e,00,77,00,61,00,73,00,2e,00,77,00,65,00,62,00,\ | ||
| 11 | 2e,00,64,00,61,00,65,00,6d,00,6f,00,6e,00,00,00,00,00 | ||
| 12 | "Options9"=hex(7):2d,00,2d,00,61,00,64,00,64,00,2d,00,6d,00,6f,00,64,00,75,00,\ | ||
| 13 | 6c,00,65,00,73,00,3d,00,6a,00,61,00,76,00,61,00,2e,00,63,00,6f,00,72,00,62,\ | ||
| 14 | 00,61,00,00,00,00,00 | ||
| 15 | "Classpath"="%WAS_DEPS_CLASSPATH%\*;%ServiceBasePath%\Sensors\service.jvm.web-standalone.jar" | ||
| 16 | "JvmMx"=dword:00001000 | ||
| 17 | |||
| 18 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Log] | ||
| 19 | "Prefix"="service.jvm.web" | ||
| 20 | |||
| 21 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Start] | ||
| 22 | "Class"="service.was.webDaemon" | ||
| 23 | "Params"=hex(7):2d,00,2d,00,73,00,74,00,6f,00,72,00,65,00,2d,00,70,00,61,00,74,\ | ||
| 24 | 00,68,00,00,00,22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,44,00,\ | ||
| 25 | 61,00,74,00,61,00,25,00,5c,00,73,00,6f,00,66,00,74,00,65,00,6b,00,5c,00,70,\ | ||
| 26 | 00,61,00,6e,00,74,00,68,00,65,00,72,00,5c,00,70,00,61,00,6e,00,74,00,68,00,\ | ||
| 27 | 65,00,72,00,2e,00,77,00,61,00,73,00,2e,00,77,00,65,00,62,00,5c,00,73,00,74,\ | ||
| 28 | 00,6f,00,72,00,65,00,2e,00,6a,00,6b,00,73,00,22,00,00,00,00,00 | ||
| 29 | "Method"="startWindows" | ||
| 30 | "Mode"="jvm" | ||
| 31 | |||
| 32 | [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\service.jvm.web\Parameters\Stop] | ||
| 33 | "Class"="service.was.webDaemon" | ||
| 34 | "Method"="stopWindows" | ||
| 35 | "Mode"="jvm" | ||
| 36 | "Timeout"=dword:000009c4 | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\service.jvm.web\Parameters] | ||
| 41 | |||
diff --git a/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.xslt b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.xslt new file mode 100644 index 00000000..7a46243a --- /dev/null +++ b/src/tools/test/WixToolsetTest.Heat/TestData/RegFile/input.xslt | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <xsl:stylesheet | ||
| 3 | version="1.0" | ||
| 4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| 5 | xmlns="http://www.w3.org/1999/xhtml" | ||
| 6 | xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 7 | |||
| 8 | <xsl:output method="xml" indent="yes"/> | ||
| 9 | |||
| 10 | <xsl:template match="@*|node()"> | ||
| 11 | <xsl:copy> | ||
| 12 | <xsl:apply-templates select="@*|node()"/> | ||
| 13 | </xsl:copy> | ||
| 14 | </xsl:template> | ||
| 15 | |||
| 16 | <xsl:template match="wix:Wix/wix:Fragment/wix:StandardDirectory/wix:Component/wix:RegistryKey/wix:RegistryValue[@Name='Classpath']"> | ||
| 17 | <xsl:copy> | ||
| 18 | <xsl:apply-templates select="@*|node()"/> | ||
| 19 | <xsl:attribute name="Value"><xsl:text>%WAS_DEPS_CLASSPATH%\*;[DIR_JVM]service.jvm.web-standalone.jar</xsl:text></xsl:attribute> | ||
| 20 | </xsl:copy> | ||
| 21 | </xsl:template> | ||
| 22 | |||
| 23 | </xsl:stylesheet> | ||
