Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Directory.csproj.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<Project>
<PropertyGroup>
<LangVersion Condition=" '$(TargetFrameworkVersion)'=='' ">14.0</LangVersion>
<LangVersion Condition=" '$(TargetFrameworkVersion)'=='' ">13.0</LangVersion>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk))</AssemblyOriginatorKeyFile>
Expand Down
13 changes: 11 additions & 2 deletions src/burn/engine/relatedbundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,19 @@ static HRESULT LoadRelatedBundleFromKey(
LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion);
}

// Look for v7+ scope registration.
hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE, &dwScope);
ExitOnFailure(hr, "Failed to read registration %ls for bundle %ls.", wzRelatedBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE);
if (SUCCEEDED(hr))
{
pRelatedBundle->detectedScope = static_cast<BOOTSTRAPPER_SCOPE>(dwScope);
}
else if (E_FILENOTFOUND == hr)
{
hr = S_OK;

pRelatedBundle->detectedScope = static_cast<BOOTSTRAPPER_SCOPE>(dwScope);
pRelatedBundle->detectedScope = fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER;
}
ExitOnFailure(hr, "Failed to read registration %ls for bundle %ls.", wzRelatedBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE);

hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath);
ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode);
Expand Down
2 changes: 1 addition & 1 deletion src/internal/SetBuildNumber/global.json.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"WixToolset.Sdk": "{packageversion}"
},
"sdk": {
"version": "10.0.100",
"version": "9.0.300",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
<Bundle Id="PerMachineBundle" Name="PerMachineBundle" Manufacturer="Acme" Version="1.0.0.0">
<Bundle Id="PerMachineBundle" Name="PerMachineBundle" Manufacturer="Acme" Version="$(Version)">
<BootstrapperApplication>
<bal:WixStandardBootstrapperApplication LicenseUrl="https://www.example.com/license" Theme="hyperlinkLicense" />
</BootstrapperApplication>

<Variable Name="TestBundleId" Value="PerMachineBundle v$(Version)" />

<Chain>
<MsiPackage SourceFile="PerMachinePkg.msi" />
</Chain>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<OutputType>Bundle</OutputType>
<DefineConstants>$(DefineConstants);Version=1.0.0.0</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixToolset.BootstrapperApplications.wixext" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="WixToolset.Sdk">
<PropertyGroup>
<OutputType>Bundle</OutputType>
<DefineConstants>$(DefineConstants);Version=2.0.0.0</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixToolset.BootstrapperApplications.wixext" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PerMachinePkg\PerMachinePkg.wixproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
<Bundle Id="PerMachineBundle" Name="PerMachineBundle" Manufacturer="Acme" Version="1.0.0.0">
<BootstrapperApplication>
<bal:WixStandardBootstrapperApplication LicenseUrl="https://www.example.com/license" Theme="hyperlinkLicense" />
</BootstrapperApplication>

<Variable Name="TestBundleId" Value="PerMachineBundleWix6 v1.0.0.0" />

<Chain>
<MsiPackage SourceFile="PerMachinePkgWix6.msi" />
</Chain>
</Bundle>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="WixToolset.Sdk/6.0.2">
<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<OutputType>Bundle</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixToolset.BootstrapperApplications.wixext" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PerMachinePkgWix6\PerMachinePkgWix6.wixproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="WixToolset.Sdk/6.0.2">
<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Id="PerMachinePkg" Name="PerMachinePkg" Language="1033" Version="1.0.0.0" Manufacturer="Acme" Scope="perMachine">
<MediaTemplate EmbedCab="yes" />
<File Source="$(sys.SOURCEFILEPATH)" />
</Package>
</Wix>
8 changes: 8 additions & 0 deletions src/test/burn/TestData6/TestData6.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->

<Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="**\*.wixproj" />
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions src/test/burn/TestData6/nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>

<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="WixToolset.*" />
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
40 changes: 40 additions & 0 deletions src/test/burn/WixToolsetTest.BurnE2E/ConfigurableScopeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,46 @@ public void BundleUpgradeWithSameScopeSucceeds()
bundle.VerifyUnregisteredAndRemovedFromPackageCache(plannedPerMachine: false);
}

[RuntimeFact]
public void BundleUpgradeFromWix6IsLockedToFirstBundlesScope()
{
var bundle = this.CreateBundleInstaller("PerMachineBundleWix6");
bundle.Install();

bundle.VerifyRegisteredAndInPackageCache(plannedPerMachine: true);

var testBAController = this.CreateTestBAController();
testBAController.SetBundleScope(BundleScope.PerUser);

var bundleV2 = this.CreateBundleInstaller("PerMachineBundleV2");
var log = bundleV2.Install();
Assert.True(LogVerifier.MessageInLogFileRegex(log, @"Upgraded bundle [{][0-9A-Fa-f\-]{36}[}] was already installed with scope: PerMachine\. Scope cannot change during upgrade\."));

bundleV2.Uninstall();
bundleV2.VerifyUnregisteredAndRemovedFromPackageCache(plannedPerMachine: true);
bundle.VerifyUnregisteredAndRemovedFromPackageCache(plannedPerMachine: true);
}

[RuntimeFact]
public void BundleUpgradeFromWix6WithSameScopeSucceeds()
{
var bundle = this.CreateBundleInstaller("PerMachineBundleWix6");
bundle.Install();

bundle.VerifyRegisteredAndInPackageCache(plannedPerMachine: true);

var testBAController = this.CreateTestBAController();
testBAController.SetBundleScope(BundleScope.PerMachine);

var bundleV2 = this.CreateBundleInstaller("PerMachineBundleV2");
var log = bundleV2.Install();
Assert.True(LogVerifier.MessageInLogFileRegex(log, @"Upgraded bundle [{][0-9A-Fa-f\-]{36}[}] was already installed with scope: PerMachine\. Scope cannot change during upgrade\."));

bundleV2.Uninstall();
bundleV2.VerifyUnregisteredAndRemovedFromPackageCache(plannedPerMachine: true);
bundle.VerifyUnregisteredAndRemovedFromPackageCache(plannedPerMachine: true);
}

[RuntimeFact]
public void PMOU_Bundle_Default_Plan_Installs_PerMachine()
{
Expand Down
1 change: 1 addition & 0 deletions src/test/burn/test_burn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

msbuild -Restore -p:Configuration=%_C% -tl -nologo -m -warnaserror -bl:%_L%\test_burn_build.binlog || exit /b
msbuild -Restore TestData\TestData.proj -p:Configuration=%_C% -tl -nologo -m -warnaserror -bl:%_L%\test_burn_data_build.binlog || exit /b
msbuild -Restore TestData6\TestData6.proj -p:Configuration=%_C% -tl -nologo -m -warnaserror -bl:%_L%\test_burn_data6_build.binlog || exit /b

"%_B%\net462\win-x86\testexe.exe" /dm "%_B%\net8.0-windows\testhost.exe"
mt.exe -manifest "WixToolsetTest.BurnE2E\testhost.longpathaware.manifest" -updateresource:"%_B%\net8.0-windows\testhost.exe"
Expand Down
Loading