@joebigelow / wix / commits / 62c2eaf9

Add test for RemoveRegistryKey.

Sean Hall committed Nov 7, 2019 at 15:47 UTC 62c2eaf958c0b1a410fdf91dd0edcb542c60ef07
3 files changed +44
src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+32
@@ -713,6 +713,38 @@ namespace WixToolsetTest.CoreIntegration
713 }
714 }
715
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]
749 public void PopulatesReserveCostTable()
750 {
src/test/WixToolsetTest.CoreIntegration/TestData/Registry/RemoveRegistryKey.wxs new
+11
@@ -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>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+1
@@ -45,6 +45,7 @@
45 <Content Include="TestData\ProductWithComponentGroupRef\MinimalComponentGroup.wxs" CopyToOutputDirectory="PreserveNewest" />
46 <Content Include="TestData\ProductWithComponentGroupRef\Product.wxs" CopyToOutputDirectory="PreserveNewest" />
47 <Content Include="TestData\Registry\RegistryValue.wxs" CopyToOutputDirectory="PreserveNewest" />
48 + <Content Include="TestData\Registry\RemoveRegistryKey.wxs" CopyToOutputDirectory="PreserveNewest" />
49 <Content Include="TestData\ReserveCost\ReserveCost.wxs" CopyToOutputDirectory="PreserveNewest" />
50 <Content Include="TestData\ServiceInstall\OwnProcess.wxs" CopyToOutputDirectory="PreserveNewest" />
51 <Content Include="TestData\Shortcut\ShortcutProperty.wxs" CopyToOutputDirectory="PreserveNewest" />