mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
Compare commits
4 commits
82499a3181
...
8471d296ea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8471d296ea | ||
|
|
6470d19bc7 | ||
|
|
425a661c93 | ||
|
|
465d0065b9 |
2 changed files with 58 additions and 17 deletions
|
|
@ -436,7 +436,7 @@ printVersion() {
|
||||||
"tiny11"* ) desc="Tiny 11" ;;
|
"tiny11"* ) desc="Tiny 11" ;;
|
||||||
"tiny10"* ) desc="Tiny 10" ;;
|
"tiny10"* ) desc="Tiny 10" ;;
|
||||||
"core11"* ) desc="Core 11" ;;
|
"core11"* ) desc="Core 11" ;;
|
||||||
"nano11"* ) desc="Nano 11" ;;
|
"nano11"* ) desc="Nano 11" ;;
|
||||||
"win7"* ) desc="Windows 7" ;;
|
"win7"* ) desc="Windows 7" ;;
|
||||||
"win8"* ) desc="Windows 8" ;;
|
"win8"* ) desc="Windows 8" ;;
|
||||||
"win10"* ) desc="Windows 10" ;;
|
"win10"* ) desc="Windows 10" ;;
|
||||||
|
|
@ -577,7 +577,7 @@ fromFile() {
|
||||||
;;
|
;;
|
||||||
"nano11"* | "nano_11"* )
|
"nano11"* | "nano_11"* )
|
||||||
id="nano11"
|
id="nano11"
|
||||||
;;
|
;;
|
||||||
"tiny11core"* | "tiny11_core"* | "tiny_11_core"* )
|
"tiny11core"* | "tiny11_core"* | "tiny_11_core"* )
|
||||||
id="core11"
|
id="core11"
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
71
src/mido.sh
71
src/mido.sh
|
|
@ -371,6 +371,7 @@ getCatalog() {
|
||||||
local url=""
|
local url=""
|
||||||
local name=""
|
local name=""
|
||||||
local edition=""
|
local edition=""
|
||||||
|
local file="catalog.cab"
|
||||||
|
|
||||||
case "${id,,}" in
|
case "${id,,}" in
|
||||||
"win11${PLATFORM,,}" )
|
"win11${PLATFORM,,}" )
|
||||||
|
|
@ -393,6 +394,38 @@ getCatalog() {
|
||||||
|
|
||||||
case "${ret,,}" in
|
case "${ret,,}" in
|
||||||
"url" ) echo "$url" ;;
|
"url" ) echo "$url" ;;
|
||||||
|
"file" ) echo "$file" ;;
|
||||||
|
"name" ) echo "$name" ;;
|
||||||
|
"edition" ) echo "$edition" ;;
|
||||||
|
*) echo "";;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
getOldCatalog() {
|
||||||
|
|
||||||
|
local id="$1"
|
||||||
|
local ret="$2"
|
||||||
|
local url=""
|
||||||
|
local name=""
|
||||||
|
local edition=""
|
||||||
|
local file="catalog.xml"
|
||||||
|
|
||||||
|
case "${id,,}" in
|
||||||
|
"win11${PLATFORM,,}" )
|
||||||
|
edition="Professional"
|
||||||
|
name="Windows 11 Pro"
|
||||||
|
url="https://worproject.com/dldserv/esd/getcatalog.php?build=22631.2861&arch=ARM64&edition=Professional" ;;
|
||||||
|
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval")
|
||||||
|
edition="Enterprise"
|
||||||
|
name="Windows 11 Enterprise"
|
||||||
|
url="https://worproject.com/dldserv/esd/getcatalog.php?build=22631.2861&arch=ARM64&edition=Enterprise" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "${ret,,}" in
|
||||||
|
"url" ) echo "$url" ;;
|
||||||
|
"file" ) echo "$file" ;;
|
||||||
"name" ) echo "$name" ;;
|
"name" ) echo "$name" ;;
|
||||||
"edition" ) echo "$edition" ;;
|
"edition" ) echo "$edition" ;;
|
||||||
*) echo "";;
|
*) echo "";;
|
||||||
|
|
@ -407,32 +440,33 @@ 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 editionName
|
local editionName
|
||||||
local winCatalog
|
local winCatalog
|
||||||
|
|
||||||
|
file=$(getCatalog "$version" "file")
|
||||||
culture=$(getLanguage "$lang" "culture")
|
culture=$(getLanguage "$lang" "culture")
|
||||||
winCatalog=$(getCatalog "$version" "url")
|
winCatalog=$(getCatalog "$version" "url")
|
||||||
editionName=$(getCatalog "$version" "edition")
|
editionName=$(getCatalog "$version" "edition")
|
||||||
|
|
||||||
if [ -z "$winCatalog" ] || [ -z "$editionName" ]; then
|
if [ -z "$file" ] || [ -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 from Microsoft server..."
|
local msg="Downloading product information..."
|
||||||
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 "$winCatalog" -O "$dir/$wFile" -q --timeout=30 --no-http-keep-alive; rc=$?; } || :
|
{ wget "$winCatalog" -O "$dir/$file" -q --timeout=30 --no-http-keep-alive; rc=$?; } || :
|
||||||
|
|
||||||
msg="Failed to download $winCatalog"
|
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
|
||||||
|
|
@ -440,17 +474,25 @@ getESD() {
|
||||||
(( 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
|
||||||
|
|
||||||
cd "$dir"
|
if [[ "$file" == *".xml" ]]; then
|
||||||
|
|
||||||
|
mv -f "$dir/$file" "$dir/$xFile"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
cd "$dir"
|
||||||
|
|
||||||
|
if ! cabextract "$file" > /dev/null; then
|
||||||
|
cd /run
|
||||||
|
error "Failed to extract $file!" && return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if ! cabextract "$wFile" > /dev/null; then
|
|
||||||
cd /run
|
cd /run
|
||||||
error "Failed to extract $wFile!" && return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /run
|
|
||||||
|
|
||||||
if [ ! -s "$dir/$xFile" ]; then
|
if [ ! -s "$dir/$xFile" ]; then
|
||||||
error "Failed to find $xFile in $wFile!" && return 1
|
error "Failed to find $xFile in $file!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local edQuery='//File[Architecture="'${PLATFORM,,}'"][Edition="'${editionName}'"]'
|
local edQuery='//File[Architecture="'${PLATFORM,,}'"][Edition="'${editionName}'"]'
|
||||||
|
|
@ -462,7 +504,6 @@ getESD() {
|
||||||
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
|
||||||
|
|
@ -639,7 +680,7 @@ downloadImage() {
|
||||||
base=$(basename "$iso")
|
base=$(basename "$iso")
|
||||||
desc=$(fromFile "$base")
|
desc=$(fromFile "$base")
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
||||||
info "$msg" && html "$msg" && sleep "$delay"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
downloadFile "$iso" "$version" "" "" "" "$desc" && return 0
|
||||||
|
|
@ -679,7 +720,7 @@ downloadImage() {
|
||||||
size=$(getMido "$version" "$lang" "size" )
|
size=$(getMido "$version" "$lang" "size" )
|
||||||
sum=$(getMido "$version" "$lang" "sum")
|
sum=$(getMido "$version" "$lang" "sum")
|
||||||
|
|
||||||
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
|
||||||
info "$msg" && html "$msg" && sleep "$delay"
|
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
|
||||||
|
|
@ -727,12 +768,12 @@ downloadImage() {
|
||||||
if [[ "$tried" != "n" ]]; then
|
if [[ "$tried" != "n" ]]; then
|
||||||
info "Failed to download $desc, will try another mirror now..."
|
info "Failed to download $desc, will try another mirror now..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tried="y"
|
tried="y"
|
||||||
size=$(getSize "$i" "$version" "$lang")
|
size=$(getSize "$i" "$version" "$lang")
|
||||||
sum=$(getHash "$i" "$version" "$lang")
|
sum=$(getHash "$i" "$version" "$lang")
|
||||||
|
|
||||||
rm -f "$iso"
|
rm -f "$iso"
|
||||||
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
||||||
info "$msg" && html "$msg" && sleep "$delay"
|
info "$msg" && html "$msg" && sleep "$delay"
|
||||||
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
downloadFile "$iso" "$url" "$sum" "$size" "$lang" "$desc" && return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue