RemoveFolderEx.Property should be modularized as a Column
The value in the column is the name of a Property not a formatted field that can contain properties. Fixes wixtoolset/issues#4449
Rob Mensching committed
Mar 19, 2021 at 12:10 UTC
3d5c85c88fc7440b0e232173a18f80f3363c039a
4 files changed
+41
-1
src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/Module.wxs
new
+15
@@ -0,0 +1,15 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
2
+ <Module Language="1033" Version="1.0.0.0" Id="InternetShortcutModule" Guid="047730a5-30fe-4a62-a520-da9381b8226a">
3
+ <SummaryInformation Manufacturer="Example Corporation" />
4
+
5
+ <ComponentGroupRef Id="ModuleComponents" />
6
+ </Module>
7
+
8
+ <Fragment>
9
+ <Directory Id="TARGETDIR" Name="SourceDir">
10
+ <Directory Id="ProgramFilesFolder">
11
+ <Directory Id="INSTALLFOLDER" Name="MergeModule" />
12
+ </Directory>
13
+ </Directory>
14
+ </Fragment>
15
+</Wix>
src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/ModuleComponents.wxs
new
+10
@@ -0,0 +1,10 @@
1
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
2
+ <Fragment>
3
+ <ComponentGroup Id="ModuleComponents" Directory="INSTALLFOLDER">
4
+ <Component>
5
+ <File Source="ModuleComponents.wxs" />
6
+ <util:RemoveFolderEx On="both" Property="RemoveProp" />
7
+ </Component>
8
+ </ComponentGroup>
9
+ </Fragment>
10
+</Wix>
src/test/WixToolsetTest.Util/UtilExtensionFixture.cs
+15
@@ -129,6 +129,21 @@ namespace WixToolsetTest.Util
129
}, results.OrderBy(s => s).ToArray());
130
}
131
132
+ [Fact]
133
+ public void CanBuildRemoveFolderExInMergeModule()
134
+ {
135
+ var folder = TestData.Get(@"TestData\RemoveFolderEx");
136
+ var build = new Builder(folder, typeof(UtilExtensionFactory), new[] { folder }, "test.msm");
137
+
138
+ var results = build.BuildAndQuery(BuildX64, "Binary", "CustomAction", "RemoveFile", "Wix4RemoveFolderEx");
139
+ WixAssert.CompareLineByLine(new[]
140
+ {
141
+ "Binary:Wix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t[Binary data]",
142
+ "CustomAction:Wix4RemoveFoldersEx_X64.047730A5_30FE_4A62_A520_DA9381B8226A\t65\tWix4UtilCA_X64.047730A5_30FE_4A62_A520_DA9381B8226A WixRemoveFoldersEx\t",
143
+ "Wix4RemoveFolderEx:wrfB3e9CDihkNwm06LohylbJcjZ91w.047730A5_30FE_4A62_A520_DA9381B8226A\tfilh4juyUVjoUcWWtcQmd5L07FoON4.047730A5_30FE_4A62_A520_DA9381B8226A\tRemoveProp.047730A5_30FE_4A62_A520_DA9381B8226A\t3",
144
+ }, results.OrderBy(s => s).ToArray());
145
+ }
146
+
147
[Fact]
148
public void CanBuildWithEventManifest()
149
{
src/wixext/UtilTableDefinitions.cs
+1
-1
@@ -31,7 +31,7 @@ namespace WixToolset.Util
31
{
32
new ColumnDefinition("Wix4RemoveFolderEx", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Identifier for the WixRemoveFolderEx row in the package.", modularizeType: ColumnModularizeType.Column),
33
new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column),
34
- new ColumnDefinition("Property", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Name of Property that contains the root of the directory tree to remove.", modularizeType: ColumnModularizeType.Property),
34
+ new ColumnDefinition("Property", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Name of Property that contains the root of the directory tree to remove.", modularizeType: ColumnModularizeType.Column),
35
new ColumnDefinition("InstallMode", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 3, description: "1 == Remove only when the associated component is being installed (msiInstallStateLocal or msiInstallStateSource), 2 == Remove only when the associated component is being removed (msiInstallStateAbsent), 3 = Remove in either of the above cases."),
36
},
37
symbolIdIsPrimaryKey: true