Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

List installed Win10 SDK's when looking for windows sdk tool#838

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
filmor merged 2 commits intopythonnet:masterfromOneBlue:use-available-win10-sdks
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsAUTHORS.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -55,6 +55,7 @@
- ([@civilx64](https://github.com/civilx64))
- ([@GSPP](https://github.com/GSPP))
- ([@omnicognate](https://github.com/omnicognate))
- ([@OneBlue](https://github.com/OneBlue))
- ([@rico-chet](https://github.com/rico-chet))
- ([@rmadsen-ks](https://github.com/rmadsen-ks))
- ([@stonebig](https://github.com/stonebig))
Expand Down
2 changes: 2 additions & 0 deletionsCHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].

## [unreleased][]

- Look for installed Windows 10 sdk's during installation instead of relying on specific versions.

### Added

- Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
Expand Down
29 changes: 27 additions & 2 deletionssetup.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,7 +39,7 @@
kits_root = "SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots"
kits_suffix = os.path.join("bin", ARCH)

WIN_SDK_KEYS =(
WIN_SDK_KEYS =[
RegKey(sdk_name="Windows Kit 10.0", key=kits_root,
value_name="KitsRoot10", suffix=os.path.join("bin", "10.0.16299.0", ARCH)),

Expand DownExpand Up@@ -69,7 +69,7 @@

RegKey(sdk_name="Windows SDK 6.0A", key=sdks_root.format("6.0A\\WinSDK"),
value_name="InstallationFolder", suffix=""),
)
]

VS_KEYS = (
RegKey(sdk_name="MSBuild 15", key=vs_root.format("15.0"),
Expand DownExpand Up@@ -145,6 +145,29 @@ def _update_xlat_devtools():
elif DEVTOOLS == "Mono":
DEVTOOLS = "dotnet"

def _collect_installed_windows_kits_v10(winreg):
"""Adds the installed Windows 10 kits to WIN_SDK_KEYS """
global WIN_SDK_KEYS
installed_kits = []

with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, kits_root, 0, winreg.KEY_READ) as key:
i = 0
while True:
try:
installed_kits.append(winreg.EnumKey(key, i))
i += 1
except WindowsError:
break

def make_reg_key(version):
return RegKey(sdk_name="Windows Kit 10.0", key=kits_root,
value_name="KitsRoot10", suffix=os.path.join("bin", version, ARCH))

WIN_SDK_KEYS += [make_reg_key(e) for e in installed_kits if e.startswith('10.')]

# Make sure this function won't be called again
_collect_installed_windows_kits_v10 = (lambda:None)

class BuildExtPythonnet(build_ext.build_ext):
user_options = build_ext.build_ext.user_options + [
('xplat', None, None)
Expand DownExpand Up@@ -367,6 +390,8 @@ def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False):
except ImportError: # PY3
import winreg

_collect_installed_windows_kits_v10(winreg)

keys_to_check = WIN_SDK_KEYS if use_windows_sdk else VS_KEYS
hklm = winreg.HKEY_LOCAL_MACHINE
for rkey in keys_to_check:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp