store installer sets wrong path, as literal ';%USERPROFILE%\AppData\Local\Microsoft\WindowsApps` #8683

Closed
opened 2026-01-31 01:35:25 +00:00 by claunia · 5 comments
Owner

Originally created by @diablodale on GitHub (May 30, 2020).

Windows store installer for v1.0.1401.0 appends wrong value to path. Therefore, it is not possible to run wt.exe from windowskey-R, cmd prompt, or anything else that needs to find it on the path.

Environment

  • Microsoft Windows [Version 10.0.19041.264]
  • Absolutely never before had Windows Terminal installed
  • Windows Terminal v1.0.1401.0 from Windows Store

Steps to reproduce

  1. Install Windows
  2. Windows Terminal v1.0.1401.0 from Windows Store
  3. Press windowskey-R to get quick run prompt
  4. Type wt.exe

Expected behavior

Windows Terminal to run

Actual behavior

Error. Windows cannot find wt.exe
image

I checked my path at cmd prompt. The following is a cut/paste. Notice the last entry, two semicolons and then a env variable not expanded. And with that unexpanded directory not evaluated in the path, naturally wt.exe will not be found by windowskey-R or typing wt.exe at a legacy command prompt.

C:\Users\dale>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0\;C:\Program Files\Microsoft VS Code\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft VS Code\bin;C:\Users\dale\.flutter\bin;C:\Users\dale\.cargo\bin;C:\Program Files\Android\android-studio-preview\jre\bin;C:\njs\wslgit;C:\njs;C:\Program Files\CMake\bin;;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
Originally created by @diablodale on GitHub (May 30, 2020). Windows store installer for v1.0.1401.0 appends wrong value to path. Therefore, it is not possible to run `wt.exe` from windowskey-R, cmd prompt, or anything else that needs to find it on the path. # Environment * Microsoft Windows [Version 10.0.19041.264] * Absolutely never before had Windows Terminal installed * Windows Terminal v1.0.1401.0 from Windows Store # Steps to reproduce 1. Install Windows 2. Windows Terminal v1.0.1401.0 from Windows Store 3. Press windowskey-R to get quick run prompt 4. Type `wt.exe` # Expected behavior Windows Terminal to run # Actual behavior Error. Windows cannot find wt.exe ![image](https://user-images.githubusercontent.com/679350/83316813-7d221a80-a228-11ea-95a1-5c138e93399d.png) I checked my path at cmd prompt. The following is a cut/paste. Notice the last entry, two semicolons and then a env variable not expanded. And with that unexpanded directory not evaluated in the path, naturally wt.exe will not be found by windowskey-R or typing `wt.exe` at a legacy command prompt. ``` C:\Users\dale>path PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0\;C:\Program Files\Microsoft VS Code\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft VS Code\bin;C:\Users\dale\.flutter\bin;C:\Users\dale\.cargo\bin;C:\Program Files\Android\android-studio-preview\jre\bin;C:\njs\wslgit;C:\njs;C:\Program Files\CMake\bin;;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps ```
claunia added the Resolution-ExternalNeeds-Tag-Fix labels 2026-01-31 01:35:25 +00:00
Author
Owner

@diablodale commented on GitHub (May 30, 2020):

  • the Windows Terminal execution alias is present and turned on. This was its state after install, I made no changes.
  • C:\Users\dale\AppData\Local\Microsoft\WindowsApps\wt.exe is present and I can run it successfully if I use the full path at a prompt or windowskey-R.
@diablodale commented on GitHub (May 30, 2020): * the Windows Terminal execution alias is present and turned on. This was its state after install, I made no changes. * `C:\Users\dale\AppData\Local\Microsoft\WindowsApps\wt.exe` is present and I can run it successfully if I use the full path at a prompt or windowskey-R.
Author
Owner

@DHowett commented on GitHub (May 30, 2020):

This can happen if the type of your PATH environment variable in the registry has changed from REG_EXPAND_SZ to REG_SZ. Unfortunately, since we don’t have control over how exactly the store installs us, there’s nothing Terminal can do to fix it.

@DHowett commented on GitHub (May 30, 2020): This can happen if the type of your PATH environment variable in the registry has changed from `REG_EXPAND_SZ` to `REG_SZ`. Unfortunately, since we don’t have control over _how_ exactly the store installs us, there’s nothing Terminal can do to fix it.
Author
Owner

