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:
parent
26a1abb148
commit
52b03a43d9
@ -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"'
|
||||
|
Loading…
x
Reference in New Issue
Block a user