mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 11:25:49 +00:00
Compare commits
No commits in common. "e56f059bd2023548214738f8a88a620b70ed141e" and "0f918c8cb0cad13aa4b4afb07e11f64b573c50e3" have entirely different histories.
e56f059bd2
...
0f918c8cb0
2 changed files with 33 additions and 98 deletions
|
|
@ -1885,10 +1885,6 @@ skipVersion() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
isCompatible() {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
setMachine() {
|
setMachine() {
|
||||||
|
|
||||||
local id="$1"
|
local id="$1"
|
||||||
|
|
|
||||||
109
src/mido.sh
109
src/mido.sh
|
|
@ -364,36 +364,6 @@ getWindows() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
getBuild() {
|
|
||||||
|
|
||||||
local id="$1"
|
|
||||||
local ret="$2"
|
|
||||||
local url=""
|
|
||||||
local name=""
|
|
||||||
local build="$3"
|
|
||||||
local edition=""
|
|
||||||
local file="catalog.xml"
|
|
||||||
|
|
||||||
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"
|
||||||
|
|
@ -401,12 +371,6 @@ getCatalog() {
|
||||||
local url=""
|
local url=""
|
||||||
local name=""
|
local name=""
|
||||||
local edition=""
|
local edition=""
|
||||||
local file="catalog.cab"
|
|
||||||
|
|
||||||
if [[ "${id,,}" == "win11"* ]] && ! isCompatible; then
|
|
||||||
# ARMv8.0 cannot run Windows 11 builds higher than 22631
|
|
||||||
getBuild "$1" "$2" "22631.2861" && return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${id,,}" in
|
case "${id,,}" in
|
||||||
"win11${PLATFORM,,}" )
|
"win11${PLATFORM,,}" )
|
||||||
|
|
@ -429,9 +393,8 @@ getCatalog() {
|
||||||
|
|
||||||
case "${ret,,}" in
|
case "${ret,,}" in
|
||||||
"url" ) echo "$url" ;;
|
"url" ) echo "$url" ;;
|
||||||
"file" ) echo "$file" ;;
|
|
||||||
"name" ) echo "$name" ;;
|
"name" ) echo "$name" ;;
|
||||||
"edition" ) echo '[Edition="'"${edition}"'"]' ;;
|
"edition" ) echo "$edition" ;;
|
||||||
*) echo "";;
|
*) echo "";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
@ -444,71 +407,62 @@ getESD() {
|
||||||
local version="$2"
|
local version="$2"
|
||||||
local lang="$3"
|
local lang="$3"
|
||||||
local desc="$4"
|
local desc="$4"
|
||||||
local file
|
|
||||||
local result
|
local result
|
||||||
local culture
|
local culture
|
||||||
local language
|
local language
|
||||||
local edition
|
local editionName
|
||||||
local catalog
|
local winCatalog
|
||||||
|
|
||||||
file=$(getCatalog "$version" "file")
|
|
||||||
catalog=$(getCatalog "$version" "url")
|
|
||||||
culture=$(getLanguage "$lang" "culture")
|
culture=$(getLanguage "$lang" "culture")
|
||||||
edition=$(getCatalog "$version" "edition")
|
winCatalog=$(getCatalog "$version" "url")
|
||||||
|
editionName=$(getCatalog "$version" "edition")
|
||||||
|
|
||||||
if [ -z "$file" ] || [ -z "$catalog" ]; then
|
if [ -z "$winCatalog" ] || [ -z "$editionName" ]; then
|
||||||
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
|
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local msg="Downloading product information..."
|
local msg="Downloading product information from Microsoft server..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
mkdir -p "$dir"
|
mkdir -p "$dir"
|
||||||
|
|
||||||
|
local wFile="catalog.cab"
|
||||||
local xFile="products.xml"
|
local xFile="products.xml"
|
||||||
local eFile="esd_edition.xml"
|
local eFile="esd_edition.xml"
|
||||||
local fFile="products_filter.xml"
|
local fFile="products_filter.xml"
|
||||||
|
|
||||||
{ wget "$catalog" -O "$dir/$file" -q --timeout=30 --no-http-keep-alive; rc=$?; } || :
|
{ wget "$winCatalog" -O "$dir/$wFile" -q --timeout=30 --no-http-keep-alive; rc=$?; } || :
|
||||||
|
|
||||||
msg="Failed to download $catalog"
|
msg="Failed to download $winCatalog"
|
||||||
(( rc == 3 )) && error "$msg , cannot write file (disk full?)" && return 1
|
(( rc == 3 )) && error "$msg , cannot write file (disk full?)" && return 1
|
||||||
(( rc == 4 )) && error "$msg , network failure!" && return 1
|
(( rc == 4 )) && error "$msg , network failure!" && return 1
|
||||||
(( rc == 8 )) && error "$msg , server issued an error response!" && return 1
|
(( rc == 8 )) && error "$msg , server issued an error response!" && return 1
|
||||||
(( rc != 0 )) && error "$msg , reason: $rc" && return 1
|
(( rc != 0 )) && error "$msg , reason: $rc" && return 1
|
||||||
|
|
||||||
if [[ "$file" == *".xml" ]]; then
|
|
||||||
|
|
||||||
mv -f "$dir/$file" "$dir/$xFile"
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
|
|
||||||
if ! cabextract "$file" > /dev/null; then
|
if ! cabextract "$wFile" > /dev/null; then
|
||||||
cd /run
|
cd /run
|
||||||
error "Failed to extract $file!" && return 1
|
error "Failed to extract $wFile!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /run
|
cd /run
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -s "$dir/$xFile" ]; then
|
if [ ! -s "$dir/$xFile" ]; then
|
||||||
error "Failed to find $xFile in $file!" && return 1
|
error "Failed to find $xFile in $wFile!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local edQuery='//File[Architecture="'${PLATFORM,,}'"]'"${edition}"''
|
local edQuery='//File[Architecture="'${PLATFORM,,}'"][Edition="'${editionName}'"]'
|
||||||
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
|
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
|
||||||
|
|
||||||
if [ -z "$result" ]; then
|
if [ -z "$result" ]; then
|
||||||
|
|
||||||
edQuery='//File[Architecture="'${PLATFORM^^}'"]'"${edition}"''
|
edQuery='//File[Architecture="'${PLATFORM^^}'"][Edition="'${editionName}'"]'
|
||||||
|
|
||||||
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
|
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
|
||||||
|
|
||||||
if [ -z "$result" ]; then
|
if [ -z "$result" ]; then
|
||||||
|
|
||||||
desc=$(printEdition "$version" "$desc")
|
desc=$(printEdition "$version" "$desc")
|
||||||
language=$(getLanguage "$lang" "desc")
|
language=$(getLanguage "$lang" "desc")
|
||||||
error "No download link available for $desc!" && return 1
|
error "No download link available for $desc!" && return 1
|
||||||
|
|
@ -669,31 +623,16 @@ downloadFile() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
delay() {
|
|
||||||
|
|
||||||
local i
|
|
||||||
local delay="$1"
|
|
||||||
local msg="Will retry in X seconds..."
|
|
||||||
|
|
||||||
info "${msg/X/$delay}"
|
|
||||||
|
|
||||||
for i in $(seq "$delay" -1 1); do
|
|
||||||
html "${msg/X/$i}"
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
downloadImage() {
|
downloadImage() {
|
||||||
|
|
||||||
local iso="$1"
|
local iso="$1"
|
||||||
local version="$2"
|
local version="$2"
|
||||||
local lang="$3"
|
local lang="$3"
|
||||||
|
local delay=5
|
||||||
local tried="n"
|
local tried="n"
|
||||||
local success="n"
|
local success="n"
|
||||||
local seconds="5"
|
|
||||||
local url sum size base desc language
|
local url sum size base desc language
|
||||||
|
local msg="Will retry after $delay seconds..."
|
||||||
|
|
||||||
if [[ "${version,,}" == "http"* ]]; then
|
if [[ "${version,,}" == "http"* ]]; then
|
||||||
|
|
||||||
|
|
@ -702,7 +641,7 @@ downloadImage() {
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
||||||
delay "$seconds"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
|
|
||||||
|
|
@ -732,7 +671,7 @@ downloadImage() {
|
||||||
if getWindows "$version" "$lang" "$desc"; then
|
if getWindows "$version" "$lang" "$desc"; then
|
||||||
success="y"
|
success="y"
|
||||||
else
|
else
|
||||||
delay "$seconds"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
getWindows "$version" "$lang" "$desc" && success="y"
|
getWindows "$version" "$lang" "$desc" && success="y"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -742,7 +681,7 @@ downloadImage() {
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$lang" "$desc" && return 0
|
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$lang" "$desc" && return 0
|
||||||
delay "$seconds"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$lang" "$desc" && return 0
|
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$lang" "$desc" && return 0
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
fi
|
fi
|
||||||
|
|
@ -762,7 +701,7 @@ downloadImage() {
|
||||||
if getESD "$TMP/esd" "$version" "$lang" "$desc"; then
|
if getESD "$TMP/esd" "$version" "$lang" "$desc"; then
|
||||||
success="y"
|
success="y"
|
||||||
else
|
else
|
||||||
delay "$seconds"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
getESD "$TMP/esd" "$version" "$lang" "$desc" && success="y"
|
getESD "$TMP/esd" "$version" "$lang" "$desc" && success="y"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -771,7 +710,7 @@ downloadImage() {
|
||||||
|
|
||||||
rm -f "$ISO"
|
rm -f "$ISO"
|
||||||
downloadFile "$ISO" "$ESD" "$ESD_SUM" "$ESD_SIZE" "$lang" "$desc" && return 0
|
downloadFile "$ISO" "$ESD" "$ESD_SUM" "$ESD_SIZE" "$lang" "$desc" && return 0
|
||||||
delay "$seconds"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
downloadFile "$ISO" "$ESD" "$ESD_SUM" "$ESD_SIZE" "$lang" "$desc" && return 0
|
downloadFile "$ISO" "$ESD" "$ESD_SUM" "$ESD_SIZE" "$lang" "$desc" && return 0
|
||||||
rm -f "$ISO"
|
rm -f "$ISO"
|
||||||
ISO="$iso"
|
ISO="$iso"
|
||||||
|
|
@ -795,7 +734,7 @@ downloadImage() {
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
||||||
delay "$seconds"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue