1
0
mirror of https://github.com/mintty/wsltty.git synced 2025-01-18 20:10:58 +00:00

Fix missing icons for distros

Instead of looking for `images\icon.ico` in `$instdir` for each distro, instead check inside AppxManifest.xml for the executable name and point to it for the shortcut icon as suggested in https://github.com/mintty/wsltty/issues/110#issuecomment-395999015.
This commit is contained in:
C Aksoylar 2018-06-10 11:35:20 -07:00 committed by GitHub
parent 26a1abb148
commit 52b03a43d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,15 +130,18 @@ do
if package=`regtool -q get "$lxss/$guid/PackageFamilyName"`
then
instdir=`regtool get "$schema/$package/Schemas/PackageFullName"`
if [ -r "$ProgramW6432/WindowsApps/$instdir/images/icon.ico" ]
then icon="%PROGRAMFILES%/WindowsApps/$instdir/images/icon.ico"
# get actual executable path (may not match $distro) from the app manifest
manifest="$ProgramW6432/WindowsApps/$instdir/AppxManifest.xml"
psh_cmd='([xml]$(Get-Content '"\"$manifest\""')).Package.Applications.Application.Executable'
executable=`powershell "$psh_cmd"`
# remove trailing newline that above command introduces
executable="${executable%"${executable##*[![:space:]]}"}"
if [ -r "$ProgramW6432/WindowsApps/$instdir/$executable" ]
then icon="%PROGRAMFILES%\\WindowsApps\\$instdir\\$executable"
else icon="%LOCALAPPDATA%/wsltty/wsl.ico"
fi
root="$basepath/rootfs"
else
icon="%LOCALAPPDATA%/lxss/bash.ico"
root="$basepath"
fi
minttyargs='--wsl --rootfs="'"$root"'" --configdir="%APPDATA%\wsltty" -o Locale=C -o Charset=UTF-8 /bin/wslbridge '
minttyargs='--WSL="'"$distro"'" --configdir="%APPDATA%\wsltty"'