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

[release/8.0.4xx] Add registry search for upgrade policy keys #20155

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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 @@ -82,7 +83,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 +103,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