For fields, "" != null.
Fixes https://github.com/wixtoolset/issues/issues/8558
Bob Arnson committed
Jun 29, 2024 at 21:19 UTC
f0e48ecd4663368a577a780220f843ec10b7b402
3 files changed
+44
-2
src/wix/WixToolset.Core/Compiler.cs
+2
-2
@@ -1948,10 +1948,10 @@ namespace WixToolset.Core
1948
signature = this.ParseComponentSearchElement(child);
1949
break;
1950
case "DirectorySearch":
1951
- signature = this.ParseDirectorySearchElement(child, String.Empty);
1951
+ signature = this.ParseDirectorySearchElement(child, null);
1952
break;
1953
case "DirectorySearchRef":
1954
- signature = this.ParseDirectorySearchRefElement(child, String.Empty);
1954
+ signature = this.ParseDirectorySearchRefElement(child, null);
1955
break;
1956
case "IniFileSearch":
1957
signature = this.ParseIniFileSearchElement(child);
src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+33
@@ -115,6 +115,39 @@ namespace WixToolsetTest.CoreIntegration
115
}
116
}
117
118
+ [Fact]
119
+ public void PopulatesAppSearchTablesFromDirectorySearchInMergeModule()
120
+ {
121
+ var folder = TestData.Get(@"TestData");
122
+
123
+ using (var fs = new DisposableFileSystem())
124
+ {
125
+ var baseFolder = fs.GetFolder();
126
+ var intermediateFolder = Path.Combine(baseFolder, "obj");
127
+ var msmPath = Path.Combine(baseFolder, @"bin\test.msm");
128
+
129
+ var result = WixRunner.Execute(new[]
130
+ {
131
+ "build",
132
+ Path.Combine(folder, "AppSearch", "DirectorySearchInModule.wxs"),
133
+ "-bindpath", Path.Combine(folder, "SingleFile", "data"),
134
+ "-intermediateFolder", intermediateFolder,
135
+ "-o", msmPath,
136
+ "-sw1079",
137
+ });
138
+
139
+ result.AssertSuccess();
140
+
141
+ Assert.True(File.Exists(msmPath));
142
+ var results = Query.QueryDatabase(msmPath, new[] { "AppSearch", "DrLocator", "IniLocator" });
143
+ WixAssert.CompareLineByLine(new[]
144
+ {
145
+ "AppSearch:SYSTEM32FOLDER.7361203A_597E_4DA2_9024_27246B8446B2\tWindowsDrLocator.7361203A_597E_4DA2_9024_27246B8446B2",
146
+ "DrLocator:WindowsDrLocator.7361203A_597E_4DA2_9024_27246B8446B2\t\t[WindowsFolder.7361203A_597E_4DA2_9024_27246B8446B2]System32\t",
147
+ }, results);
148
+ }
149
+ }
150
+
151
[Fact]
152
public void PopulatesAppSearchTablesFromRegistrySearch()
153
{
src/wix/test/WixToolsetTest.CoreIntegration/TestData/AppSearch/DirectorySearchInModule.wxs
new
+9
@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3
+ <Module Id="DirectorySearchModule" Language="1033" Version="1.0.0.0"
4
+ Guid="{7361203A-597E-4DA2-9024-27246B8446B2}">
5
+ <Property Id="SYSTEM32FOLDER">
6
+ <DirectorySearch Id="WindowsDrLocator" Path="[WindowsFolder]System32" />
7
+ </Property>
8
+ </Module>
9
+</Wix>