lextm / windowsterminal-shell

Install/uninstall scripts for Windows Terminal context menu items
MIT License
1.67k stars 149 forks source link

Preview flag doesnt work properly #48

Open Cynosphere opened 3 years ago

Cynosphere commented 3 years ago
.\install.ps1 -PreRelease
Use Default layout.
Found Windows Terminal version 1.0.1401.0.
Found Windows Terminal version 1.6.10571.0.
Found Windows Terminal version 1.6.10412.0.
Found Windows Terminal version 1.7.572.0.
Found actual executable C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.7.572.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe.
WARNING: Didn't find icon for profile .
CreateMenuItem: D:\Downloads\install.ps1:371
Line |
 371 |          CreateMenuItem $rootKey $name $profileIcon $command $false
     |                                  ~~~~~
     | Cannot bind argument to parameter 'name' because it is an empty string.

CreateMenuItem: D:\Downloads\install.ps1:372
Line |
 372 |          CreateMenuItem $rootKeyElevated $name $profileIcon $elevated  …
     |                                          ~~~~~
     | Cannot bind argument to parameter 'name' because it is an empty string.

Windows Terminal installed to Windows Explorer context menu.

It only gave me options for the normal build along with erroring

Cynosphere commented 3 years ago

Apparently I had an empty object in my profile list causing the error. It still doesn't link to Preview when creating menu objects though.

Cynosphere commented 3 years ago

https://github.com/lextm/windowsterminal-shell/blob/8c45921d0395e32f13c66f16daa1da2a6ec0d80f/install.ps1#L459 This should refer to Microsoft.WindowsTerminal(Preview)_8wekyb3d8bbwe\wt.exe instead, depending on $PreRelease or not.

lextm commented 3 years ago

More investigation is needed before this item can be worked on,

  1. Cannot find Microsoft.WindowsTerminal(Preview)_8wekyb3d8bbwe\wt.exe on my machine. It seems to be $Env:LOCALAPPDATA\Microsoft\WindowsApps\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\wt.exe.
  2. On my machine $Env:LOCALAPPDATA\Microsoft\WindowsApps\wt.exe is associated with the preview version. So it seems that this shortcut is not a reliable one and should be changed anyway.

Once investigation is done, we might ship a new version.