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

Try reading a registry value to get the root path to the installed Wind… #2099

Conversation

Felix-Dev
Copy link
Contributor

…ows SDK.

Description

When the Windows SDK is installed in a custom location (so not C:\Program Files (x86)\Windows Kits\...) the MUXControls.TestApp cannot find the referenced windows.winmd file causing build failures when attempting to run interaction tests (via TestExplorer for example).

This PR attempts to fix this issue by reading a registry value containing the path to the installed Windows SDK. The value in question is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot10. If this value does not exist we fall back to the currently obtained path using MSBuildProgramFiles32.

Motivation and Context

Fixes #2088.

How Has This Been Tested?

Tested on my local machine.

Additional info

WIth this fix, the path to the windows.winmd file obtained looks, for example, like this:
image

Note the double backslashes ...\10\\UnionMetadata\.... This happens because the registry value is a path containing a trailing backslash and we also manually add a backslash between $(UniversalCRTSdkDir) and UnionMetadata.

There is no issue on my local machine with the double backslashes. In case this will cause an issue in the Build pipeline though, a possible fix would be to remove the manually added backslash and add a trailing backslash when we define UniversalCRTSdkDir in the fallback option using
MSBuildProgramFiles32, like so:

<UniversalCRTSdkDir Condition="'$(UniversalCRTSdkDir)' == ''">$(MSBuildProgramFiles32)\Windows Kits\10\</UniversalCRTSdkDir>
<WindowsMetadataPath>$(UniversalCRTSdkDir)UnionMetadata\$(TargetPlatformVersion)</WindowsMetadataPath>

Perhaps we could also remove the trailing backslash from the registry value if that's possible and preferred to above.

Screenshots

Pic showing the registry value:
image

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Mar 12, 2020
@ranjeshj ranjeshj requested a review from llongley March 12, 2020 14:44
@ranjeshj ranjeshj added area-DevInternal Internal build infrastructure, code cleanup, engineering efficiency and removed needs-triage Issue needs to be triaged by the area owners labels Mar 12, 2020
@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@llongley
Copy link
Member

Thanks for making this fix! It looks good to me. :)

@ranjeshj
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ranjeshj ranjeshj merged commit ad4940b into microsoft:master Mar 13, 2020
@Felix-Dev Felix-Dev deleted the user/Felix-Dev/muxcontrolstestapp-winsdk-not-found-issue branch March 13, 2020 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DevInternal Internal build infrastructure, code cleanup, engineering efficiency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MUXControls.TestApp Interaction Tests fail to run if Windows SDK was installed in a custom location
4 participants