PowerToys: Missing user PATH env variables when launching IntelliJ Idea with PowerToys Run

Microsoft PowerToys version

0.60.1

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

  1. Uninstall and install PowerToys
  2. Launch Command Prompt with PowerToys Run
  3. Type echo %PATH%

✔️ Expected Behavior

Both user and system PATH environment variables are printed out just like when Command Prompt is launched with Start menu.

❌ Actual Behavior

Only system PATH environment variables are printed out. Restarting PowerToys after a fresh installation fixes this issue.

Other Software

Command Prompt

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

@headsvk, @crutkas It’s like I expected. The log contains the warnings and that means that PT starts with a set of environment variables that is different to what it should be:

[2022-07-21 17:13:32.4762] [INFO] [C:\a\_work\1\s\src\modules\launcher\PowerLauncher\MainWindow.xaml.cs::129]
Reload environment: Updating environment variables for PT Run's process

[2022-07-21 17:13:32.4762] [WARN] [C:\a\_work\1\s\src\modules\launcher\PowerLauncher\Helper\EnvironmentHelper.cs::138]
Skipping update of the environment variable [PSModulePath] for the PT Run process. This variable is listed as protected process variable and changing them can cause unexpected behavior. (The variable value has a length of [1].)

[2022-07-21 17:13:32.4762] [WARN] [C:\a\_work\1\s\src\modules\launcher\PowerLauncher\Helper\EnvironmentHelper.cs::138]
Skipping update of the environment variable [Path] for the PT Run process. This variable is listed as protected process variable and changing them can cause unexpected behavior. (The variable value has a length of [1197].)

[2022-07-21 17:13:32.4762] [INFO] [C:\a\_work\1\s\src\modules\launcher\Wox.Infrastructure\Stopwatch.cs::50]
EnvironmentHelper.UpdateEnvironment - Duration cost <5ms>

(I think all other variables were updated to the correct value.)

@yuyoyuppe Can you please check what the problem in WIX/Installer might be. I think PT’s process is created with an incorrect set of variables (see https://github.com/microsoft/PowerToys/issues/19532#issuecomment-1190547041) when starting from installer.

  1. Yes

I’ll check the rest tomorrow