Skip to content

Commit

Permalink
Add registry search for upgrade policy keys (#57952) (#58095)
Browse files Browse the repository at this point in the history
* Add registry search for upgrade policy keys

* SharedFx bundle too

* Add util extension

* Another fix
  • Loading branch information
wtgodbe authored Oct 30, 2024
1 parent d7130a2 commit 4dab764
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=329770"
Expand All @@ -11,6 +12,10 @@
<PayloadGroupRef Id="PG_Resources"/>
</BootstrapperApplicationRef>

<util:RegistrySearchRef Id="RemovePreviousVersionRegistryKeySearch"/>
<util:RegistrySearchRef Id="RemoveSpecificPreviousVersionRegistryKeyExistsSearch"/>
<util:RegistrySearchRef Id="RemoveSpecificPreviousVersionRegistryKeySearch"/>

<!-- Ensure upgrades from 3.0.0 preview 1, 2, and 3. Conditioned for the 3.0.0 family. -->
<?if $(var.Version)=3.0.0.0?>
<?if $(var.Platform)=x86?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
</PropertyGroup>

<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixDependencyExtension">
<HintPath>$(WixExtDir)\WixDependencyExtension.dll</HintPath>
<Name>WixDependencyExtension</Name>
Expand All @@ -25,6 +29,7 @@

<ItemGroup>
<Compile Include="Bundle.wxs" />
<Compile Include="$(PkgMicrosoft_DotNet_Build_Tasks_Installers)\build\wix\bundle\upgradePolicies.wxs" />
<Content Include="thm.xml" />
</ItemGroup>

Expand Down
5 changes: 5 additions & 0 deletions src/Installers/Windows/WindowsHostingBundle/Bundle.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<PayloadGroupRef Id="PG_Resources"/>
</BootstrapperApplicationRef>

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

<!-- Ensure upgrades from 3.0.0 preview 1 and 2 (Preview 3 was not shipped). Conditioned for the 3.0.0 family. Hosting bundle simships x86/x64 so there's
a single set of upgrade codes. -->
<?if $(var.Version)=3.0.0.0?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<Compile Include="Bundle.wxs" />
<Compile Include="DotNetCore.wxs" />
<Compile Include="SharedFramework.wxs" />
<Compile Include="$(PkgMicrosoft_DotNet_Build_Tasks_Installers)\build\wix\bundle\upgradePolicies.wxs" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Installers/Windows/Wix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
NoLogo="true"
Cultures="en-us"
InstallerFile="%(WixInstallerFilesToProcess.Identity)"
AdditionalBasePaths="$(MSBuildProjectDirectory)"
AdditionalBasePaths="$(MSBuildProjectDirectory);$(PkgMicrosoft_DotNet_Build_Tasks_Installers)\build\wix\bundle"
WixExtensions="@(WixExtension)"
Loc="@(EmbeddedResource)"
Sice="$(SuppressIces)"
Expand Down

0 comments on commit 4dab764

Please sign in to comment.