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

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

Closed
diablodale opened this issue May 30, 2020 · 5 comments
Labels
Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase

Comments

@diablodale
Copy link

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
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 30, 2020
@diablodale
Copy link
Author

  • 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.

@DHowett
Copy link
Member

DHowett commented 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 DHowett closed this as completed May 30, 2020
@DHowett DHowett added Resolution-External For issues that are outside this codebase and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 30, 2020
@diablodale
Copy link
Author

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. microsoft/winget-cli#210

@zooba
Copy link
Member

zooba commented 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.

@diablodale
Copy link
Author

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Tag-Fix Doesn't match tag requirements Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

3 participants