mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
fix: Windows Enterprise download was broken (#1387)
This commit is contained in:
parent
22235bf48e
commit
2983b2b677
3 changed files with 70 additions and 29 deletions
89
src/mido.sh
89
src/mido.sh
|
|
@ -264,23 +264,34 @@ download_windows_eval() {
|
|||
}
|
||||
|
||||
case "$enterprise_type" in
|
||||
"iot" | "ltsc" )
|
||||
case "${PLATFORM,,}" in
|
||||
"x64" )
|
||||
if [[ "$windows_version" != "windows-10"* ]]; then
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 1)
|
||||
else
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1)
|
||||
fi ;;
|
||||
"arm64" )
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) ;;
|
||||
* )
|
||||
error "Invalid platform specified, value \"$PLATFORM\" is not recognized!" && return 1 ;;
|
||||
esac ;;
|
||||
"enterprise" )
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
|
||||
;;
|
||||
"iot" )
|
||||
if [[ "${PLATFORM,,}" == "x64" ]]; then
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 1)
|
||||
fi
|
||||
if [[ "${PLATFORM,,}" == "arm64" ]]; then
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
|
||||
fi
|
||||
;;
|
||||
"ltsc" )
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1)
|
||||
;;
|
||||
case "${PLATFORM,,}" in
|
||||
"x64" )
|
||||
if [[ "$windows_version" != "windows-10"* ]]; then
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 1)
|
||||
else
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
|
||||
fi ;;
|
||||
"arm64" )
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) ;;
|
||||
* )
|
||||
error "Invalid platform specified, value \"$PLATFORM\" is not recognized!" && return 1 ;;
|
||||
esac ;;
|
||||
"server" )
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 1)
|
||||
;;
|
||||
iso_download_link=$(echo "$iso_download_links" | head -n 1) ;;
|
||||
* )
|
||||
error "Invalid type specified, value \"$enterprise_type\" is not recognized!" && return 1 ;;
|
||||
esac
|
||||
|
|
@ -323,8 +334,7 @@ getWindows() {
|
|||
|
||||
case "${version,,}" in
|
||||
"win11${PLATFORM,,}" ) ;;
|
||||
"win11${PLATFORM,,}-enterprise-iot"* ) ;;
|
||||
"win11${PLATFORM,,}-enterprise-ltsc"* ) ;;
|
||||
"win11${PLATFORM,,}-enterprise"* ) ;;
|
||||
* )
|
||||
if [[ "${PLATFORM,,}" != "x64" ]]; then
|
||||
error "No download for the ${PLATFORM^^} platform available for $edition!"
|
||||
|
|
@ -396,10 +406,11 @@ getESD() {
|
|||
local version="$2"
|
||||
local lang="$3"
|
||||
local desc="$4"
|
||||
local result
|
||||
local culture
|
||||
local language
|
||||
local editionName
|
||||
local winCatalog size
|
||||
local winCatalog
|
||||
|
||||
culture=$(getLanguage "$lang" "culture")
|
||||
winCatalog=$(getCatalog "$version" "url")
|
||||
|
|
@ -441,32 +452,57 @@ getESD() {
|
|||
error "Failed to find $xFile in $wFile!" && return 1
|
||||
fi
|
||||
|
||||
local edQuery='//File[Architecture="'${PLATFORM}'"][Edition="'${editionName}'"]'
|
||||
local edQuery='//File[Architecture="'${PLATFORM,,}'"][Edition="'${editionName}'"]'
|
||||
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
|
||||
|
||||
if [ -z "$result" ]; then
|
||||
|
||||
edQuery='//File[Architecture="'${PLATFORM^^}'"][Edition="'${editionName}'"]'
|
||||
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
|
||||
|
||||
if [ -z "$result" ]; then
|
||||
|
||||
desc=$(printEdition "$version" "$desc")
|
||||
language=$(getLanguage "$lang" "desc")
|
||||
error "No download link available for $desc!" && return 1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
echo -e '<Catalog>' > "$dir/$fFile"
|
||||
xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" >> "$dir/$fFile" 2>/dev/null
|
||||
echo "$result" >> "$dir/$fFile"
|
||||
echo -e '</Catalog>'>> "$dir/$fFile"
|
||||
|
||||
xmllint --nonet --xpath "//File[LanguageCode=\"${culture,,}\"]" "$dir/$fFile" >"$dir/$eFile"
|
||||
result=$(xmllint --nonet --xpath "//File[LanguageCode=\"${culture,,}\"]" "$dir/$fFile" 2>/dev/null)
|
||||
|
||||
size=$(stat -c%s "$dir/$eFile")
|
||||
if ((size<20)); then
|
||||
if [ -z "$result" ]; then
|
||||
desc=$(printEdition "$version" "$desc")
|
||||
language=$(getLanguage "$lang" "desc")
|
||||
error "No download in the $language language available for $desc!" && return 1
|
||||
fi
|
||||
|
||||
echo "$result" > "$dir/$eFile"
|
||||
|
||||
local tag="FilePath"
|
||||
ESD=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
|
||||
ESD=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
|
||||
|
||||
if [ -z "$ESD" ]; then
|
||||
error "Failed to find ESD URL in $eFile!" && return 1
|
||||
fi
|
||||
|
||||
tag="Sha1"
|
||||
ESD_SUM=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
|
||||
ESD_SUM=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
|
||||
|
||||
if [ -z "$ESD_SUM" ]; then
|
||||
error "Failed to find ESD checksum in $eFile!" && return 1
|
||||
fi
|
||||
|
||||
tag="Size"
|
||||
ESD_SIZE=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
|
||||
ESD_SIZE=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
|
||||
|
||||
if [ -z "$ESD_SIZE" ]; then
|
||||
error "Failed to find ESD filesize in $eFile!" && return 1
|
||||
fi
|
||||
|
||||
rm -rf "$dir"
|
||||
return 0
|
||||
|
|
@ -561,6 +597,7 @@ downloadFile() {
|
|||
fi
|
||||
|
||||
info "$msg..."
|
||||
[[ "$DEBUG" == [Yy1]* ]] && echo "Downloading $url"
|
||||
|
||||
{ wget "$url" -O "$iso" -q --timeout=30 --no-http-keep-alive --user-agent "$agent" --show-progress "$progress"; rc=$?; } || :
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue