{"action":"created","issue":{"url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/407","labels_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/407/labels{/name}","comments_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/407/comments","events_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/407/events","html_url":"https://github.com/CausalityLtd/ponyc/issues/407","id":118974044,"number":407,"title":"Older Windows SDK version picked","user":{"login":"Diltsman","id":12579752,"avatar_url":"https://avatars.githubusercontent.com/u/12579752?v=3","gravatar_id":"","url":"https://api.github.com/users/Diltsman","html_url":"https://github.com/Diltsman","followers_url":"https://api.github.com/users/Diltsman/followers","following_url":"https://api.github.com/users/Diltsman/following{/other_user}","gists_url":"https://api.github.com/users/Diltsman/gists{/gist_id}","starred_url":"https://api.github.com/users/Diltsman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diltsman/subscriptions","organizations_url":"https://api.github.com/users/Diltsman/orgs","repos_url":"https://api.github.com/users/Diltsman/repos","events_url":"https://api.github.com/users/Diltsman/events{/privacy}","received_events_url":"https://api.github.com/users/Diltsman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CausalityLtd/ponyc/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/CausalityLtd/ponyc/labels/easy","name":"easy","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-26T05:23:07Z","updated_at":"2015-11-26T13:24:36Z","closed_at":null,"body":"When Windows SDK version 10 is installed, pick_newest_sdk picks an older SDK.\r\n\r\nThe first problem is that the MAX_VER_LEN is too short.\r\n\r\nThe second problem is caused by the strncmp used to determine which SDK is newer.  Since the Windows 10 SDK starts with 10, it picks the Windows 8.1 SDK instead.\r\n\r\nThe ProductVersion value is described here: http://blogs.msdn.com/b/windowssdk/archive/2008/05/29/windows-sdk-registry-keys.aspx\r\n\r\nIt seems that the correct comparison would be to convert the ProductVersion registry key to four integers and then do the integer comparison.\r\n\r\nGiven that ProductVersion is always stored and referenced as a char array, I am uncertain how to go about this fix in the current code base and stay consistent."},"comment":{"url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/comments/159911163","html_url":"https://github.com/CausalityLtd/ponyc/issues/407#issuecomment-159911163","issue_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/407","id":159911163,"user":{"login":"andymcn","id":7050628,"avatar_url":"https://avatars.githubusercontent.com/u/7050628?v=3","gravatar_id":"","url":"https://api.github.com/users/andymcn","html_url":"https://github.com/andymcn","followers_url":"https://api.github.com/users/andymcn/followers","following_url":"https://api.github.com/users/andymcn/following{/other_user}","gists_url":"https://api.github.com/users/andymcn/gists{/gist_id}","starred_url":"https://api.github.com/users/andymcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andymcn/subscriptions","organizations_url":"https://api.github.com/users/andymcn/orgs","repos_url":"https://api.github.com/users/andymcn/repos","events_url":"https://api.github.com/users/andymcn/events{/privacy}","received_events_url":"https://api.github.com/users/andymcn/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T13:24:36Z","updated_at":"2015-11-26T13:24:36Z","body":"Increasing MAX_VER_LEN is trivial, but we are clearly doing the other stuff wrong.\r\n\r\nYes, we should split the product ID into the 4 integers. Note that the link above indicates that only the 3rd and 4th integers are actually used to determine the latest build, the first 2 are ignored.\r\n\r\nWe have to read ProductVersion out of the registry as a char array, and we need to keep the path we build out of it as a char array. But we should also convert to integers and store them for comparisons."}}