Update install.sh

This commit is contained in:
Kroese 2024-04-28 20:08:25 +02:00 committed by GitHub
parent 9a72aa1982
commit 3465879141
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -166,9 +166,10 @@ detectCustom() {
getESD() {
local dir="$1"
local version="$2"
local winCatalog size
case "${VERSION,,}" in
case "${version,,}" in
"win11${PLATFORM,,}")
winCatalog="https://go.microsoft.com/fwlink?linkid=2156292"
;;
@ -176,7 +177,7 @@ getESD() {
winCatalog="https://go.microsoft.com/fwlink/?LinkId=841361"
;;
*)
error "Invalid version specified: $VERSION" && return 1
error "Invalid version specified: $version" && return 1
;;
esac
@ -267,55 +268,50 @@ downloadFile() {
downloadImage() {
local iso="$1"
local url="$2"
local version="$2"
local url=""
local rc desc
if [[ "$EXTERNAL" != [Yy1]* ]]; then
if [[ "${version,,}" != "http"* ]]; then
desc=$(printVersion "$VERSION" "Windows for ${PLATFORM}")
desc=$(printVersion "$version" "Windows for ${PLATFORM}")
else
url="$version"
desc=$(getName "$BASE" "$BASE")
fi
if [[ "$EXTERNAL" != [Yy1]* ]]; then
if [ -z "$url" ]; then
if isESD "$version"; then
getESD "$TMP/esd" "$version" && url="$ESD_URL"
if ! getESD "$TMP/esd"; then
url=""
else
url="$ESD_URL"
fi
fi
if [ -n "$url" ]; then
downloadFile "$iso" "$url" "$desc" && return 0
fi
[[ "$EXTERNAL" == [Yy1]* ]] && return 1
case "${VERSION,,}" in
"win11${PLATFORM,,}")
url="https://dl.bobpony.com/windows/11/en-us_windows_11_23h2_${PLATFORM,,}.iso"
;;
"win10${PLATFORM,,}")
url="https://dl.bobpony.com/windows/10/en-us_windows_10_22h2_${PLATFORM,,}.iso"
;;
*)
return 1
;;
esac
[[ "${version,,}" == "http"* ]] && return 1
url=$(getLink "$version")
if [ -z "$url" ]; then
! isESD "$version" && error "Invalid version specified: $version"
return 1
fi
info "Failed to download $desc from Microsoft, will try another mirror now..."
rm -rf "$TMP"
mkdir -p "$TMP"
ISO="$TMP/$BASE"
iso="$ISO"
rm -rf "$TMP"
mkdir -p "$TMP"
downloadFile "$iso" "$url" "$desc" && return 0
return 1