mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 20:25:49 +00:00
Update mido.sh
This commit is contained in:
parent
1cdbbb20b6
commit
c2fd9c0e60
1 changed files with 20 additions and 25 deletions
45
src/mido.sh
45
src/mido.sh
|
|
@ -64,11 +64,6 @@ download_windows() {
|
||||||
|
|
||||||
language=$(getLanguage "$lang" "name")
|
language=$(getLanguage "$lang" "name")
|
||||||
|
|
||||||
if [ -z "$language" ]; then
|
|
||||||
error "Language \"$lang\" is not supported by this download method!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local url="https://www.microsoft.com/en-us/software-download/windows$windows_version"
|
local url="https://www.microsoft.com/en-us/software-download/windows$windows_version"
|
||||||
case "$windows_version" in
|
case "$windows_version" in
|
||||||
8 | 10) url="${url}ISO";;
|
8 | 10) url="${url}ISO";;
|
||||||
|
|
@ -124,7 +119,8 @@ download_windows() {
|
||||||
sku_id="$(echo "$language_skuid_table_html" | grep "${language}" | sed 's/"//g' | cut -d ',' -f 1 | cut -d ':' -f 2 | tr -cd '[:alnum:]-' | head -c 16)"
|
sku_id="$(echo "$language_skuid_table_html" | grep "${language}" | sed 's/"//g' | cut -d ',' -f 1 | cut -d ':' -f 2 | tr -cd '[:alnum:]-' | head -c 16)"
|
||||||
|
|
||||||
if [ -z "$sku_id" ]; then
|
if [ -z "$sku_id" ]; then
|
||||||
error "No downloads for language \"$language\" ($lang) were found!"
|
language=$(getLanguage "$lang" "desc")
|
||||||
|
error "No download for $language language available!"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -167,6 +163,7 @@ download_windows_eval() {
|
||||||
local id="$1"
|
local id="$1"
|
||||||
local lang="$2"
|
local lang="$2"
|
||||||
local culture=""
|
local culture=""
|
||||||
|
local language=""
|
||||||
local windows_version=""
|
local windows_version=""
|
||||||
local enterprise_type=""
|
local enterprise_type=""
|
||||||
|
|
||||||
|
|
@ -198,14 +195,7 @@ download_windows_eval() {
|
||||||
|
|
||||||
culture=$(getLanguage "$lang" "culture")
|
culture=$(getLanguage "$lang" "culture")
|
||||||
|
|
||||||
if [ -z "$culture" ]; then
|
|
||||||
error "Language \"$lang\" is not supported by this download method!"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local country="${culture#*-}"
|
local country="${culture#*-}"
|
||||||
country="${country^^}"
|
|
||||||
|
|
||||||
local iso_download_page_html=""
|
local iso_download_page_html=""
|
||||||
local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version"
|
local url="https://www.microsoft.com/en-us/evalcenter/download-$windows_version"
|
||||||
|
|
||||||
|
|
@ -222,9 +212,14 @@ download_windows_eval() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && echo "Getting download link.."
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Getting download link.."
|
||||||
iso_download_links="$(echo "$iso_download_page_html" | grep -o "https://go.microsoft.com/fwlink/p/?LinkID=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture}&country=${country}")" || {
|
iso_download_links="$(echo "$iso_download_page_html" | grep -o "https://go.microsoft.com/fwlink/p/?LinkID=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country^^}")" || {
|
||||||
# This should only happen if there's been some change to the download endpoint web address
|
# This should only happen if there's been some change to the download endpoint web address
|
||||||
error "Windows server download page gave us no download link for language \"$culture\""
|
if [[ "${lang,,}" == "en" ]] || [[ "${lang,,}" == "en-"* ]]; then
|
||||||
|
error "Windows server download page gave us no download link!"
|
||||||
|
else
|
||||||
|
language=$(getLanguage "$lang" "desc")
|
||||||
|
error "No download for $language language available!"
|
||||||
|
fi
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -257,7 +252,8 @@ getWindows() {
|
||||||
local version="$1"
|
local version="$1"
|
||||||
local lang="$2"
|
local lang="$2"
|
||||||
local desc="$3"
|
local desc="$3"
|
||||||
|
local language
|
||||||
|
|
||||||
local msg="Requesting $desc from Microsoft server..."
|
local msg="Requesting $desc from Microsoft server..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
|
|
@ -278,13 +274,15 @@ getWindows() {
|
||||||
if [[ "${lang,,}" == "en" ]] || [[ "${lang,,}" == "en-"* ]]; then
|
if [[ "${lang,,}" == "en" ]] || [[ "${lang,,}" == "en-"* ]]; then
|
||||||
MIDO_URL="https://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO" && return 0
|
MIDO_URL="https://download.microsoft.com/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO" && return 0
|
||||||
fi
|
fi
|
||||||
error "Language \"$lang\" is not supported by this download method!"
|
language=$(getLanguage "$lang" "desc")
|
||||||
|
error "No download for $language language available!"
|
||||||
;;
|
;;
|
||||||
"win2008r2" )
|
"win2008r2" )
|
||||||
if [[ "${lang,,}" == "en" ]] || [[ "${lang,,}" == "en-"* ]]; then
|
if [[ "${lang,,}" == "en" ]] || [[ "${lang,,}" == "en-"* ]]; then
|
||||||
MIDO_URL="https://download.microsoft.com/download/4/1/D/41DEA7E0-B30D-4012-A1E3-F24DC03BA1BB/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso" && return 0
|
MIDO_URL="https://download.microsoft.com/download/4/1/D/41DEA7E0-B30D-4012-A1E3-F24DC03BA1BB/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso" && return 0
|
||||||
fi
|
fi
|
||||||
error "Language \"$lang\" is not supported by this download method!"
|
language=$(getLanguage "$lang" "desc")
|
||||||
|
error "No download for $language language available!"
|
||||||
;;
|
;;
|
||||||
* ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;;
|
* ) error "Invalid VERSION specified, value \"$version\" is not recognized!" ;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -337,9 +335,11 @@ getESD() {
|
||||||
local lang="$3"
|
local lang="$3"
|
||||||
local desc="$4"
|
local desc="$4"
|
||||||
local culture
|
local culture
|
||||||
|
local language
|
||||||
local editionName
|
local editionName
|
||||||
local winCatalog size
|
local winCatalog size
|
||||||
|
|
||||||
|
culture=$(getLanguage "$lang" "culture")
|
||||||
winCatalog=$(getCatalog "$version" "url")
|
winCatalog=$(getCatalog "$version" "url")
|
||||||
editionName=$(getCatalog "$version" "edition")
|
editionName=$(getCatalog "$version" "edition")
|
||||||
|
|
||||||
|
|
@ -347,12 +347,6 @@ getESD() {
|
||||||
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
|
error "Invalid VERSION specified, value \"$version\" is not recognized!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
culture=$(getLanguage "$lang" "culture")
|
|
||||||
|
|
||||||
if [ -z "$culture" ]; then
|
|
||||||
error "Language \"$lang\" is not supported by this download method!" && return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local msg="Downloading product information from Microsoft server..."
|
local msg="Downloading product information from Microsoft server..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
|
|
@ -391,7 +385,8 @@ getESD() {
|
||||||
|
|
||||||
size=$(stat -c%s "$dir/$eFile")
|
size=$(stat -c%s "$dir/$eFile")
|
||||||
if ((size<20)); then
|
if ((size<20)); then
|
||||||
error "Language \"$culture\" is not supported by this download method!" && return 1
|
language=$(getLanguage "$lang" "desc")
|
||||||
|
error "$language language is not supported by this download method!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local tag="FilePath"
|
local tag="FilePath"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue