Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A number of minor fixes for WiX v6 #536

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/burn/engine/registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

// constants

const LPCWSTR REGISTRY_RUN_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
const LPCWSTR REGISTRY_RUN_ONCE_KEY = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce";
const LPCWSTR REGISTRY_BUNDLE_DISPLAY_ICON = L"DisplayIcon";
const LPCWSTR REGISTRY_BUNDLE_DISPLAY_VERSION = L"DisplayVersion";
Expand Down
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
3 changes: 1 addition & 2 deletions src/wix/WixToolset.Core/Link/AddDefaultSymbolsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public void Execute()
// conjure a default major upgrade with the stdlib localization string for the
// downgrade error message.
var symbols = this.Sections.SelectMany(section => section.Symbols);
var upgradeSymbols = symbols.OfType<UpgradeSymbol>();
if (!upgradeSymbols.Any())
if (!symbols.OfType<UpgradeSymbol>().Any(us => !us.OnlyDetect))
{
var packageSymbol = this.Find.EntrySection.Symbols.OfType<WixPackageSymbol>().FirstOrDefault();

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>
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="MajorUpgradeDowngradeMessage" Language="1033" Version="2.0.0" Manufacturer="Example Corporation" UpgradeCode="7ab24276-c628-43db-9e65-a184d052909b" Scope="perMachine">
<Feature Id="ProductFeature" Title="MsiPackageTitle">
</Feature>
</Package>

<Fragment>
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage" />
</StandardDirectory>
</Fragment>
<Property Id="PRODUCT">
<ProductSearch UpgradeCode="{46649344-6CDF-4531-B91C-DCC088CBF6D3}" Minimum="1.0" />
</Property>
</Package>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void DefaultMajorUpgradePopulatesUpgradeRowsAsExpected()
WixAssert.CompareLineByLine(new[]
{
"LaunchCondition:NOT WIX_DOWNGRADE_DETECTED\tA newer version of [ProductName] is already installed.",
"Upgrade:{46649344-6CDF-4531-B91C-DCC088CBF6D3}\t1.0\t\t\t258\t\tPRODUCT",
"Upgrade:{7AB24276-C628-43DB-9E65-A184D052909B}\t\t2.0.0\t1033\t1\t\tWIX_UPGRADE_DETECTED",
"Upgrade:{7AB24276-C628-43DB-9E65-A184D052909B}\t2.0.0\t\t1033\t2\t\tWIX_DOWNGRADE_DETECTED",
}, results);
Expand Down
Loading