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() {
|
||||
|
||||
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"
|
||||
;;
|
||||
|
|
@ -187,7 +188,7 @@ getESD() {
|
|||
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
|
||||
|
||||
|
|
@ -242,7 +243,7 @@ getESD() {
|
|||
doMido() {
|
||||
|
||||
local iso="$1"
|
||||
local url="$2"
|
||||
local version="$2"
|
||||
local desc="$3"
|
||||
local rc
|
||||
|
||||
|
|
@ -254,7 +255,7 @@ doMido() {
|
|||
/run/progress.sh "$iso.PART" "Downloading $desc ([P])..." &
|
||||
|
||||
cd "$TMP"
|
||||
{ /run/mido.sh "$url"; rc=$?; } || :
|
||||
{ /run/mido.sh "${version,,}"; rc=$?; } || :
|
||||
cd /run
|
||||
|
||||
fKill "progress.sh"
|
||||
|
|
@ -310,39 +311,37 @@ 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")
|
||||
desc=$(printVersion "$version" "Windows")
|
||||
|
||||
else
|
||||
|
||||
url="$version"
|
||||
desc=$(getName "$BASE" "$BASE")
|
||||
|
||||
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
|
||||
return 1
|
||||
fi
|
||||
if [[ "${version,,}" == "win10${PLATFORM,,}" ]] || [[ "$version" == "win11${PLATFORM,,}" ]]; then
|
||||
|
||||
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"
|
||||
|
||||
ISO="$TMP/$VERSION.esd"
|
||||
iso="$ISO"
|
||||
getESD "$TMP/esd" "$version" && url="$ESD_URL"
|
||||
|
||||
if ! getESD "$TMP/esd"; then
|
||||
url=""
|
||||
else
|
||||
url="$ESD_URL"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
@ -351,28 +350,19 @@ downloadImage() {
|
|||
downloadFile "$iso" "$url" "$desc" && return 0
|
||||
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..."
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue