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

Get the windows kits root from the registry value "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" @KitsRoot10 #8745

Merged
merged 6 commits into from
Apr 28, 2024

Conversation

JaynieBai
Copy link
Member

@JaynieBai JaynieBai commented May 10, 2023

Fixes #6090

Context

See here:

msbuild/src/Tasks/Microsoft.Common.CurrentVersion.targets

Line 2348 in ec6ed83

$(MSBuildProgramFiles32)\Microsoft SDKs\Windows Kits\10;$(MSBuildProgramFiles32)\Windows Kits\10
It's always looking for the Win10 SDK root under program files ($(MSBuildProgramFiles32)\Windows Kits\10). It should instead get the root from the registry value "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" @KitsRoot10

Changes Made

Get the root from the registry value "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" @KitsRoot10 with $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot10', null, RegistryView.Registry32, RegistryView.Default))

Testing

Couldn't install the windows SDK10 in non-default driver in the pipeline machine. So, test it locally.

Notes

@JaynieBai JaynieBai changed the title Jennybai/issue6090 Get the windows kits root from the registry value "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots" @KitsRoot10 May 10, 2023
@AR-May AR-May requested a review from rainersigwald May 16, 2023 13:36
@JaynieBai JaynieBai marked this pull request as ready for review June 12, 2023 09:15
@KalleOlaviNiemitalo
Copy link

AFAIK FEATURE_WIN32_REGISTRY is only defined when targeting .NET Framework, so with this PR, dotnet msbuild on Windows would no longer be able to locate the Windows kits.

Also, reserving the WindowsKitsDirectory property name might conflict with a property already being used in a project. MSBuildWindowsKitsDirectory would be safer as a name.

@JaynieBai JaynieBai marked this pull request as draft December 29, 2023 08:47
@JaynieBai JaynieBai marked this pull request as ready for review January 8, 2024 06:02
@surayya-MS
Copy link
Member

@YuliiaKovalova, do yo think this PR can be merged?

@JaynieBai JaynieBai merged commit 7cdb816 into main Apr 28, 2024
8 checks passed
@JaynieBai JaynieBai deleted the jennybai/issue6090 branch April 28, 2024 02:18
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.

Could not find SDK "Foo, Version=1.0" error when Win10 SDK installed to custom path
5 participants