Created
October 28, 2015 04:37
-
-
Save itn3000/31111fcb994e32228ae4 to your computer and use it in GitHub Desktop.
get windows sdk directory from registry in msbuild test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Choose> | |
<!-- I could not find key of v8.1 in HKCU --> | |
<!-- if you want to support another SDK version,add When directive(Entry at the top will be priority) --> | |
<!-- for windows sdk 8.1A--> | |
<When Condition="'$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1A@InstallationFolder)' != ''"> | |
<PropertyGroup> | |
<MyWindowsSdkDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1A@InstallationFolder)</MyWindowsSdkDir> | |
</PropertyGroup> | |
</When> | |
<!-- for windows sdk 7.1--> | |
<When Condition="'$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1\@InstallationFolder)' != ''"> | |
<PropertyGroup> | |
<MyWindowsSdkDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1\@InstallationFolder)</MyWindowsSdkDir> | |
</PropertyGroup> | |
</When> | |
</Choose> | |
<Target Name="Build"> | |
<Message Text="windows sdk dir is $(MyWindowsSdkDir)"/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment