fix(tray): inject execution-policy flags in shared PS launcher (#142)#184
Merged
Conversation
…S launcher (#142) launch_hidden_powershell only got safe stdio/CREATE_NO_WINDOW; only the updater separately passed -NonInteractive -ExecutionPolicy Bypass, so the uninstaller and toast launches could still fail on a stock machine's default Restricted execution policy. Inject the flags once in the shared helper (deduped if a caller already passes them) so every call site is covered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
launch_hidden_powershellwithCREATE_NO_WINDOW+DEVNULLstdio). The remaining gap: onlyupdater.pyalso passed-NonInteractive -ExecutionPolicy Bypass, so on a stock machine with the defaultRestrictedexecution policy the uninstaller's-Filelaunch and the toast-Commandlaunch could still fail.launch_hidden_powershell(src/plaud_tools/tray/process_launch.py) now injects-NonInteractive -ExecutionPolicy Bypassright afterargs[0]for every caller, deduped so a caller that already passes them (the updater, historically) doesn't get them twice.updater.py's_launch_updaterto stop passing the flags itself since the shared helper now guarantees them.Closes #142
Test plan
python -m pytest tests/test_process_launch.py tests/test_updater_launch.py -v— added two new tests (test_execution_policy_flags_injected_when_missing,test_execution_policy_flags_not_duplicated) confirming injection + dedupe; all passpython -m pytest -q— full suite, 1026 passed, 2 skippedruff check/mypyon changed files — clean🤖 Generated with Claude Code