mirror of
https://github.com/dockur/windows.git
synced 2026-08-05 13:37:22 +01:00
feat: Add alternative ESD catalog mirror (#2051)
This commit is contained in:
+4
-4
@@ -647,7 +647,7 @@ extractESD() {
|
||||
local bootPad=60000000
|
||||
local installPad=3000000
|
||||
|
||||
local msg="Extracting $desc bootdisk"
|
||||
local msg="Extracting $desc bootdisk from ESD file"
|
||||
info "$msg..." && html "$msg..."
|
||||
|
||||
if ! size=$(stat -c%s -- "$iso"); then
|
||||
@@ -743,7 +743,7 @@ extractESD() {
|
||||
bootWim="$dir/sources/boot.wim"
|
||||
installWim="$dir/sources/install.wim"
|
||||
|
||||
msg="Extracting $desc environment"
|
||||
msg="Extracting $desc environment from ESD file"
|
||||
info "$msg..." && html "$msg..."
|
||||
|
||||
index="2"
|
||||
@@ -759,7 +759,7 @@ extractESD() {
|
||||
|
||||
fKill "progress.sh"
|
||||
|
||||
msg="Extracting $desc setup"
|
||||
msg="Extracting $desc setup from ESD file"
|
||||
info "$msg..."
|
||||
|
||||
index="3"
|
||||
@@ -781,7 +781,7 @@ extractESD() {
|
||||
LABEL="CPBA_A64FRE_EN-US_DV9"
|
||||
fi
|
||||
|
||||
msg="Extracting $desc image"
|
||||
msg="Extracting $desc image from ESD file"
|
||||
info "$msg..." && html "$msg..."
|
||||
|
||||
edition=$(getCatalog "$version" "name")
|
||||
|
||||
+57
-37
@@ -662,46 +662,22 @@ getWindows() {
|
||||
return 0
|
||||
}
|
||||
|
||||
getBuild() {
|
||||
|
||||
local id="$1"
|
||||
local ret="$2"
|
||||
local build="$3"
|
||||
|
||||
local file="catalog.xml"
|
||||
local url="" name="" edition=""
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}" )
|
||||
name="Windows 11 Pro"
|
||||
url="https://worproject.com/dldserv/esd/getcatalog.php?build=${build}&arch=${PLATFORM^^}&edition=Professional" ;;
|
||||
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval")
|
||||
name="Windows 11 Enterprise"
|
||||
url="https://worproject.com/dldserv/esd/getcatalog.php?build=${build}&arch=${PLATFORM^^}&edition=Enterprise" ;;
|
||||
esac
|
||||
|
||||
case "${ret,,}" in
|
||||
"url" ) echo "$url" ;;
|
||||
"file" ) echo "$file" ;;
|
||||
"name" ) echo "$name" ;;
|
||||
"edition" ) echo "$edition" ;;
|
||||
*) echo "";;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
getCatalog() {
|
||||
|
||||
local id="$1"
|
||||
local ret="$2"
|
||||
local source="${3:-microsoft}"
|
||||
|
||||
local file="catalog.cab"
|
||||
local url="" name="" edition=""
|
||||
|
||||
if [[ "${id,,}" == "win11"* ]] && ! isCompatible; then
|
||||
# ARMv8.0 cannot run Windows 11 builds 24H2 and up.
|
||||
getBuild "$1" "$2" "22631.2861" && return 0
|
||||
getWorCatalog "$1" "$2" "22631.2861" && return 0
|
||||
fi
|
||||
|
||||
if [[ "${source,,}" == "wor" ]]; then
|
||||
getWorCatalog "$1" "$2" && return 0
|
||||
fi
|
||||
|
||||
case "${id,,}" in
|
||||
@@ -734,6 +710,50 @@ getCatalog() {
|
||||
return 0
|
||||
}
|
||||
|
||||
getWorCatalog() {
|
||||
|
||||
local id="$1"
|
||||
local ret="$2"
|
||||
local build="${3:-}"
|
||||
|
||||
local edition="" filter="" version=""
|
||||
local file="catalog.xml" url="" name=""
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}" )
|
||||
version="11"
|
||||
filter="Professional"
|
||||
name="Windows 11 Pro" ;;
|
||||
"win10${PLATFORM,,}" )
|
||||
version="10"
|
||||
filter="Professional"
|
||||
name="Windows 10 Pro" ;;
|
||||
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval")
|
||||
version="11"
|
||||
filter="Enterprise"
|
||||
name="Windows 11 Enterprise" ;;
|
||||
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
|
||||
version="10"
|
||||
filter="Enterprise"
|
||||
name="Windows 10 Enterprise" ;;
|
||||
esac
|
||||
|
||||
if [ -n "$version" ]; then
|
||||
url="https://worproject.com/dldserv/esd/getcatalog.php?ver=${version}&arch=${PLATFORM^^}&edition=${filter}"
|
||||
[ -n "$build" ] && url+="&build=${build}"
|
||||
fi
|
||||
|
||||
case "${ret,,}" in
|
||||
"url" ) echo "$url" ;;
|
||||
"file" ) echo "$file" ;;
|
||||
"name" ) echo "$name" ;;
|
||||
"edition" ) echo "$edition" ;;
|
||||
*) echo "";;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
parseESD() {
|
||||
|
||||
local xml="$1"
|
||||
@@ -839,22 +859,23 @@ getESD() {
|
||||
local version="$2"
|
||||
local lang="$3"
|
||||
local desc="$4"
|
||||
local source="${5:-microsoft}"
|
||||
|
||||
local file culture log
|
||||
local edition catalog rc=0
|
||||
local xmlFile="products.xml"
|
||||
|
||||
file=$(getCatalog "$version" "file")
|
||||
catalog=$(getCatalog "$version" "url")
|
||||
culture=$(getLanguage "$lang" "culture")
|
||||
edition=$(getCatalog "$version" "edition")
|
||||
file=$(getCatalog "$version" "file" "$source")
|
||||
catalog=$(getCatalog "$version" "url" "$source")
|
||||
edition=$(getCatalog "$version" "edition" "$source")
|
||||
|
||||
if [ -z "$file" ] || [ -z "$catalog" ]; then
|
||||
error "Invalid VERSION specified, value \"$version\" is not recognized!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local msg="Downloading ESD catalog from the Microsoft servers..."
|
||||
local msg="Downloading ESD catalog..."
|
||||
info "$msg" && html "$msg"
|
||||
|
||||
rm -rf "$dir"
|
||||
@@ -964,8 +985,7 @@ verifyFile() {
|
||||
fi
|
||||
fi
|
||||
|
||||
local algo="SHA256"
|
||||
local type="ISO" hash
|
||||
local type="ISO" algo="SHA256" hash
|
||||
|
||||
[ -z "$check" ] && return 0
|
||||
enabled "$VERIFY" || return 0
|
||||
@@ -1283,7 +1303,7 @@ downloadImage() {
|
||||
success="y"
|
||||
else
|
||||
delay "$seconds"
|
||||
getESD "$TMP/esd" "$version" "$lang" "$desc" && success="y"
|
||||
getESD "$TMP/esd" "$version" "$lang" "$desc" "wor" && success="y"
|
||||
fi
|
||||
|
||||
if [[ "$success" == "y" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user