]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: Treat Windows Store's "app execution aliases" as symbolic links
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 22 Mar 2021 15:51:41 +0000 (16:51 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 23 Mar 2021 15:54:37 +0000 (16:54 +0100)
commit0631c6644e6398c051dcda1a53c0fc0e40c814a3
tree1599f4a2e0786ea7ecccc17d3e8ab5af9f1146d3
parent2533912fc76c08af9e386a371fc6b3eb194d56be
Cygwin: Treat Windows Store's "app execution aliases" as symbolic links

When the Windows Store version of Python is installed, so-called "app
execution aliases" are put into the `PATH`. These are reparse points
under the hood, with an undocumented format.

We do know a bit about this format, though, as per the excellent analysis:
https://www.tiraniddo.dev/2019/09/overview-of-windows-execution-aliases.html

The first 4 bytes is the reparse tag, in this case it's
0x8000001B which is documented in the Windows SDK as
IO_REPARSE_TAG_APPEXECLINK. Unfortunately there doesn't seem to
be a corresponding structure, but with a bit of reverse
engineering we can work out the format is as follows:

Version: <4 byte integer>
Package ID: <NUL Terminated Unicode String>
Entry Point: <NUL Terminated Unicode String>
Executable: <NUL Terminated Unicode String>
Application Type: <NUL Terminated Unicode String>

Let's treat them as symbolic links. For example, in this developer's
setup, this will result in the following nice output:

$ cd $LOCALAPPDATA/Microsoft/WindowsApps/

$ ls -l python3.exe
lrwxrwxrwx 1 me 4096 105 Aug 23  2020 python3.exe -> '/c/Program Files/WindowsApps/PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0/python.exe'

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
winsup/cygwin/path.cc
This page took 0.029925 seconds and 5 git commands to generate.