8000 bpo-38133: Allow py.exe launcher to locate installations from the Microsoft Store by zooba · Pull Request #16025 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-38133: Allow py.exe launcher to locate installations from the Microsoft Store #16025

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

Merged
merged 2 commits into from
Sep 12, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Avoid additional -32 suffix and reset data_size
  • Loading branch information
zooba committed Sep 12, 2019
commit 5192761911d65453d276eddeaedaf357efe2d6cf
9 changes: 9 additions & 0 deletions PC/launcher.c
Original file line number Diff line number Diff line change
Expand Up 7E0B @@ -278,6 +278,14 @@ _locate_pythons_for_key(HKEY root, LPCWSTR subkey, REGSAM flags, int bits,
else {
wcsncpy_s(ip->version, MAX_VERSION_SIZE, ip_version,
MAX_VERSION_SIZE-1);
/* Still treating version as "x.y" rather than sys.winver
* When PEP 514 tags are properly used, we shouldn't need
* to strip this off here.
*/
check = wcsrchr(ip->version, L'-');
if (check && !wcscmp(check, L"-32")) {
*check = L'\0';
}
_snwprintf_s(ip_path, IP_SIZE, _TRUNCATE,
L"%ls\\%ls\\InstallPath", subkey, ip_version);
status = RegOpenKeyExW(root, ip_path, 0, flags, &ip_key);
Expand All @@ -293,6 +301,7 @@ _locate_pythons_for_key(HKEY root, LPCWSTR subkey, REGSAM flags, int bits,
(LPBYTE)ip->executable, &data_size);
if (status != ERROR_SUCCESS || type != REG_SZ || !data_size) {
append_name = TRUE;
data_size = sizeof(ip->executable) - 1;
status = RegQueryValueExW(ip_key, NULL, NULL, &type,
(LPBYTE)ip->executable, &data_size);
if (status != ERROR_SUCCESS) {
Expand Down
0