installer icon indicating copy to clipboard operation
installer copied to clipboard

Add registry search for upgrade policy keys

Open joeloff opened this issue 1 year ago • 6 comments

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 (https://github.com/dotnet/arcade/pull/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

joeloff avatar Jul 26 '24 15:07 joeloff

/backport to release/8.0.1xx

joeloff avatar Sep 05 '24 16:09 joeloff

/backport to release/8.0.4xx

joeloff avatar Sep 05 '24 16:09 joeloff

/backport to release/8.0.1xx

joeloff avatar Sep 05 '24 16:09 joeloff

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

github-actions[bot] avatar Sep 05 '24 16:09 github-actions[bot]

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

github-actions[bot] avatar Sep 05 '24 16:09 github-actions[bot]

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

github-actions[bot] avatar Sep 05 '24 16:09 github-actions[bot]

Not taking this for 6.0

joeloff avatar Oct 04 '24 16:10 joeloff