-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Update environment variables when changed #12689
Update environment variables when changed #12689
Conversation
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentcoc djsoref dogancelik Fody itsme mfreadwrite mfuuid Nefario nitroin null ulazyTo accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:dchristensen/PowerToys.git repository
If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to the Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally LGTM, I guess we are ok to use undocumented api in this case. what do you think @jaimecbernardo?
Regarding the undocumented API used in this PR: It seems to have been referred to on at least another Microsoft project, like https://github.com/microsoft/winfile/blob/799daab99e30b8835037bbf32069339f8e684b69/src/winfile.c#L917 On one hand, the API seems to have been around for long and I wouldn't expect it to break. @dedavis6797 @DHowett , what's the policy for PowerToys regarding use of private APIs such as this one? |
Unfortunately, we cannot take a dependency on a private API unless we get explicit permission from the team who owns it and, perhaps, a commitment to document it and make it public in the future. |
thanks @DHowett I'll update with an implementation that doesn't use the undocumented API |
Thanks, and thanks for the contribution to begin with! 😄 |
fb92715
to
8e053a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
Summary of the Pull Request
What is this about:
Update Launcher's environment variables when they are changed.
What is include in the PR:
How does someone test / validate:
%TEST_ENV_VAR%
(results should be empty)powershell.exe -c "[System.Environment]::SetEnvironmentVariable('TEST_ENV_VAR', 'C:\', [System.EnvironmentVariableTarget]::User)"
%TEST_ENV_VAR%
(should see a folder result now)Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.