Skip to content

Commit eab76c3

Browse files
bpo-37734: Fix use of registry values to launch Python from Microsoft Store app (GH-15146)
(cherry picked from commit 1fab9cb) Co-authored-by: Steve Dower <[email protected]>
1 parent 1a3a40c commit eab76c3

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix use of registry values to launch Python from Microsoft Store app.

PC/layout/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,25 @@ def in_build(f, dest="", new_name=None):
153153
yield "libs/" + n + ".lib", lib
154154

155155
if ns.include_appxmanifest:
156+
yield from in_build("python_uwp.exe", new_name="python{}".format(VER_DOT))
157+
yield from in_build("pythonw_uwp.exe", new_name="pythonw{}".format(VER_DOT))
158+
# For backwards compatibility, but we don't reference these ourselves.
156159
yield from in_build("python_uwp.exe", new_name="python")
157160
yield from in_build("pythonw_uwp.exe", new_name="pythonw")
158161
else:
162+
yield from in_build("python.exe", new_name="python{}".format(VER_DOT))
163+
yield from in_build("pythonw.exe", new_name="pythonw{}".format(VER_DOT))
164+
# For backwards compatibility, but we don't reference these ourselves.
159165
yield from in_build("python.exe", new_name="python")
160166
yield from in_build("pythonw.exe", new_name="pythonw")
161167

162168
yield from in_build(PYTHON_DLL_NAME)
163169

164170
if ns.include_launchers and ns.include_appxmanifest:
165171
if ns.include_pip:
166-
yield from in_build("python_uwp.exe", new_name="pip")
172+
yield from in_build("python_uwp.exe", new_name="pip{}".format(VER_DOT))
167173
if ns.include_idle:
168-
yield from in_build("pythonw_uwp.exe", new_name="idle")
174+
yield from in_build("pythonw_uwp.exe", new_name="idle{}".format(VER_DOT))
169175

170176
if ns.include_stable:
171177
yield from in_build(PYTHON_STABLE_DLL_NAME)

PC/layout/support/appxmanifest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@
154154
"SysVersion": VER_DOT,
155155
"Version": "{}.{}.{}".format(VER_MAJOR, VER_MINOR, VER_MICRO),
156156
"InstallPath": {
157-
"": "[{AppVPackageRoot}]",
158-
"ExecutablePath": "[{AppVPackageRoot}]\\python.exe",
159-
"WindowedExecutablePath": "[{AppVPackageRoot}]\\pythonw.exe",
157+
"": "[{{AppVPackageRoot}}]",
158+
"ExecutablePath": "[{{AppVPackageRoot}}]\\python{}.exe".format(VER_DOT),
159+
"WindowedExecutablePath": "[{{AppVPackageRoot}}]\\pythonw{}.exe".format(VER_DOT),
160160
},
161161
"Help": {
162162
"Main Python Documentation": {
@@ -395,7 +395,7 @@ def get_appxmanifest(ns):
395395
ns,
396396
xml,
397397
"Python",
398-
"python",
398+
"python{}".format(VER_DOT),
399399
["python", "python{}".format(VER_MAJOR), "python{}".format(VER_DOT)],
400400
PYTHON_VE_DATA,
401401
"console",
@@ -406,7 +406,7 @@ def get_appxmanifest(ns):
406406
ns,
407407
xml,
408408
"PythonW",
409-
"pythonw",
409+
"pythonw{}".format(VER_DOT),
410410
["pythonw", "pythonw{}".format(VER_MAJOR), "pythonw{}".format(VER_DOT)],
411411
PYTHONW_VE_DATA,
412412
"windows",
@@ -418,7 +418,7 @@ def get_appxmanifest(ns):
418418
ns,
419419
xml,
420420
"Pip",
421-
"pip",
421+
"pip{}".format(VER_DOT),
422422
["pip", "pip{}".format(VER_MAJOR), "pip{}".format(VER_DOT)],
423423
PIP_VE_DATA,
424424
"console",
@@ -430,7 +430,7 @@ def get_appxmanifest(ns):
430430
ns,
431431
xml,
432432
"Idle",
433-
"idle",
433+
"idle{}".format(VER_DOT),
434434
["idle", "idle{}".format(VER_MAJOR), "idle{}".format(VER_DOT)],
435435
IDLE_VE_DATA,
436436
"windows",

0 commit comments

Comments
 (0)