Skip to content

Commit

Permalink
[release/9.0] Add registry search for upgrade policy keys (#15048)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacques Eloff <[email protected]>
  • Loading branch information
github-actions[bot] and joeloff authored Sep 16, 2024
1 parent bcba693 commit 04b9022
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<MicrosoftCciVersion>4.0.0-rc3-24214-00</MicrosoftCciVersion>
<!-- Keep Microsoft.Data.Services.Client package version in sync with Microsoft.Data.OData -->
<MicrosoftDataServicesClientVersion>5.8.4</MicrosoftDataServicesClientVersion>
<MicrosoftSignedWixVersion>3.14.1-8722.20240403.1</MicrosoftSignedWixVersion>
<MicrosoftSignedWixVersion>3.14.1-9313.2537997</MicrosoftSignedWixVersion>
<!-- Overwrite XUnitVersion/XUnitAnalyzersVersion/XUnitAnalyzersVersion that comes from the Arcade SDK to be in sync as Arcade doesn't use a live Arcade SDK.
Keep in sync with DefaultVersions.props. -->
<XUnitVersion>2.9.0</XUnitVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<MicrosoftVisualStudioEngMicroBuildCoreVersion Condition="'$(MicrosoftVisualStudioEngMicroBuildCoreVersion)' == ''">1.0.0</MicrosoftVisualStudioEngMicroBuildCoreVersion>
<MicrosoftManifestToolCrossPlatformVersion Condition="'$(MicrosoftManifestToolCrossPlatformVersion)' == ''">2.1.3</MicrosoftManifestToolCrossPlatformVersion>
<MicrosoftVisualStudioEngMicroBuildPluginsSwixBuildVersion Condition="'$(MicrosoftVisualStudioEngMicroBuildPluginsSwixBuildVersion)' == ''">1.1.286</MicrosoftVisualStudioEngMicroBuildPluginsSwixBuildVersion>
<MicrosoftSignedWixVersion Condition="'$(MicrosoftSignedWixVersion)' == ''">3.14.1-8722.20240403.1</MicrosoftSignedWixVersion>
<MicrosoftSignedWixVersion Condition="'$(MicrosoftSignedWixVersion)' == ''">3.14.1-9313.2537997</MicrosoftSignedWixVersion>
</PropertyGroup>

<!-- RestoreSources overrides - defines DotNetRestoreSources variable if available -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
</bal:Condition>
<?endif?>

<!-- Search references for upgrade policy keys -->
<util:RegistrySearchRef Id="RemovePreviousVersionRegistryKeySearch"/>
<util:RegistrySearchRef Id="RemoveSpecificPreviousVersionRegistryKeyExistsSearch"/>
<util:RegistrySearchRef Id="RemoveSpecificPreviousVersionRegistryKeySearch"/>

<!--
List of bundles that this bundle is an upgrade for. Used to support upgrade from bundles
that were produced before UpdateCode was standardized per major-minor channel.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<!-- Bundle variables become unset if a search fails. The global key is retrieved first. If this fails,
RemoveUpgradeRelatedBundle becomes unset, allowing the version specific search to potentially set
or override the bundle variable. -->
<util:RegistrySearch Id="RemovePreviousVersionRegistryKeySearch"
Root="HKLM"
Key="SOFTWARE\Microsoft\.NET"
Value="RemovePreviousVersion"
Result="value"
Variable="RemoveUpgradeRelatedBundle"
Win64="yes" />

<!-- The version specific key matching the major/minor of the .NET bundle takes precedence. The first search
checks whether the registry value exists and creates a variable that can be used as a condition
to executes the second part of the search to retrieve it. If the value doesn't exist, RemoveUpgradeRelatedBundle
retains its original value, or if it wasn't set, will be assigned a proper default through the BA (wixstdba). -->
<util:RegistrySearch Id="RemoveSpecificPreviousVersionRegistryKeyExistsSearch"
After="RemovePreviousVersionRegistryKeySearch"
Root="HKLM"
Key="SOFTWARE\Microsoft\.NET\$(var.MajorVersion).$(var.MinorVersion)"
Value="RemovePreviousVersion"
Result="exists"
Variable="RemoveSpecificPreviousVersionRegistryKeyExists"
Win64="yes" />
<util:RegistrySearch Id="RemoveSpecificPreviousVersionRegistryKeySearch"
After="RemoveSpecificPreviousVersionRegistryKeyExistsSearch"
Condition="RemoveSpecificPreviousVersionRegistryKeyExists=1"
Root="HKLM"
Key="SOFTWARE\Microsoft\.NET\$(var.MajorVersion).$(var.MinorVersion)"
Value="RemovePreviousVersion"
Result="value"
Variable="RemoveUpgradeRelatedBundle"
Win64="yes" />
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</PropertyGroup>

<PropertyGroup>
<WixVersion>3.14.1.8722</WixVersion>
<WixVersion>3.14.1-9313.2537997</WixVersion>
<WixToolsDir>$(BaseIntermediateOutputPath)WixTools.$(WixVersion)/</WixToolsDir>
<!-- Used in WiX targets to locate files. -->
<WixInstallPath>$(WixToolsDir)</WixInstallPath>
Expand Down Expand Up @@ -127,6 +127,7 @@
<WixExtensions Include="WixUtilExtension.dll" />

<WixSrcFile Include="$(MSBuildThisFileDirectory)bundle/bundle.wxs" />
<WixSrcFile Include="$(MSBuildThisFileDirectory)bundle/upgradePolicies.wxs" />
</ItemGroup>
</Target>

Expand Down Expand Up @@ -187,6 +188,8 @@
<LocFile Include="$(BundleThemeDirectory)\theme\**\bundle.wxl" />
<LocDirName Include="$([System.String]::new('%(LocFile.RecursiveDir)').TrimEnd('\'))" />

<CandleVariables Include="MajorVersion" Value="$(MajorVersion)" />
<CandleVariables Include="MinorVersion" Value="$(MinorVersion)" />
<CandleVariables Include="DisplayVersion" Value="$(MajorVersion).$(MinorVersion).$(PatchVersion).$(BuildNumberMajor)" />
<CandleVariables Include="LcidList" Value="@(LocDirName)" />
<CandleVariables Include="BundleThmDir" Value="$(BundleThemeDirectory)" />
Expand Down

0 comments on commit 04b9022

Please sign in to comment.