Update install.sh

This commit is contained in:
Kroese 2024-05-26 20:09:50 +02:00 committed by GitHub
parent 81ed8665a6
commit fe80e1ade4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -484,6 +484,33 @@ setXML() {
return 0 return 0
} }
detectLegacy() {
local dir="$1"
local find find2 desc
find=$(find "$dir" -maxdepth 1 -type d -iname win98 | head -n 1)
if [ -n "$find" ]; then
DETECTED="win98"
desc=$(printEdition "$DETECTED" "Windows 98")
info "Detected: $desc"
return 0
fi
find=$(find "$dir" -maxdepth 1 -type d -iname win51 | head -n 1)
find2=$(find "$dir" -maxdepth 1 -type f -iname SETUPXP.HTM | head -n 1)
if [ -n "$find" ] || [ -n "$find2" ]; then
[ -d "$dir/AMD64" ] && DETECTED="winxpx64" || DETECTED="winxpx86"
desc=$(printEdition "$DETECTED" "Windows XP")
info "Detected: $desc"
return 0
fi
return 1
}
detectImage() { detectImage() {
local dir="$1" local dir="$1"
@ -514,24 +541,7 @@ detectImage() {
fi fi
info "Detecting version from ISO image..." info "Detecting version from ISO image..."
detectLegacy "$dir" && return 0
find=$(find "$dir" -maxdepth 1 -type d -iname win98 | head -n 1)
if [ -n "$find" ]; then
DETECTED="win98"
desc=$(printEdition "$DETECTED" "Windows 98")
info "Detected: $desc"
return 0
fi
find=$(find "$dir" -maxdepth 1 -type d -iname win51 | head -n 1)
if [ -n "$find" ] || [ -f "$dir/SETUPXP.HTM" ]; then
[ -d "$dir/AMD64" ] && DETECTED="winxpx64" || DETECTED="winxpx86"
desc=$(printEdition "$DETECTED" "Windows XP")
info "Detected: $desc"
return 0
fi
local src wim info local src wim info
src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1) src=$(find "$dir" -maxdepth 1 -type d -iname sources | head -n 1)