mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 19:55:49 +00:00
Update install.sh
This commit is contained in:
parent
04441a2818
commit
ea39a3eafd
1 changed files with 27 additions and 37 deletions
|
|
@ -177,9 +177,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"
|
||||||
;;
|
;;
|
||||||
|
|
@ -187,7 +188,7 @@ getESD() {
|
||||||
winCatalog="https://go.microsoft.com/fwlink/?LinkId=841361"
|
winCatalog="https://go.microsoft.com/fwlink/?LinkId=841361"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
error "Invalid ESD version specified: $VERSION" && return 1
|
error "Invalid ESD version specified: $version" && return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
@ -242,7 +243,7 @@ getESD() {
|
||||||
doMido() {
|
doMido() {
|
||||||
|
|
||||||
local iso="$1"
|
local iso="$1"
|
||||||
local url="$2"
|
local version="$2"
|
||||||
local desc="$3"
|
local desc="$3"
|
||||||
local rc
|
local rc
|
||||||
|
|
||||||
|
|
@ -254,7 +255,7 @@ doMido() {
|
||||||
/run/progress.sh "$iso.PART" "Downloading $desc ([P])..." &
|
/run/progress.sh "$iso.PART" "Downloading $desc ([P])..." &
|
||||||
|
|
||||||
cd "$TMP"
|
cd "$TMP"
|
||||||
{ /run/mido.sh "$url"; rc=$?; } || :
|
{ /run/mido.sh "${version,,}"; rc=$?; } || :
|
||||||
cd /run
|
cd /run
|
||||||
|
|
||||||
fKill "progress.sh"
|
fKill "progress.sh"
|
||||||
|
|
@ -310,39 +311,37 @@ 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")
|
desc=$(printVersion "$version" "Windows")
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
url="$version"
|
||||||
desc=$(getName "$BASE" "$BASE")
|
desc=$(getName "$BASE" "$BASE")
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$EXTERNAL" != [Yy1]* ]]; then
|
if [ -z "$url" ]; then
|
||||||
|
|
||||||
doMido "$iso" "$url" "$desc" && return 0
|
doMido "$iso" "$version" "$desc" && return 0
|
||||||
|
|
||||||
if [[ "$VERSION" != "win10${PLATFORM,,}" ]] && [[ "$VERSION" != "win11${PLATFORM,,}" ]]; then
|
if [[ "${version,,}" == "win10${PLATFORM,,}" ]] || [[ "$version" == "win11${PLATFORM,,}" ]]; then
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
info "Failed to download $desc using Mido, will try a different method now..."
|
info "Failed to download $desc using Mido, will try a different method now..."
|
||||||
|
|
||||||
rm -rf "$TMP"
|
ISO="$TMP/$version.esd"
|
||||||
mkdir -p "$TMP"
|
iso="$ISO"
|
||||||
|
|
||||||
ISO="$TMP/$VERSION.esd"
|
rm -rf "$TMP"
|
||||||
iso="$ISO"
|
mkdir -p "$TMP"
|
||||||
|
|
||||||
|
getESD "$TMP/esd" "$version" && url="$ESD_URL"
|
||||||
|
|
||||||
if ! getESD "$TMP/esd"; then
|
|
||||||
url=""
|
|
||||||
else
|
|
||||||
url="$ESD_URL"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
@ -351,28 +350,19 @@ downloadImage() {
|
||||||
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
|
|
||||||
"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
|
|
||||||
|
|
||||||
|
url=$(getLink "$version")
|
||||||
|
[ -z "$url" ] && return 1
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue