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

Conversation

joeloff
Copy link
Member

@joeloff joeloff commented Jul 26, 2024

Description

Add registry search operations to SDK installer bundles. The search operation will check for a global and version specific registry key. The version specific key takes precedence when present.

This is related to a customer request and part of a larger change. This PR only includes infrastructure changes to support changes in the Windows installer bundles. The change depends on changes in Arcade (dotnet/arcade#14975).

NB: This PR will not build until the Arcade change is merged and flowed to the SDK.

Unlike the runtime and desktop runtime, the SDK needs to explicitly pull in the additional source file.

Risk

Low, this change only adds detection for the key, nothing will currently act on its value.

Testing

Verified against a private build of SDK. Log excerpt below. The test machine contained only the global key, hence why the existence check returns 0 for the version specific key.

[0D28:1454][2024-07-26T08:43:38]i000: Setting string variable 'WixBundleName' to value 'Microsoft .NET SDK 6.0.425 (x64)'
[0D28:1454][2024-07-26T08:43:38]i000: Setting string variable 'RemoveUpgradeRelatedBundle' to value 'nextSession'
[0D28:1454][2024-07-26T08:43:38]i000: Registry key not found. Key = 'SOFTWARE\Microsoft\.NET\6.0'
[0D28:1454][2024-07-26T08:43:38]i000: Setting numeric variable 'RemoveSpecificPreviousVersionRegistryKeyExists' to value 0

@@ -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

@joeloff
Copy link
Member Author

joeloff commented Sep 5, 2024

/backport to release/8.0.1xx

@joeloff
Copy link
Member Author

joeloff commented Sep 5, 2024

/backport to release/8.0.4xx

@joeloff
Copy link
Member Author

joeloff commented Sep 5, 2024

/backport to release/8.0.1xx

Copy link

github-actions bot commented Sep 5, 2024

Started backporting to release/8.0.1xx: https://github.com/dotnet/installer/actions/runs/10724523117

Copy link

github-actions bot commented Sep 5, 2024

@joeloff backporting to release/8.0.1xx failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Add registry search for upgrade policy keys
Using index info to reconstruct a base tree...
M	src/redist/targets/GenerateMSIs.targets
M	src/redist/targets/packaging/windows/clisdk/bundle.wxs
M	src/redist/targets/packaging/windows/clisdk/generatebundle.ps1
Falling back to patching base and 3-way merge...
Auto-merging src/redist/targets/packaging/windows/clisdk/generatebundle.ps1
Auto-merging src/redist/targets/packaging/windows/clisdk/bundle.wxs
Auto-merging src/redist/targets/GenerateMSIs.targets
CONFLICT (content): Merge conflict in src/redist/targets/GenerateMSIs.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Add registry search for upgrade policy keys
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link

github-actions bot commented Sep 5, 2024

@joeloff an error occurred while backporting to release/8.0.1xx, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@joeloff
Copy link
Member Author

joeloff commented Oct 4, 2024

Not taking this for 6.0

@joeloff joeloff closed this Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants