diff options
author | Rob Mensching <rob@firegiant.com> | 2021-03-19 12:10:05 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-03-19 12:15:11 -0700 |
commit | 3d5c85c88fc7440b0e232173a18f80f3363c039a (patch) | |
tree | 31a53fe22a7ac66272c9517f4ae194e51d471e6b | |
parent | b441a16555d8a720b89028bc4cf3684e58864115 (diff) | |
download | wix-3d5c85c88fc7440b0e232173a18f80f3363c039a.tar.gz wix-3d5c85c88fc7440b0e232173a18f80f3363c039a.tar.bz2 wix-3d5c85c88fc7440b0e232173a18f80f3363c039a.zip |
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
4 files changed, 41 insertions, 1 deletions
diff --git a/src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/Module.wxs b/src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/Module.wxs new file mode 100644 index 00000000..39674278 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/Module.wxs | |||
@@ -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> | ||
diff --git a/src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/ModuleComponents.wxs b/src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/ModuleComponents.wxs new file mode 100644 index 00000000..236d9df0 --- /dev/null +++ b/src/test/WixToolsetTest.Util/TestData/RemoveFolderEx/ModuleComponents.wxs | |||
@@ -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> | ||
diff --git a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs index 0761a004..3e2a97f9 100644 --- a/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs +++ b/src/test/WixToolsetTest.Util/UtilExtensionFixture.cs | |||
@@ -130,6 +130,21 @@ namespace WixToolsetTest.Util | |||
130 | } | 130 | } |
131 | 131 | ||
132 | [Fact] | 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] | ||
133 | public void CanBuildWithEventManifest() | 148 | public void CanBuildWithEventManifest() |
134 | { | 149 | { |
135 | var folder = TestData.Get(@"TestData\EventManifest"); | 150 | var folder = TestData.Get(@"TestData\EventManifest"); |
diff --git a/src/wixext/UtilTableDefinitions.cs b/src/wixext/UtilTableDefinitions.cs index 1908915c..eff5aaf6 100644 --- a/src/wixext/UtilTableDefinitions.cs +++ b/src/wixext/UtilTableDefinitions.cs | |||
@@ -31,7 +31,7 @@ namespace WixToolset.Util | |||
31 | { | 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), | 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), | 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."), | 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 | }, | 36 | }, |
37 | symbolIdIsPrimaryKey: true | 37 | symbolIdIsPrimaryKey: true |