Skip to content
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

Add instructions for file association support #200

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

thejcannon
Copy link

This was the simplest solution, as it's just instructions for the user. Tested it out on my Windows 10 machine.

Alternate solutions would be:

  • Provide these in batch/powershell files for the user to run (unfortunately you can't substitute env vars in a .reg file, so that's out)
  • Add new command to pyenv itself to install these (makes uninstall much nicer I assume)

Additionally, some thought can be given in the future to support shebang lines, like the py launcher does, but until then 🤷‍♂️.

@thejcannon
Copy link
Author

Fixes #152

@thejcannon
Copy link
Author

I'll also add, I'm reasonably sure using the logo in this manner is safe under the Trademark Usage Policy: https://www.python.org/psf/trademarks/

@kirankotari kirankotari self-requested a review January 11, 2021 06:07
@bkeryan
Copy link

bkeryan commented Apr 13, 2021

Using REG_EXPAND_SZ to expand the environment variable also seems to work:

reg add "HKCR\Python.Pyenv\shell\open\command" /t REG_EXPAND_SZ /d "\"^%USERPROFILE^%\.pyenv\pyenv-win\shims\python.bat\" \"%1\""

@bkeryan
Copy link

bkeryan commented Apr 13, 2021

If you run the command at the command line, you need to use %1, but if you put it in a batch file, you need to use %%1 to escape the percent. Adding a caret ("^%1") doesn't seem to help.

@kirankotari
Copy link
Member

@thejcannon @bkeryan I am not very good in reg add so I need experts like you to test them and validate. If everything is good and it doesn't break or gives any errors. I am good to merge it.

@thejcannon
Copy link
Author

I actually no longer use Windows anymore, so I'll tap out.

@Spitfire1900
Copy link

I am very much on the side that this should be implemented as part of pyenv install itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants