Skip to content

Commit

Permalink
[release/8.0.4xx] Add registry search for upgrade policy keys (#20155)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacques Eloff <joeloff@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and joeloff authored Oct 7, 2024
1 parent 5607a6d commit 76fb7c9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
4 changes: 0 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,6 @@
<HostFxrVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</HostFxrVersion>
<SharedHostVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</SharedHostVersion>
</PropertyGroup>
<PropertyGroup>
<!-- This is the version of the zip archive for the WiX toolset and is different from the NuGet package version format. -->
<WixVersion>3.14.1.8722</WixVersion>
</PropertyGroup>
<PropertyGroup>
<!-- 8.0 Template versions -->
<MicrosoftDotnetWinFormsProjectTemplates80PackageVersion>$(MicrosoftDotnetWinFormsProjectTemplatesPackageVersion)</MicrosoftDotnetWinFormsProjectTemplates80PackageVersion>
Expand Down
15 changes: 9 additions & 6 deletions src/redist/targets/GenerateMSIs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<Target Name="SetupWixProperties" DependsOnTargets="GetCurrentRuntimeInformation">
<!-- AcquireWix Properties -->
<PropertyGroup>
<WixDownloadUrl>https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/wix/Microsoft.Signed.Wix-$(WixVersion).zip</WixDownloadUrl>
<WixRoot>$(ArtifactsDir)Tools/WixTools/$(WixVersion)</WixRoot>
<WixDestinationPath>$(WixRoot)/WixTools.$(WixVersion).zip</WixDestinationPath>
<WixDownloadSentinel>$(WixRoot)/WixDownload.$(WixVersion).sentinel</WixDownloadSentinel>
<WixDownloadUrl>https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/wix/Microsoft.Signed.Wix-$(MicrosoftSignedWixVersion).zip</WixDownloadUrl>
<WixRoot>$(ArtifactsDir)Tools/WixTools/$(MicrosoftSignedWixVersion)</WixRoot>
<WixDestinationPath>$(WixRoot)/WixTools.$(MicrosoftSignedWixVersion).zip</WixDestinationPath>
<WixDownloadSentinel>$(WixRoot)/WixDownload.$(MicrosoftSignedWixVersion).sentinel</WixDownloadSentinel>
</PropertyGroup>

<!-- Generate MSI/Bundle Properties -->
Expand Down Expand Up @@ -126,7 +126,7 @@
<MakeDir Directories="$(WixRoot)" />
<WriteLinesToFile
File="$(WixDownloadSentinel)"
Lines="$(WixVersion)"
Lines="$(MicrosoftSignedWixVersion)"
Overwrite="true"
Encoding="Unicode"/>

Expand Down Expand Up @@ -344,9 +344,11 @@
</ItemGroup>
<PropertyGroup>
<LatestTemplateMsiInstallerFile>@(LatestTemplateInstallerComponent->'%(MSIInstallerFile)')</LatestTemplateMsiInstallerFile>
<UpgradePoliciesSrcPath>$(PkgMicrosoft_DotNet_Build_Tasks_Installers)\build\wix\bundle\upgradePolicies.wxs</UpgradePoliciesSrcPath>
</PropertyGroup>

<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateBundlePowershellScript) ^
-UpgradePoliciesWxsFile '$(UpgradePoliciesSrcPath)' ^
-WorkloadManifestWxsFile '$(WorkloadManifestsWxsPath)' ^
-CLISDKMSIFile '$(SdkMSIInstallerFile)' ^
-ASPNETRuntimeWixLibFile '$(DownloadsFolder)$(DownloadedAspNetCoreSharedFxWixLibFileName)' ^
Expand Down Expand Up @@ -383,6 +385,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 @@ -393,7 +396,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 @@ -35,6 +35,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 @@ -53,7 +54,9 @@ function RunCandleForBundle
-dSDKProductBandVersion="$SDKProductBandVersion" `
-dNugetVersion="$DotnetCLINugetVersion" `
-dVersionMajor="$VersionMajor" `
-dMajorVersion="$VersionMajor" `
-dVersionMinor="$VersionMinor" `
-dMinorVersion="$VersionMinor" `
-dCLISDKMsiSourcePath="$CLISDKMSIFile" `
-dDependencyKeyName="$DependencyKeyName" `
-dUpgradeCode="$UpgradeCode" `
Expand Down Expand Up @@ -82,7 +85,7 @@ function RunCandleForBundle
-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 @@ -102,13 +105,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

0 comments on commit 76fb7c9

Please sign in to comment.