Skip to content

Permission Error on all App Execution Aliases in git-bash #2675

@KyleMit

Description

@KyleMit
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

    $ git --version --build-options
    
    git version 2.25.1.windows.1
    cpu: x86_64
    built from commit: cceb69da75b4906bb04cfb3a2f7f37b12b985ec3
    sizeof-long: 4
    sizeof-size_t: 8
    
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

    $ cmd.exe /c ver
    
    Microsoft Windows [Version 10.0.18363.836]
    (c) 2019 Microsoft Corporation. All rights reserved.
    
  • What options did you set as part of the installation? Or did you choose the
    defaults?

    # One of the following:
    > type "C:\Program Files\Git\etc\install-options.txt"
    $ cat /etc/install-options.txt
    
    Editor Option: VisualStudioCode
    Custom Editor Path: 
    Path Option: Cmd
    SSH Option: OpenSSH
    Tortoise Option: false
    CURL Option: OpenSSL
    CRLF Option: CRLFAlways
    Bash Terminal Option: MinTTY
    Performance Tweaks FSCache: Enabled
    Use Credential Manager: Enabled
    Enable Symlinks: Disabled
    
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

    Issue should be reproducible in a wide variety of environments

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

    Bash

  • What commands did you run to trigger this issue? If you can provide a Minimal, Complete, and Verifiable example this will help us understand the issue.

    1. Install Git-Bash

    2. Install WinGet

    3. Run Command:

      winget --version
  • What did you expect to occur after running these commands?

    v0.1.41331 Preview
    
  • What actually happened instead?

    bash: /c/Users/kylemit/AppData/Local/Microsoft/WindowsApps/winget: Permission denied
    
  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

    n/a

More Info

There is a problem with all app execution aliases on Windows 10 for apps installed via the Windows Store inside of git-bash. This issue is specific to git-bash (i'm not sure if there is a separate repo to handle terminal issues).

image

They are located in a folder under the user's local data here:

%LocalAppData%\Microsoft\WindowsApps\

WindowsApps

Which just contains 0 byte executables that act as shortcuts (or maybe symlinks?) to the actual executables found in this directory:

C:\Program Files\WindowsApps\

While this directory appears highly locked down, such that an administrator cannot even open it, it appears to allow traversal rights so you can actually open the apps themselves inside of subfolders (provided you have a way to discover the path... process > details > open file location) like this:

C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe

For many executables, a possible workaround is to install the software directly and disable the link to the Windows Store. However, this is not possible for apps deployed exclusively through the windows store like WindowsTerminal and WinGet

Here's an example in bash vs cmd:

winget in bash vs command

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions