From 8126cdfd099d19064e8c9beb70f1917463b116bf Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 30 Apr 2024 14:23:52 +0200 Subject: [PATCH] Update install.sh --- src/install.sh | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/src/install.sh b/src/install.sh index 1a2ee5a..75a846a 100644 --- a/src/install.sh +++ b/src/install.sh @@ -53,10 +53,10 @@ finishInstall() { if [[ "${PLATFORM,,}" == "x64" ]]; then if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then + echo "$BOOT_MODE" > "$STORAGE/windows.mode" if [[ "${MACHINE,,}" != "q35" ]]; then echo "$MACHINE" > "$STORAGE/windows.old" fi - echo "$BOOT_MODE" > "$STORAGE/windows.mode" else # Enable secure boot + TPM on manual installs as Win11 requires if [[ "$MANUAL" == [Yy1]* ]] || [[ "$aborted" == [Yy1]* ]]; then @@ -102,18 +102,14 @@ startInstall() { CUSTOM="" - if [[ "${VERSION,,}" == "http"* ]]; then - EXTERNAL="Y" - else + if [[ "${VERSION,,}" != "http"* ]]; then + EXTERNAL="N" - fi - - if [[ "$EXTERNAL" != [Yy1]* ]]; then - BASE="$VERSION.iso" else + EXTERNAL="Y" BASE=$(basename "${VERSION%%\?*}") : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') @@ -297,9 +293,11 @@ downloadFile() { progress="--progress=dot:giga" fi + local msg="Downloading $desc..." + domain=$(echo "$url" | awk -F/ '{print $3}') domain=$(expr match "$domain" '.*\.\(.*\..*\)') - local msg="Downloading $desc from $domain..." + [[ "${domain,,}" != *"microsoft.com" ]] && msg="Downloading $desc from $domain..." info "$msg" && html "$msg" /run/progress.sh "$iso" "Downloading $desc ([P])..." & @@ -355,24 +353,20 @@ downloadImage() { if isESD "$version"; then - [[ "$tried" != "n" ]] && info "Failed to download $desc using Mido, will try a different method now..." - - ISO="$TMP/$version.esd" - iso="$ISO" - rm -rf "$TMP" - mkdir -p "$TMP" + if [[ "$tried" != "n" ]]; then + info "Failed to download $desc using Mido, will try a diferent method now..." + fi tried="y" if getESD "$TMP/esd" "$version"; then - downloadFile "$iso" "$ESD_URL" "$desc" && return 0 + ISO="$TMP/$version.esd" + downloadFile "$ISO" "$ESD_URL" "$desc" && return 0 + ISO="$TMP/$BASE" fi fi - ISO="$TMP/$BASE" - iso="$ISO" - url=$(getLink "$version") if [ -n "$url" ]; then @@ -382,9 +376,6 @@ downloadImage() { fi tried="y" - rm -rf "$TMP" - mkdir -p "$TMP" - downloadFile "$iso" "$url" "$desc" && return 0 fi @@ -398,9 +389,6 @@ downloadImage() { fi tried="y" - rm -rf "$TMP" - mkdir -p "$TMP" - downloadFile "$iso" "$url" "$desc" && return 0 fi