Skip to content

Windows Installer - modify PATHEXT when system-wide launcher is installed #100587

@oldium

Description

@oldium

Feature or enhancement

Modify the PATHEXT variable on Windows Installer when the system-wide launcher py.exe is installed.

Pitch

I had an issue with executing the Python scripts from the PowerShell console - the script always opened a new console window. When I wrote .\script.py in Command Prompt (cmd.exe), it was executed in the same window, but in PowerShell console a new window was always opened. It used file association "C:\WINDOWS\py.exe" "%L" %* and when I tried to run it directly (py.exe .\script.py), it was executed in the same window even in PowerShell console. I reported it to PowerShell guys, and they recommended to set PATHEXT to add ;.PY at the end. So, I did it and the Python script started to run correctly in the same console window.

I checked the installer documentation and there is a note that you need to check Add Python to PATH, which I did not have checked (I am happy with how py.exe works). I just have the system-wide launcher installed. So I think it makes sense to modify PATHEXT when the system-wide launcher is installed, not only when the PATH is modified.

Previous discussion

I asked on discuss.python.org and it was advised by Steve Dower to report it here to track the idea.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions