feat: Add alternative ESD catalog mirror (#2051)

This commit is contained in:
Kroese
2026-08-05 07:00:05 +02:00
committed by GitHub
parent 1d42488287
commit 392b96a541
2 changed files with 61 additions and 41 deletions
+4 -4
View File
@@ -647,7 +647,7 @@ extractESD() {
local bootPad=60000000 local bootPad=60000000
local installPad=3000000 local installPad=3000000
local msg="Extracting $desc bootdisk" local msg="Extracting $desc bootdisk from ESD file"
info "$msg..." && html "$msg..." info "$msg..." && html "$msg..."
if ! size=$(stat -c%s -- "$iso"); then if ! size=$(stat -c%s -- "$iso"); then
@@ -743,7 +743,7 @@ extractESD() {
bootWim="$dir/sources/boot.wim" bootWim="$dir/sources/boot.wim"
installWim="$dir/sources/install.wim" installWim="$dir/sources/install.wim"
msg="Extracting $desc environment" msg="Extracting $desc environment from ESD file"
info "$msg..." && html "$msg..." info "$msg..." && html "$msg..."
index="2" index="2"
@@ -759,7 +759,7 @@ extractESD() {
fKill "progress.sh" fKill "progress.sh"
msg="Extracting $desc setup" msg="Extracting $desc setup from ESD file"
info "$msg..." info "$msg..."
index="3" index="3"
@@ -781,7 +781,7 @@ extractESD() {
LABEL="CPBA_A64FRE_EN-US_DV9" LABEL="CPBA_A64FRE_EN-US_DV9"
fi fi
msg="Extracting $desc image" msg="Extracting $desc image from ESD file"
info "$msg..." && html "$msg..." info "$msg..." && html "$msg..."
edition=$(getCatalog "$version" "name") edition=$(getCatalog "$version" "name")
+57 -37
View File
@@ -662,46 +662,22 @@ getWindows() {
return 0 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() { getCatalog() {
local id="$1" local id="$1"
local ret="$2" local ret="$2"
local source="${3:-microsoft}"
local file="catalog.cab" local file="catalog.cab"
local url="" name="" edition="" local url="" name="" edition=""
if [[ "${id,,}" == "win11"* ]] && ! isCompatible; then if [[ "${id,,}" == "win11"* ]] && ! isCompatible; then
# ARMv8.0 cannot run Windows 11 builds 24H2 and up. # 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 fi
case "${id,,}" in case "${id,,}" in
@@ -734,6 +710,50 @@ getCatalog() {
return 0 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() { parseESD() {
local xml="$1" local xml="$1"
@@ -839,22 +859,23 @@ getESD() {
local version="$2" local version="$2"
local lang="$3" local lang="$3"
local desc="$4" local desc="$4"
local source="${5:-microsoft}"
local file culture log local file culture log
local edition catalog rc=0 local edition catalog rc=0
local xmlFile="products.xml" local xmlFile="products.xml"
file=$(getCatalog "$version" "file")
catalog=$(getCatalog "$version" "url")
culture=$(getLanguage "$lang" "culture") 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 if [ -z "$file" ] || [ -z "$catalog" ]; then
error "Invalid VERSION specified, value \"$version\" is not recognized!" error "Invalid VERSION specified, value \"$version\" is not recognized!"
return 1 return 1
fi fi
local msg="Downloading ESD catalog from the Microsoft servers..." local msg="Downloading ESD catalog..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
rm -rf "$dir" rm -rf "$dir"
@@ -964,8 +985,7 @@ verifyFile() {
fi fi
fi fi
local algo="SHA256" local type="ISO" algo="SHA256" hash
local type="ISO" hash
[ -z "$check" ] && return 0 [ -z "$check" ] && return 0
enabled "$VERIFY" || return 0 enabled "$VERIFY" || return 0
@@ -1283,7 +1303,7 @@ downloadImage() {
success="y" success="y"
else else
delay "$seconds" delay "$seconds"
getESD "$TMP/esd" "$version" "$lang" "$desc" && success="y" getESD "$TMP/esd" "$version" "$lang" "$desc" "wor" && success="y"
fi fi
if [[ "$success" == "y" ]]; then if [[ "$success" == "y" ]]; then