Skip to content

Commit

Permalink
For fields, "" != null.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Jul 15, 2024
1 parent b9d8b1e commit 85c08f6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wix/WixToolset.Core/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1948,10 +1948,10 @@ private List<string> ParseSearchSignatures(XElement node)
signature = this.ParseComponentSearchElement(child);
break;
case "DirectorySearch":
signature = this.ParseDirectorySearchElement(child, String.Empty);
signature = this.ParseDirectorySearchElement(child, null);
break;
case "DirectorySearchRef":
signature = this.ParseDirectorySearchRefElement(child, String.Empty);
signature = this.ParseDirectorySearchRefElement(child, null);
break;
case "IniFileSearch":
signature = this.ParseIniFileSearchElement(child);
Expand Down
33 changes: 33 additions & 0 deletions src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,39 @@ public void PopulatesAppSearchTablesFromFileSearch()
}
}

[Fact]
public void PopulatesAppSearchTablesFromDirectorySearchInMergeModule()
{
var folder = TestData.Get(@"TestData");

using (var fs = new DisposableFileSystem())
{
var baseFolder = fs.GetFolder();
var intermediateFolder = Path.Combine(baseFolder, "obj");
var msmPath = Path.Combine(baseFolder, @"bin\test.msm");

var result = WixRunner.Execute(new[]
{
"build",
Path.Combine(folder, "AppSearch", "DirectorySearchInModule.wxs"),
"-bindpath", Path.Combine(folder, "SingleFile", "data"),
"-intermediateFolder", intermediateFolder,
"-o", msmPath,
"-sw1079",
});

result.AssertSuccess();

Assert.True(File.Exists(msmPath));
var results = Query.QueryDatabase(msmPath, new[] { "AppSearch", "DrLocator", "IniLocator" });
WixAssert.CompareLineByLine(new[]
{
"AppSearch:SYSTEM32FOLDER.7361203A_597E_4DA2_9024_27246B8446B2\tWindowsDrLocator.7361203A_597E_4DA2_9024_27246B8446B2",
"DrLocator:WindowsDrLocator.7361203A_597E_4DA2_9024_27246B8446B2\t\t[WindowsFolder.7361203A_597E_4DA2_9024_27246B8446B2]System32\t",
}, results);
}
}

[Fact]
public void PopulatesAppSearchTablesFromRegistrySearch()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Module Id="DirectorySearchModule" Language="1033" Version="1.0.0.0"
Guid="{7361203A-597E-4DA2-9024-27246B8446B2}">
<Property Id="SYSTEM32FOLDER">
<DirectorySearch Id="WindowsDrLocator" Path="[WindowsFolder]System32" />
</Property>
</Module>
</Wix>

0 comments on commit 85c08f6

Please sign in to comment.