aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-11-07 15:47:12 +1000
committerSean Hall <r.sean.hall@gmail.com>2019-11-07 15:55:16 +1000
commit62c2eaf958c0b1a410fdf91dd0edcb542c60ef07 (patch)
tree418b5c01171fe3b6a1272ebf15f182f057c69b0c /src
parent38d85261d5a64f97d6260b5bf07d101711ca9ed9 (diff)
downloadwix-62c2eaf958c0b1a410fdf91dd0edcb542c60ef07.tar.gz
wix-62c2eaf958c0b1a410fdf91dd0edcb542c60ef07.tar.bz2
wix-62c2eaf958c0b1a410fdf91dd0edcb542c60ef07.zip
Add test for RemoveRegistryKey.
Diffstat (limited to 'src')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs32
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RemoveRegistryKey.wxs11
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj1
3 files changed, 44 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
index 2a36e11c..3c20e997 100644
--- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
@@ -714,6 +714,38 @@ namespace WixToolsetTest.CoreIntegration
714 } 714 }
715 715
716 [Fact] 716 [Fact]
717 public void PopulatesRegistryTableFromRemoveRegistryKey()
718 {
719 var folder = TestData.Get(@"TestData");
720
721 using (var fs = new DisposableFileSystem())
722 {
723 var baseFolder = fs.GetFolder();
724 var intermediateFolder = Path.Combine(baseFolder, "obj");
725 var msiPath = Path.Combine(baseFolder, @"bin\test.msi");
726
727 var result = WixRunner.Execute(new[]
728 {
729 "build",
730 Path.Combine(folder, "Registry", "RemoveRegistryKey.wxs"),
731 Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"),
732 "-bindpath", Path.Combine(folder, "SingleFile", "data"),
733 "-intermediateFolder", intermediateFolder,
734 "-o", msiPath
735 });
736
737 result.AssertSuccess();
738
739 Assert.True(File.Exists(msiPath));
740 var results = Query.QueryDatabase(msiPath, new[] { "Registry" });
741 Assert.Equal(new[]
742 {
743 "Registry:RemoveAKeyName\t2\tAKeyName\t-\t\tRemoveRegistryKeyComp",
744 }, results);
745 }
746 }
747
748 [Fact]
717 public void PopulatesReserveCostTable() 749 public void PopulatesReserveCostTable()
718 { 750 {
719 var folder = TestData.Get(@"TestData"); 751 var folder = TestData.Get(@"TestData");
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RemoveRegistryKey.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RemoveRegistryKey.wxs
new file mode 100644
index 00000000..a55a1e18
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RemoveRegistryKey.wxs
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <ComponentGroup Id="ProductComponents">
5 <Component Id="RemoveRegistryKeyComp" Directory="INSTALLFOLDER" Guid="5B3B3FC1-533D-4C29-BFB3-0E88B51E59D8">
6 <File Source="test.txt" />
7 <RemoveRegistryKey Id="RemoveAKeyName" Action="removeOnUninstall" Root="HKLM" Key="AKeyName" />
8 </Component>
9 </ComponentGroup>
10 </Fragment>
11</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index 4e0fb0db..b0e0d855 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -45,6 +45,7 @@
45 <Content Include="TestData\ProductWithComponentGroupRef\MinimalComponentGroup.wxs" CopyToOutputDirectory="PreserveNewest" /> 45 <Content Include="TestData\ProductWithComponentGroupRef\MinimalComponentGroup.wxs" CopyToOutputDirectory="PreserveNewest" />
46 <Content Include="TestData\ProductWithComponentGroupRef\Product.wxs" CopyToOutputDirectory="PreserveNewest" /> 46 <Content Include="TestData\ProductWithComponentGroupRef\Product.wxs" CopyToOutputDirectory="PreserveNewest" />
47 <Content Include="TestData\Registry\RegistryValue.wxs" CopyToOutputDirectory="PreserveNewest" /> 47 <Content Include="TestData\Registry\RegistryValue.wxs" CopyToOutputDirectory="PreserveNewest" />
48 <Content Include="TestData\Registry\RemoveRegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
48 <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" /> 49 <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" />
49 <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" /> 50 <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" />
50 <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" /> 51 <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" />