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

Add registry search for upgrade policy keys #20035

Closed
Closed
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
6 changes: 5 additions & 1 deletion src/redist/targets/GenerateMSIs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,12 @@
</ItemGroup>
<PropertyGroup>
<LatestTemplateMsiInstallerFile>@(LatestTemplateInstallerComponent->'%(MSIInstallerFile)')</LatestTemplateMsiInstallerFile>

<UpgradePoliciesSrcPath>$(PkgMicrosoft_DotNet_Build_Tasks_Installers)\build\wix\bundle\upgradePolicies.wxs</UpgradePoliciesSrcPath>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the package reference have GeneratePathProperty="true" to allow for PkgMicrosoft_DotNet_Build_Tasks_Installers to exist?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

</PropertyGroup>

<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript) ^
'$(UpgradePoliciesSrcPath)' ^
'$(WorkloadManifestsWxsPath)' ^
'$(SdkMSIInstallerFile)' ^
'$(DownloadsFolder)$(DownloadedAspNetCoreSharedFxWixLibFileName)' ^
Expand Down Expand Up @@ -361,6 +364,7 @@
<ItemGroup>
<BundleMsiWixSrcFiles Include="$(WixRoot)\bundle.wixobj" />
<BundleMsiWixSrcFiles Include="$(WixRoot)\WorkloadManifests.wixobj" />
<BundleMsiWixSrcFiles Include="$(WixRoot)\upgradePolicies.wixobj" />
<BundleMsiWixSrcFiles Include="$(DownloadsFolder)$(DownloadedAspNetCoreSharedFxWixLibFileName)" />
</ItemGroup>
<CreateLightCommandPackageDrop
Expand All @@ -371,7 +375,7 @@
InstallerFile="$(CombinedFrameworkSdkHostMSIInstallerFile)"
WixExtensions="WixBalExtension;WixUtilExtension;WixTagExtension"
WixSrcFiles="@(BundleMsiWixSrcFiles)"
AdditionalBasePaths="$(MSBuildThisFileDirectory)packaging/windows/clisdk">
AdditionalBasePaths="$(MSBuildThisFileDirectory)packaging/windows/clisdk;$(PkgMicrosoft_DotNet_Build_Tasks_Installers)\build\wix\bundle">
<Output TaskParameter="OutputFile" PropertyName="_LightCommandPackageNameOutput" />
</CreateLightCommandPackageDrop>
</Target>
Expand Down
5 changes: 5 additions & 0 deletions src/redist/targets/packaging/windows/clisdk/bundle.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@

<swid:Tag Regid="microsoft.com" InstallPath="[$(var.Program_Files)]dotnet" />

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

<util:RegistrySearch Id="CheckDotnetInstallLocation_x86"
Variable="DotnetInstallLocationExists_x86"
Result="exists"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.

param(
[Parameter(Mandatory=$true)][string]$UpgradePoliciesWxsFile,
[Parameter(Mandatory=$true)][string]$WorkloadManifestWxsFile,
[Parameter(Mandatory=$true)][string]$CLISDKMSIFile,
[Parameter(Mandatory=$true)][string]$ASPNETRuntimeWixLibFile,
Expand Down Expand Up @@ -74,11 +75,13 @@ function RunCandleForBundle
-dDotNetRuntimeVersion="$DotNetRuntimeVersion" `
-dAspNetCoreVersion="$AspNetCoreVersion" `
-dLocalizedContentDirs="$LocalizedContentDirs" `
-dMajorVersion="$($DotnetCLINugetVersion.Split(".")[0])" `
-dMinorVersion="$($DotnetCLINugetVersion.Split(".")[1])" `
-arch "$Architecture" `
-ext WixBalExtension.dll `
-ext WixUtilExtension.dll `
-ext WixTagExtension.dll `
"$AuthWsxRoot\bundle.wxs" "$WorkloadManifestWxsFile"
"$AuthWsxRoot\bundle.wxs" "$WorkloadManifestWxsFile" "$UpgradePoliciesWxsFile"

Write-Information "Candle output: $candleOutput"

Expand All @@ -98,13 +101,15 @@ function RunLightForBundle
pushd "$WixRoot"

$WorkloadManifestWixobjFile = [System.IO.Path]::GetFileNameWithoutExtension($WorkloadManifestWxsFile) + ".wixobj"
$UpgradePoliciesWixobjFile = [System.IO.Path]::GetFileNameWithoutExtension($UpgradePoliciesWxsFile) + ".wixobj"

Write-Information "Running light for bundle.."

$lightOutput = .\light.exe -nologo `
-cultures:en-us `
bundle.wixobj `
$WorkloadManifestWixobjFile `
$UpgradePoliciesWixobjFile `
$ASPNETRuntimeWixlibFile `
-ext WixBalExtension.dll `
-ext WixUtilExtension.dll `
Expand Down
Loading