Skip to content

Commit

Permalink
win: more robust parsing of SDK version
Browse files Browse the repository at this point in the history
PR-URL: #1198
Fixes: #1179
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: João Reis <[email protected]>
  • Loading branch information
refack committed May 17, 2017
1 parent 241752f commit bad903a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/Find-VS2017.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,12 @@ private static bool CheckInstance(ISetupInstance2 setupInstance2, ref StringBuil
hasMSBuild = true;
else if (id == "Microsoft.VisualStudio.Component.VC.Tools.x86.x64")
hasVCTools = true;
else if (id.StartsWith(Win10SDKPrefix))
Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(id.Substring(Win10SDKPrefix.Length)));
else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
else if (id.StartsWith(Win10SDKPrefix)) {
string[] parts = id.Substring(Win10SDKPrefix.Length).Split('.');
if (parts.Length > 1 && parts[1] != "Desktop")
continue;
Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0]));
} else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
hasWin8SDK = true;
else
continue;
Expand Down

0 comments on commit bad903a

Please sign in to comment.