Skip to content

Commit 2983b2b

Browse files
authored
fix: Windows Enterprise download was broken (#1387)
1 parent 22235bf commit 2983b2b

File tree

3 files changed

+70
-29
lines changed

3 files changed

+70
-29
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
9595
|---|---|---|
9696
| `11` | Windows 11 Pro | 5.4 GB |
9797
| `11l` | Windows 11 LTSC | 4.7 GB |
98-
| `11e` | Windows 11 Enterprise | 4.0 GB |
98+
| `11e` | Windows 11 Enterprise | 5.3 GB |
9999
||||
100100
| `10` | Windows 10 Pro | 5.7 GB |
101101
| `10l` | Windows 10 LTSC | 4.6 GB |

src/define.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ getMido() {
734734
sum="b56b911bf18a2ceaeb3904d87e7c770bdf92d3099599d61ac2497b91bf190b11"
735735
;;
736736
"win11x64-enterprise-eval" )
737-
size=4295096320
738-
sum="dad633276073f14f3e0373ef7e787569e216d54942ce522b39451c8f2d38ad43"
737+
size=5387960320
738+
sum="755a90d43e826a74b9e1932a34788b898e028272439b777e5593dee8d53622ae"
739739
url="https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26100.1.240331-1435.ge_release_CLIENTENTERPRISEEVAL_OEMRET_A64FRE_en-us.iso"
740740
;;
741741
"win11x64-enterprise-iot-eval" | "win11x64-enterprise-ltsc-eval" )
@@ -1313,6 +1313,8 @@ isMido() {
13131313
local lang="$2"
13141314
local sum
13151315

1316+
[[ "${MIDO:-}" == [Nn]* ]] && return 1
1317+
13161318
sum=$(getMido "$id" "en" "sum")
13171319
[ -n "$sum" ] && return 0
13181320

@@ -1324,6 +1326,8 @@ isESD() {
13241326
local id="$1"
13251327
local lang="$2"
13261328

1329+
[[ "${ESD:-}" == [Nn]* ]] && return 1
1330+
13271331
case "${id,,}" in
13281332
"win11${PLATFORM,,}" | "win10${PLATFORM,,}" )
13291333
return 0

src/mido.sh

Lines changed: 63 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -264,23 +264,34 @@ download_windows_eval() {
264264
}
265265

266266
case "$enterprise_type" in
267+
"iot" | "ltsc" )
268+
case "${PLATFORM,,}" in
269+
"x64" )
270+
if [[ "$windows_version" != "windows-10"* ]]; then
271+
iso_download_link=$(echo "$iso_download_links" | head -n 1)
272+
else
273+
iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1)
274+
fi ;;
275+
"arm64" )
276+
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) ;;
277+
* )
278+
error "Invalid platform specified, value \"$PLATFORM\" is not recognized!" && return 1 ;;
279+
esac ;;
267280
"enterprise" )
268-
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
269-
;;
270-
"iot" )
271-
if [[ "${PLATFORM,,}" == "x64" ]]; then
272-
iso_download_link=$(echo "$iso_download_links" | head -n 1)
273-
fi
274-
if [[ "${PLATFORM,,}" == "arm64" ]]; then
275-
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
276-
fi
277-
;;
278-
"ltsc" )
279-
iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1)
280-
;;
281+
case "${PLATFORM,,}" in
282+
"x64" )
283+
if [[ "$windows_version" != "windows-10"* ]]; then
284+
iso_download_link=$(echo "$iso_download_links" | head -n 1)
285+
else
286+
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
287+
fi ;;
288+
"arm64" )
289+
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) ;;
290+
* )
291+
error "Invalid platform specified, value \"$PLATFORM\" is not recognized!" && return 1 ;;
292+
esac ;;
281293
"server" )
282-
iso_download_link=$(echo "$iso_download_links" | head -n 1)
283-
;;
294+
iso_download_link=$(echo "$iso_download_links" | head -n 1) ;;
284295
* )
285296
error "Invalid type specified, value \"$enterprise_type\" is not recognized!" && return 1 ;;
286297
esac
@@ -323,8 +334,7 @@ getWindows() {
323334

324335
case "${version,,}" in
325336
"win11${PLATFORM,,}" ) ;;
326-
"win11${PLATFORM,,}-enterprise-iot"* ) ;;
327-
"win11${PLATFORM,,}-enterprise-ltsc"* ) ;;
337+
"win11${PLATFORM,,}-enterprise"* ) ;;
328338
* )
329339
if [[ "${PLATFORM,,}" != "x64" ]]; then
330340
error "No download for the ${PLATFORM^^} platform available for $edition!"
@@ -396,10 +406,11 @@ getESD() {
396406
local version="$2"
397407
local lang="$3"
398408
local desc="$4"
409+
local result
399410
local culture
400411
local language
401412
local editionName
402-
local winCatalog size
413+
local winCatalog
403414

404415
culture=$(getLanguage "$lang" "culture")
405416
winCatalog=$(getCatalog "$version" "url")
@@ -441,32 +452,57 @@ getESD() {
441452
error "Failed to find $xFile in $wFile!" && return 1
442453
fi
443454

444-
local edQuery='//File[Architecture="'${PLATFORM}'"][Edition="'${editionName}'"]'
455+
local edQuery='//File[Architecture="'${PLATFORM,,}'"][Edition="'${editionName}'"]'
456+
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
457+
458+
if [ -z "$result" ]; then
459+
460+
edQuery='//File[Architecture="'${PLATFORM^^}'"][Edition="'${editionName}'"]'
461+
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
462+
463+
if [ -z "$result" ]; then
464+
465+
desc=$(printEdition "$version" "$desc")
466+
language=$(getLanguage "$lang" "desc")
467+
error "No download link available for $desc!" && return 1
468+
fi
469+
470+
fi
445471

446472
echo -e '<Catalog>' > "$dir/$fFile"
447-
xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" >> "$dir/$fFile" 2>/dev/null
473+
echo "$result" >> "$dir/$fFile"
448474
echo -e '</Catalog>'>> "$dir/$fFile"
449475

450-
xmllint --nonet --xpath "//File[LanguageCode=\"${culture,,}\"]" "$dir/$fFile" >"$dir/$eFile"
476+
result=$(xmllint --nonet --xpath "//File[LanguageCode=\"${culture,,}\"]" "$dir/$fFile" 2>/dev/null)
451477

452-
size=$(stat -c%s "$dir/$eFile")
453-
if ((size<20)); then
478+
if [ -z "$result" ]; then
454479
desc=$(printEdition "$version" "$desc")
455480
language=$(getLanguage "$lang" "desc")
456481
error "No download in the $language language available for $desc!" && return 1
457482
fi
458483

484+
echo "$result" > "$dir/$eFile"
485+
459486
local tag="FilePath"
460-
ESD=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
487+
ESD=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
461488

462489
if [ -z "$ESD" ]; then
463490
error "Failed to find ESD URL in $eFile!" && return 1
464491
fi
465492

466493
tag="Sha1"
467-
ESD_SUM=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
494+
ESD_SUM=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
495+
496+
if [ -z "$ESD_SUM" ]; then
497+
error "Failed to find ESD checksum in $eFile!" && return 1
498+
fi
499+
468500
tag="Size"
469-
ESD_SIZE=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
501+
ESD_SIZE=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
502+
503+
if [ -z "$ESD_SIZE" ]; then
504+
error "Failed to find ESD filesize in $eFile!" && return 1
505+
fi
470506

471507
rm -rf "$dir"
472508
return 0
@@ -561,6 +597,7 @@ downloadFile() {
561597
fi
562598

563599
info "$msg..."
600+
[[ "$DEBUG" == [Yy1]* ]] && echo "Downloading $url"
564601

565602
{ wget "$url" -O "$iso" -q --timeout=30 --no-http-keep-alive --user-agent "$agent" --show-progress "$progress"; rc=$?; } || :
566603

0 commit comments

Comments
 (0)