bpo-30374: Fixed several bugs in win_add2path.py by XDcsy · Pull Request #1594 · python/cpython (original) (raw)

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

Already on GitHub?Sign in to your account

Conversation1 Commits5 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

XDcsy

@XDcsy

The current script needs you to log off and then log back on to take effect. Now it takes effect immediately by broadcasting a WM_SETTINGCHANG message after the change of environment variables.

@AraHaan

Or just have the installer use an statically linked editenv library to do it all for you. That is what I do with my own pthmgr project at https://github.com/DecoraterBot-devs/pthmgr.

Although if my 'pthmgr' was part of Windows it would help with the installer and so then the installer would call the program I made. Yes, it is made using C++ and requires administrator to use but it works and broadcasts it anyway. However no version of Windows ship it and I am wiling to give the project to Microsoft or the PSF as well. However there is yet to find a way for it to hack any running instances of cmd.exe or powershell that would update the path on them without restarting it similar to how you can on Linux. If someone has an idea on that that does not require an dll injection to them to do it would help with it a lot.

@XDcsy

@XDcsy XDcsy changed the titlebpo-30374: Refresh environment variables after adding Python to PATH bpo-30374: Fixed several bugs in win_add2path.py

May 16, 2017

@XDcsy

If the type is REG_SZ, the %APPDATA%... path will not be added and the absolute path will be added instead.

@XDcsy

@XDcsy

2 participants

@XDcsy @AraHaan