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