fix: Image detection

This commit is contained in:
Kroese 2024-05-01 20:52:47 +02:00 committed by GitHub
parent 52581d5303
commit 9628a4c160
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -603,6 +603,7 @@ detectImage() {
warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1 warn "failed to locate 'install.wim' or 'install.esd' in ISO image, $FB" && return 1
fi fi
name2=""
tag="DISPLAYNAME" tag="DISPLAYNAME"
result=$(wimlib-imagex info -xml "$loc" | tr -d '\000') result=$(wimlib-imagex info -xml "$loc" | tr -d '\000')
name=$(sed -n "/$tag/{s/.*<$tag>\(.*\)<\/$tag>.*/\1/;p}" <<< "$result") name=$(sed -n "/$tag/{s/.*<$tag>\(.*\)<\/$tag>.*/\1/;p}" <<< "$result")
@ -612,13 +613,12 @@ detectImage() {
tag="PRODUCTNAME" tag="PRODUCTNAME"
name2=$(sed -n "/$tag/{s/.*<$tag>\(.*\)<\/$tag>.*/\1/;p}" <<< "$result") name2=$(sed -n "/$tag/{s/.*<$tag>\(.*\)<\/$tag>.*/\1/;p}" <<< "$result")
[ -z "$name" ] && name="$name2"
DETECTED=$(getVersion "$name2") DETECTED=$(getVersion "$name2")
fi fi
if [ -z "$DETECTED" ]; then if [ -z "$DETECTED" ]; then
warn "failed to determine Windows version from string '$name', $FB" && return 0 warn "failed to determine Windows version from displayname '$name' or productname '$name2' , $FB" && return 0
fi fi
desc=$(printVersion "$DETECTED" "$DETECTED") desc=$(printVersion "$DETECTED" "$DETECTED")