microsoft / microsoft/terminal

[MSIX Bucket] Launch issues caused by bad permissions on WindowsApps, and others

Open
#9,452 12 comments 0 reactions 0 assignees View on GitHub
Culprit-Centennial Issue-Bug Issue-Scenario Needs-Tag-Fix Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

There is a class of issues whose root cause _seems_ to be bad permissions on `C:\Program Files\WindowsApps`.

* `wt.exe` can launch the "wrong" copy of Terminal without user settings
* **DIFFERENTIAL DIAGNOSTIC** The version number switches between (example) `1.7.1991` and `1.7.210451004-release1.7`
* error `0xc0000022` on launch (#9399)

**REPORTERS**: If you have one of these issues, can you share the output of `icacls "C:\Program Files\WindowsApps"` (from an admin shell?)

Correct WindowsApps permissions

```
\Program Files\WindowsApps NT SERVICE\TrustedInstaller:(F)
NT SERVICE\TrustedInstaller:(OI)(CI)(IO)(F)
S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(RX)
S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204:(OI)(CI)(IO)(GR,GE)
NT AUTHORITY\SYSTEM:(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
BUILTIN\Administrators:(CI)(RX)
NT AUTHORITY\LOCAL SERVICE:(OI)(CI)(RX)
NT AUTHORITY\NETWORK SERVICE:(OI)(CI)(RX)
NT AUTHORITY\RESTRICTED:(OI)(CI)(RX)
BUILTIN\Users:(Rc,S,RD,REA,X,RA)
```

----

zadjii-msft notes circa 2023-09-06:

There's a collection of "crash on startup" issues which started around 1.16. They're all in the neighborhood of `Cannot_create_instance_of_type__Microsoft.UI.Xaml.Controls.XamlControlsResources` or `winrt::impl::consume_Windows_ApplicationModel_IPackageStatics_winrt::Windows::ApplicationModel::IPackageStatics_::Current`, depending on how the exception was handled. More notes in:

* https://github.com/microsoft/terminal/issues/15583#issuecomment-1708760392 (collected notes, resolution steps)
* https://github.com/microsoft/terminal/issues/15583#issuecomment-1708641554 (x-links a bunch of bugs)
* https://github.com/microsoft/terminal/issues/15526#issuecomment-1708635865 (another couple dupes)
* https://github.com/microsoft/terminal/issues/14961#issuecomment-1461141118 (an early analysis)

Contributor guide

Open the contributing guide

Research direction

Start with the collected notes and resolution steps in issue #15583, then compare the reported `icacls "C:\Program Files\WindowsApps"` output with the permissions shown here. Use the listed launch symptoms and exception names as diagnostic entry points; done means establishing whether the ACLs explain the failures and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.