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

Merge pull request #111 from caksoylar/patch-1

use icon from exe if determined from manifest
This commit is contained in:
mintty 2019-05-28 22:30:26 +02:00 committed by GitHub
commit bac370cfce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,17 @@ config () {
if package=`regtool -q get "$lxss/$guid/PackageFamilyName"`
then
instdir=`regtool get "$schema/$package/Schemas/PackageFullName"`
if [ -r "$ProgramW6432/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"
elif [ -r "$ProgramW6432/WindowsApps/$instdir/images/icon.ico" ]
then icon="%PROGRAMFILES%/WindowsApps/$instdir/images/icon.ico"
else icon="$installdir"'\wsl.ico'
fi