1
0
mirror of https://github.com/mintty/wsltty.git synced 2025-09-18 03:02:25 +01: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

View File

@@ -129,16 +129,19 @@ do
basepath=`regtool get "$lxss/$guid/BasePath"` basepath=`regtool get "$lxss/$guid/BasePath"`
if package=`regtool -q get "$lxss/$guid/PackageFamilyName"` if package=`regtool -q get "$lxss/$guid/PackageFamilyName"`
then then
instdir=`regtool get "$schema/$package/Schemas/PackageFullName"` 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
else icon="%LOCALAPPDATA%/wsltty/wsl.ico" manifest="$ProgramW6432/WindowsApps/$instdir/AppxManifest.xml"
fi psh_cmd='([xml]$(Get-Content '"\"$manifest\""')).Package.Applications.Application.Executable'
root="$basepath/rootfs" executable=`powershell "$psh_cmd"`
else
icon="%LOCALAPPDATA%/lxss/bash.ico" # remove trailing newline that above command introduces
root="$basepath" executable="${executable%"${executable##*[![:space:]]}"}"
fi if [ -r "$ProgramW6432/WindowsApps/$instdir/$executable" ]
then icon="%PROGRAMFILES%\\WindowsApps\\$instdir\\$executable"
else icon="%LOCALAPPDATA%/wsltty/wsl.ico"
fi
minttyargs='--wsl --rootfs="'"$root"'" --configdir="%APPDATA%\wsltty" -o Locale=C -o Charset=UTF-8 /bin/wslbridge ' minttyargs='--wsl --rootfs="'"$root"'" --configdir="%APPDATA%\wsltty" -o Locale=C -o Charset=UTF-8 /bin/wslbridge '
minttyargs='--WSL="'"$distro"'" --configdir="%APPDATA%\wsltty"' minttyargs='--WSL="'"$distro"'" --configdir="%APPDATA%\wsltty"'