@diablodale commented on GitHub (May 30, 2020):

Hi, it is true my HKEY_CURRENT_USER\Environment key has a value Path with a type of REG_SZ.

This installation bug with store/centennial/appx is I think related to the appExecutionAlias and how it is managed with the installer, store, and Win10.

winget is experiencing the same problem. https://github.com/microsoft/winget-cli/issues/210

@diablodale commented on GitHub (May 30, 2020): Hi, it is true my `HKEY_CURRENT_USER\Environment` key has a value `Path` with a type of REG_SZ. This installation bug with store/centennial/appx is I think related to the `appExecutionAlias` and how it is managed with the installer, store, and Win10. winget is experiencing the same problem. https://github.com/microsoft/winget-cli/issues/210
Author
Owner

@zooba commented on GitHub (Jun 2, 2020):

This will be due to a third-party installer (and you've got quite a lot of options to choose from in the OP!). I've been tracking issues like this for a while, as they affect the Centennial package of Python.

Windows adds the PATH entry itself - it's part of your default user profile, and nothing to do with any particular APPX installer or even the Store.

@zooba commented on GitHub (Jun 2, 2020): This will be due to a third-party installer (and you've got quite a lot of options to choose from in the OP!). I've been tracking issues like this for a while, as they affect the Centennial package of Python. Windows adds the PATH entry itself - it's part of your default user profile, and nothing to do with any particular APPX installer or even the Store.
Author
Owner

@diablodale commented on GitHub (Jun 2, 2020):

Naturally, anything with write access (has nothing to do with an installer) to HKEY_CURRENT_USER\Environment key and value Path can change it from REG_EXPAND_SZ to REG_SZ.

I think it is reasonable for the infrastructure (Microsoft Store + Windows) to correctly check/set/install all needed dependencies when an app is installed via that store. Therefore...

  1. Since app aliases are part of the app's install
  2. App alias functionality depends on PATH being correctly configured to %USERPROFILE%\AppData\Local\Microsoft\WindowsApps

That would require the dependency of app aliases to do at a minimum

  1. make the alias in %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
  2. ensure the PATH includes %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
  3. ensure the PATH is REG_EXPAND_SZ. When it is only REG_SZ, then do the needed re/write of path back to REG_EXPAND_SZ

Seems to me the dependency handing of (Microsoft Store + Windows) is not doing steps 2 and 3.
If the dependency handling is updated then it allows much...

  1. Bugs like this issue go away
  2. When something else changes REG_EXPAND_SZ to REG_SZ at any time, then one or more aliases will fail. However, then the user can use the standard Windows App->Repair/Reset. Since the improved dependency handling will include steps 2 and 3 above...and therefore fix the registry key back to REG_EXPAND_SZ
@diablodale commented on GitHub (Jun 2, 2020): Naturally, anything with write access (has nothing to do with an installer) to `HKEY_CURRENT_USER\Environment` key and value `Path` can change it from `REG_EXPAND_SZ` to `REG_SZ`. I think it is reasonable for the infrastructure `(Microsoft Store + Windows)` to correctly check/set/install all needed dependencies when an app is installed via that store. Therefore... 1. Since app aliases are part of the app's install 2. App alias functionality depends on `PATH` being correctly configured to `%USERPROFILE%\AppData\Local\Microsoft\WindowsApps` That would require the dependency of app aliases to do at a minimum 1. make the alias in `%USERPROFILE%\AppData\Local\Microsoft\WindowsApps` 2. ensure the `PATH` includes `%USERPROFILE%\AppData\Local\Microsoft\WindowsApps` 3. ensure the `PATH` is `REG_EXPAND_SZ`. When it is only `REG_SZ`, then do the needed re/write of path back to `REG_EXPAND_SZ` Seems to me the dependency handing of `(Microsoft Store + Windows)` is not doing steps 2 and 3. If the dependency handling is updated then it allows much... 1. Bugs like this issue go away 2. When something else changes `REG_EXPAND_SZ` to `REG_SZ` at any time, then one or more aliases will fail. However, then the user can use the standard Windows App->Repair/Reset. Since the improved dependency handling will include steps 2 and 3 above...and therefore fix the registry key back to `REG_EXPAND_SZ`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8683