mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 19:55:49 +00:00
feat: Refactor
This commit is contained in:
parent
116bb06b50
commit
c36451b431
1 changed files with 214 additions and 260 deletions
474
src/define.sh
474
src/define.sh
|
|
@ -7,6 +7,8 @@ set -Eeuo pipefail
|
|||
: "${DETECTED:=""}"
|
||||
: "${PLATFORM:="x64"}"
|
||||
|
||||
MIRRORS=5
|
||||
|
||||
parseVersion() {
|
||||
|
||||
[ -z "$VERSION" ] && VERSION="win11"
|
||||
|
|
@ -16,70 +18,70 @@ parseVersion() {
|
|||
fi
|
||||
|
||||
case "${VERSION,,}" in
|
||||
"11" | "win11" | "windows11" | "windows 11")
|
||||
"11" | "win11" | "windows11" | "windows 11" )
|
||||
VERSION="win11${PLATFORM,,}"
|
||||
;;
|
||||
"11e" | "win11e" | "windows11e" | "windows 11e")
|
||||
"11e" | "win11e" | "windows11e" | "windows 11e" )
|
||||
VERSION="win11${PLATFORM,,}-enterprise-eval"
|
||||
;;
|
||||
"10" | "win10" | "windows10" | "windows 10")
|
||||
"10" | "win10" | "windows10" | "windows 10" )
|
||||
VERSION="win10${PLATFORM,,}"
|
||||
;;
|
||||
"10e" | "win10e" | "windows10e" | "windows 10e")
|
||||
"10e" | "win10e" | "windows10e" | "windows 10e" )
|
||||
VERSION="win10${PLATFORM,,}-enterprise-eval"
|
||||
;;
|
||||
"8" | "81" | "8.1" | "win8" | "win81" | "windows 8")
|
||||
"8" | "81" | "8.1" | "win8" | "win81" | "windows 8" )
|
||||
VERSION="win81${PLATFORM,,}"
|
||||
;;
|
||||
"8e" | "81e" | "8.1e" | "win8e" | "win81e" | "windows 8e")
|
||||
"8e" | "81e" | "8.1e" | "win8e" | "win81e" | "windows 8e" )
|
||||
VERSION="win81${PLATFORM,,}-enterprise-eval"
|
||||
;;
|
||||
"7" | "7e" | "win7" | "win7e" | "windows7" | "windows 7")
|
||||
"7" | "7e" | "win7" | "win7e" | "windows7" | "windows 7" )
|
||||
VERSION="win7${PLATFORM,,}"
|
||||
DETECTED="win7${PLATFORM,,}-enterprise"
|
||||
;;
|
||||
"vista" | "winvista" | "windowsvista" | "windows vista")
|
||||
"vista" | "winvista" | "windowsvista" | "windows vista" )
|
||||
VERSION="winvista${PLATFORM,,}"
|
||||
DETECTED="winvista${PLATFORM,,}-ultimate"
|
||||
DETECTED="winvista${PLATFORM,,}-enterprise"
|
||||
;;
|
||||
"xp" | "xp32" | "winxp" | "windowsxp" | "windows xp")
|
||||
"xp" | "xp32" | "winxp" | "windowsxp" | "windows xp" )
|
||||
VERSION="winxpx86"
|
||||
;;
|
||||
"xp64" | "winxp64" | "windowsxp64" | "windows xp 64")
|
||||
"xp64" | "winxp64" | "windowsxp64" | "windows xp 64" )
|
||||
VERSION="winxpx64"
|
||||
;;
|
||||
"22" | "2022" | "win22" | "win2022" | "windows2022" | "windows 2022")
|
||||
"22" | "2022" | "win22" | "win2022" | "windows2022" | "windows 2022" )
|
||||
VERSION="win2022-eval"
|
||||
;;
|
||||
"19" | "2019" | "win19" | "win2019" | "windows2019" | "windows 2019")
|
||||
"19" | "2019" | "win19" | "win2019" | "windows2019" | "windows 2019" )
|
||||
VERSION="win2019-eval"
|
||||
;;
|
||||
"16" | "2016" | "win16" | "win2016" | "windows2016" | "windows 2016")
|
||||
"16" | "2016" | "win16" | "win2016" | "windows2016" | "windows 2016" )
|
||||
VERSION="win2016-eval"
|
||||
;;
|
||||
"2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012")
|
||||
"2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" )
|
||||
VERSION="win2012r2-eval"
|
||||
;;
|
||||
"2008" | "2008r2" | "win2008" | "win2008r2" | "windows2008" | "windows 2008")
|
||||
"2008" | "2008r2" | "win2008" | "win2008r2" | "windows2008" | "windows 2008" )
|
||||
VERSION="win2008r2"
|
||||
;;
|
||||
"core11" | "core 11")
|
||||
"core11" | "core 11" )
|
||||
VERSION="core11"
|
||||
DETECTED="win11${PLATFORM,,}"
|
||||
;;
|
||||
"tiny11" | "tiny 11")
|
||||
"tiny11" | "tiny 11" )
|
||||
VERSION="tiny11"
|
||||
DETECTED="win11${PLATFORM,,}"
|
||||
;;
|
||||
"tiny10" | "tiny 10")
|
||||
"tiny10" | "tiny 10" )
|
||||
VERSION="tiny10"
|
||||
DETECTED="win10${PLATFORM,,}-ltsc"
|
||||
;;
|
||||
"iot10" | "10iot" | "win10-iot" | "win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval")
|
||||
"iot10" | "10iot" | "win10-iot" | "win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval" )
|
||||
DETECTED="win10${PLATFORM,,}-iot"
|
||||
VERSION="win10${PLATFORM,,}-enterprise-iot-eval"
|
||||
;;
|
||||
"ltsc10" | "10ltsc" | "win10-ltsc" | "win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval")
|
||||
"ltsc10" | "10ltsc" | "win10-ltsc" | "win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
|
||||
DETECTED="win10${PLATFORM,,}-ltsc"
|
||||
VERSION="win10${PLATFORM,,}-enterprise-ltsc-eval"
|
||||
;;
|
||||
|
|
@ -93,25 +95,28 @@ printVersion() {
|
|||
local id="$1"
|
||||
local desc="$2"
|
||||
|
||||
[[ "$id" == "win7"* ]] && desc="Windows 7"
|
||||
[[ "$id" == "win8"* ]] && desc="Windows 8"
|
||||
[[ "$id" == "win10"* ]] && desc="Windows 10"
|
||||
[[ "$id" == "win11"* ]] && desc="Windows 11"
|
||||
[[ "$id" == "winxp"* ]] && desc="Windows XP"
|
||||
[[ "$id" == "winvista"* ]] && desc="Windows Vista"
|
||||
case "${id,,}" in
|
||||
"tiny11"* ) desc="Tiny 11" ;;
|
||||
"tiny10"* ) desc="Tiny 10" ;;
|
||||
"core11"* ) desc="Core 11" ;;
|
||||
"win7"* ) desc="Windows 7" ;;
|
||||
"win8"* ) desc="Windows 8" ;;
|
||||
"win10"* ) desc="Windows 10" ;;
|
||||
"win11"* ) desc="Windows 11" ;;
|
||||
"winxp"* ) desc="Windows XP" ;;
|
||||
"winvista"* ) desc="Windows Vista" ;;
|
||||
"win2025"* ) desc="Windows Server 2025" ;;
|
||||
"win2022"* ) desc="Windows Server 2022" ;;
|
||||
"win2019"* ) desc="Windows Server 2019" ;;
|
||||
"win2016"* ) desc="Windows Server 2016" ;;
|
||||
"win2012"* ) desc="Windows Server 2012" ;;
|
||||
"win2008"* ) desc="Windows Server 2008" ;;
|
||||
esac
|
||||
|
||||
[[ "$id" == "win2025"* ]] && desc="Windows Server 2025"
|
||||
[[ "$id" == "win2022"* ]] && desc="Windows Server 2022"
|
||||
[[ "$id" == "win2019"* ]] && desc="Windows Server 2019"
|
||||
[[ "$id" == "win2016"* ]] && desc="Windows Server 2016"
|
||||
[[ "$id" == "win2012"* ]] && desc="Windows Server 2012"
|
||||
[[ "$id" == "win2008"* ]] && desc="Windows Server 2008"
|
||||
|
||||
[[ "$id" == "tiny11"* ]] && desc="Tiny 11"
|
||||
[[ "$id" == "tiny10"* ]] && desc="Tiny 10"
|
||||
[[ "$id" == "core11"* ]] && desc="Core 11"
|
||||
|
||||
[ -z "$desc" ] && desc="Windows"
|
||||
if [ -z "$desc" ]; then
|
||||
desc="Windows"
|
||||
[[ "${PLATFORM,,}" != "x64" ]] && desc="$desc for ${PLATFORM}")
|
||||
fi
|
||||
|
||||
echo "$desc"
|
||||
return 0
|
||||
|
|
@ -119,57 +124,43 @@ printVersion() {
|
|||
|
||||
getName() {
|
||||
|
||||
local file="$1"
|
||||
local desc="$2"
|
||||
local id=""
|
||||
local desc="$1"
|
||||
local file="${1,,}"
|
||||
|
||||
[[ "${file,,}" == "win11"* ]] && desc="Windows 11"
|
||||
[[ "${file,,}" == "win10"* ]] && desc="Windows 10"
|
||||
[[ "${file,,}" == "win8"* ]] && desc="Windows 8"
|
||||
[[ "${file,,}" == "win7"* ]] && desc="Windows 7"
|
||||
[[ "${file,,}" == "winxp"* ]] && desc="Windows XP"
|
||||
[[ "${file,,}" == "winvista"* ]] && desc="Windows Vista"
|
||||
[[ "${file,,}" == "tiny10"* ]] && desc="Tiny 10"
|
||||
[[ "${file,,}" == "tiny11"* ]] && desc="Tiny 11"
|
||||
[[ "${file,,}" == "tiny11core"* ]] && desc="Tiny 11 Core"
|
||||
[[ "${file,,}" == "tiny11_core"* ]] && desc="Tiny 11 Core"
|
||||
[[ "${file,,}" == *"windows11"* ]] && desc="Windows 11"
|
||||
[[ "${file,,}" == *"windows10"* ]] && desc="Windows 10"
|
||||
[[ "${file,,}" == *"windows8"* ]] && desc="Windows 8"
|
||||
[[ "${file,,}" == *"windows7"* ]] && desc="Windows 7"
|
||||
[[ "${file,,}" == *"windowsxp"* ]] && desc="Windows XP"
|
||||
[[ "${file,,}" == *"windowsvista"* ]] && desc="Windows Vista"
|
||||
[[ "${file,,}" == *"windows_11"* ]] && desc="Windows 11"
|
||||
[[ "${file,,}" == *"windows_10"* ]] && desc="Windows 10"
|
||||
[[ "${file,,}" == *"windows_8"* ]] && desc="Windows 8"
|
||||
[[ "${file,,}" == *"windows_7"* ]] && desc="Windows 7"
|
||||
[[ "${file,,}" == *"windows_xp"* ]] && desc="Windows XP"
|
||||
[[ "${file,,}" == *"windows_vista"* ]] && desc="Windows Vista"
|
||||
[[ "${file,,}" == *"windows 11"* ]] && desc="Windows 11"
|
||||
[[ "${file,,}" == *"windows 10"* ]] && desc="Windows 10"
|
||||
[[ "${file,,}" == *"windows 8"* ]] && desc="Windows 8"
|
||||
[[ "${file,,}" == *"windows 7"* ]] && desc="Windows 7"
|
||||
[[ "${file,,}" == *"windows xp"* ]] && desc="Windows XP"
|
||||
[[ "${file,,}" == *"windows vista"* ]] && desc="Windows Vista"
|
||||
[[ "${file,,}" == *"server2008"* ]] && desc="Windows Server 2008"
|
||||
[[ "${file,,}" == *"server2012"* ]] && desc="Windows Server 2012"
|
||||
[[ "${file,,}" == *"server2016"* ]] && desc="Windows Server 2016"
|
||||
[[ "${file,,}" == *"server2019"* ]] && desc="Windows Server 2019"
|
||||
[[ "${file,,}" == *"server2022"* ]] && desc="Windows Server 2022"
|
||||
[[ "${file,,}" == *"server2025"* ]] && desc="Windows Server 2025"
|
||||
[[ "${file,,}" == *"server_2008"* ]] && desc="Windows Server 2008"
|
||||
[[ "${file,,}" == *"server_2012"* ]] && desc="Windows Server 2012"
|
||||
[[ "${file,,}" == *"server_2016"* ]] && desc="Windows Server 2016"
|
||||
[[ "${file,,}" == *"server_2019"* ]] && desc="Windows Server 2019"
|
||||
[[ "${file,,}" == *"server_2022"* ]] && desc="Windows Server 2022"
|
||||
[[ "${file,,}" == *"server_2025"* ]] && desc="Windows Server 2025"
|
||||
[[ "${file,,}" == *"server 2008"* ]] && desc="Windows Server 2008"
|
||||
[[ "${file,,}" == *"server 2012"* ]] && desc="Windows Server 2012"
|
||||
[[ "${file,,}" == *"server 2016"* ]] && desc="Windows Server 2016"
|
||||
[[ "${file,,}" == *"server 2019"* ]] && desc="Windows Server 2019"
|
||||
[[ "${file,,}" == *"server 2022"* ]] && desc="Windows Server 2022"
|
||||
[[ "${file,,}" == *"server 2025"* ]] && desc="Windows Server 2025"
|
||||
case "${file/ /_}" in
|
||||
"win7"* | "win_7"* | *"windows7"* | *"windows_7"* )
|
||||
id="win7${PLATFORM,,}"
|
||||
;;
|
||||
"win8"* | "win_8"* | *"windows8"* | *"windows_8"* )
|
||||
id="win81${PLATFORM,,}"
|
||||
;;
|
||||
"win10"*| "win_10"* | *"windows10"* | *"windows_10"* )
|
||||
id="win10${PLATFORM,,}"
|
||||
;;
|
||||
"win11"* | "win_11"* *"windows11"* | *"windows_11"* )
|
||||
id="win11${PLATFORM,,}"
|
||||
;;
|
||||
*"winxp"* | *"win_xp"* | *"windowsxp"* | *"windows_xp"* )
|
||||
id="winxpx86"
|
||||
;;
|
||||
*"winvista"* | *"win_vista"* | *"windowsvista"* | *"windows_vista"* )
|
||||
id="winvista${PLATFORM,,}"
|
||||
;;
|
||||
"tiny11core"* | "tiny11_core"* | "tiny_11_core"* ) id="core11" ;;
|
||||
"tiny11"* | "tiny_11"* ) id="tiny11" ;;
|
||||
"tiny10"* | "tiny_10"* ) id="tiny10" ;;
|
||||
*"server2025"* | *"server_2025"* ) id="win2025" ;;
|
||||
*"server2022"* | *"server_2022"* ) id="win2022" ;;
|
||||
*"server2019"* | *"server_2019"* ) id="win2019" ;;
|
||||
*"server2016"* | *"server_2016"* ) id="win2016" ;;
|
||||
*"server2012"* | *"server_2012"* ) id="win2012r2" ;;
|
||||
*"server2008"* | *"server_2008"* ) id="win2008r2" ;;
|
||||
esac
|
||||
|
||||
[ -z "$desc" ] && desc="Windows"
|
||||
if [ -n "$id" ]; then
|
||||
desc=$(printVersion "$id" "$desc")
|
||||
fi
|
||||
|
||||
echo "$desc"
|
||||
return 0
|
||||
|
|
@ -177,78 +168,64 @@ getName() {
|
|||
|
||||
getVersion() {
|
||||
|
||||
local id=""
|
||||
local name="$1"
|
||||
local detected=""
|
||||
|
||||
if [[ "${name,,}" == *"windows 7"* ]]; then
|
||||
detected="win7${PLATFORM,,}"
|
||||
[[ "${name,,}" == *"ultimate"* ]] && detected="win7${PLATFORM,,}-ultimate"
|
||||
[[ "${name,,}" == *"enterprise"* ]] && detected="win7${PLATFORM,,}-enterprise"
|
||||
fi
|
||||
case "${name,,}" in
|
||||
*"server 2025"* ) id="win2025" ;;
|
||||
*"server 2022"* ) id="win2022" ;;
|
||||
*"server 2019"* ) id="win2019" ;;
|
||||
*"server 2016"* ) id="win2016" ;;
|
||||
*"server 2012"* ) id="win2012r2" ;;
|
||||
*"server 2008"* ) id="win2008r2" ;;
|
||||
*"windows 7"* ) id="win7${PLATFORM,,}" ;;
|
||||
*"windows 8"* ) id="win81${PLATFORM,,}" ;;
|
||||
*"windows 10"* ) id="win10${PLATFORM,,}" ;;
|
||||
*"windows 11"* ) id="win11${PLATFORM,,}" ;;
|
||||
*"windows vista"* ) id="winvista${PLATFORM,,}" ;;
|
||||
esac
|
||||
|
||||
if [[ "${name,,}" == *"windows vista"* ]]; then
|
||||
detected="winvista${PLATFORM,,}"
|
||||
[[ "${name,,}" == *"ultimate"* ]] && detected="winvista${PLATFORM,,}-ultimate"
|
||||
[[ "${name,,}" == *"enterprise"* ]] && detected="winvista${PLATFORM,,}-enterprise"
|
||||
fi
|
||||
case "${id,,}" in
|
||||
"win7"* | "winvista"* )
|
||||
case "${name,,}" in
|
||||
*" home"* ) id="$id-home" ;;
|
||||
*" starter"* ) id="$id-starter" ;;
|
||||
*" ultimate"* ) id="$id-ultimate" ;;
|
||||
*" enterprise"* ) id="$id-enterprise" ;;
|
||||
esac
|
||||
;;
|
||||
"win8"* )
|
||||
case "${name,,}" in
|
||||
*" enterprise evaluation"* ) id="$id-enterprise-eval" ;;
|
||||
*" enterprise"* ) id="$id-enterprise" ;;
|
||||
esac
|
||||
;;
|
||||
"win10"* )
|
||||
case "${name,,}" in
|
||||
*" iot"* ) id="$id-iot" ;;
|
||||
*" ltsc"* ) id="$id-ltsc" ;;
|
||||
*" home"* ) id="$id-home" ;;
|
||||
*" education"* ) id="$id-education" ;;
|
||||
*" enterprise evaluation"* ) id="$id-enterprise-eval" ;;
|
||||
*" enterprise"* ) id="$id-enterprise" ;;
|
||||
esac
|
||||
;;
|
||||
"win11"* )
|
||||
case "${name,,}" in
|
||||
*" home"* ) id="$id-home" ;;
|
||||
*" education"* ) id="$id-education" ;;
|
||||
*" enterprise evaluation"* ) id="$id-enterprise-eval" ;;
|
||||
*" enterprise"* ) id="$id-enterprise" ;;
|
||||
esac
|
||||
;;
|
||||
"win2025"* | "win2022"* | "win2019"* | "win2016"* | "win2012"* | "win2008"* )
|
||||
case "${name,,}" in
|
||||
*" evaluation"* ) id="$id-eval" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "${name,,}" == *"server 2025"* ]]; then
|
||||
detected="win2025"
|
||||
[[ "${name,,}" == *"evaluation"* ]] && detected="win2025-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"server 2022"* ]]; then
|
||||
detected="win2022"
|
||||
[[ "${name,,}" == *"evaluation"* ]] && detected="win2022-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"server 2019"* ]]; then
|
||||
detected="win2019"
|
||||
[[ "${name,,}" == *"evaluation"* ]] && detected="win2019-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"server 2016"* ]]; then
|
||||
detected="win2016"
|
||||
[[ "${name,,}" == *"evaluation"* ]] && detected="win2016-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"server 2012"* ]]; then
|
||||
detected="win2012r2"
|
||||
[[ "${name,,}" == *"evaluation"* ]] && detected="win2012r2-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"server 2008"* ]]; then
|
||||
detected="win2008r2"
|
||||
[[ "${name,,}" == *"evaluation"* ]] && detected="win2008r2-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"windows 8"* ]]; then
|
||||
detected="win81${PLATFORM,,}"
|
||||
[[ "${name,,}" == *"enterprise"* ]] && detected="win81${PLATFORM,,}-enterprise"
|
||||
[[ "${name,,}" == *"enterprise evaluation"* ]] && detected="win81${PLATFORM,,}-enterprise-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"windows 11"* ]]; then
|
||||
detected="win11${PLATFORM,,}"
|
||||
[[ "${name,,}" == *"enterprise"* ]] && detected="win11${PLATFORM,,}-enterprise"
|
||||
[[ "${name,,}" == *"enterprise evaluation"* ]] && detected="win11${PLATFORM,,}-enterprise-eval"
|
||||
fi
|
||||
|
||||
if [[ "${name,,}" == *"windows 10"* ]]; then
|
||||
detected="win10${PLATFORM,,}"
|
||||
if [[ "${name,,}" == *" iot "* ]]; then
|
||||
detected="win10${PLATFORM,,}-iot"
|
||||
else
|
||||
if [[ "${name,,}" == *"ltsc"* ]]; then
|
||||
detected="win10${PLATFORM,,}-ltsc"
|
||||
else
|
||||
[[ "${name,,}" == *"enterprise"* ]] && detected="win10${PLATFORM,,}-enterprise"
|
||||
[[ "${name,,}" == *"enterprise evaluation"* ]] && detected="win10${PLATFORM,,}-enterprise-eval"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$detected"
|
||||
echo "$id"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
@ -257,30 +234,20 @@ switchEdition() {
|
|||
local id="$1"
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}-enterprise-eval")
|
||||
"win11${PLATFORM,,}-enterprise-eval" )
|
||||
DETECTED="win11${PLATFORM,,}-enterprise"
|
||||
;;
|
||||
"win10${PLATFORM,,}-enterprise-eval")
|
||||
"win10${PLATFORM,,}-enterprise-eval" )
|
||||
DETECTED="win10${PLATFORM,,}-enterprise"
|
||||
;;
|
||||
"win81${PLATFORM,,}-enterprise-eval")
|
||||
"win81${PLATFORM,,}-enterprise-eval" )
|
||||
DETECTED="win81${PLATFORM,,}-enterprise"
|
||||
;;
|
||||
"win2022-eval")
|
||||
DETECTED="win2022"
|
||||
;;
|
||||
"win2019-eval")
|
||||
DETECTED="win2019"
|
||||
;;
|
||||
"win2016-eval")
|
||||
DETECTED="win2016"
|
||||
;;
|
||||
"win2012r2-eval")
|
||||
DETECTED="win2012r2"
|
||||
;;
|
||||
"win2008r2-eval")
|
||||
DETECTED="win2008r2"
|
||||
;;
|
||||
"win2022-eval" ) DETECTED="win2022" ;;
|
||||
"win2019-eval" ) DETECTED="win2019" ;;
|
||||
"win2016-eval" ) DETECTED="win2016" ;;
|
||||
"win2012r2-eval" ) DETECTED="win2012r2" ;;
|
||||
"win2008r2-eval" ) DETECTED="win2008r2" ;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
|
|
@ -291,12 +258,8 @@ isESD() {
|
|||
local id="$1"
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}")
|
||||
return 0
|
||||
;;
|
||||
"win10${PLATFORM,,}")
|
||||
return 0
|
||||
;;
|
||||
"win11${PLATFORM,,}" ) return 0 ;;
|
||||
"win10${PLATFORM,,}" ) return 0 ;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
|
|
@ -307,16 +270,16 @@ isMido() {
|
|||
local id="$1"
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}" | "win11${PLATFORM,,}-enterprise-eval")
|
||||
"win11${PLATFORM,,}" | "win11${PLATFORM,,}-enterprise-eval" )
|
||||
return 0
|
||||
;;
|
||||
"win10${PLATFORM,,}" | "win10${PLATFORM,,}-enterprise-eval" | "win10${PLATFORM,,}-enterprise-ltsc-eval")
|
||||
"win10${PLATFORM,,}" | "win10${PLATFORM,,}-enterprise-eval" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
|
||||
return 0
|
||||
;;
|
||||
"win81${PLATFORM,,}" | "win81${PLATFORM,,}-enterprise-eval")
|
||||
"win81${PLATFORM,,}" | "win81${PLATFORM,,}-enterprise-eval" )
|
||||
return 0
|
||||
;;
|
||||
"win2022-eval" | "win2019-eval" | "win2016-eval" | "win2012r2-eval" | "win2008r2")
|
||||
"win2022-eval" | "win2019-eval" | "win2016-eval" | "win2012r2-eval" | "win2008r2" )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
|
@ -333,46 +296,49 @@ getLink1() {
|
|||
local host="https://dl.bobpony.com/windows"
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}")
|
||||
"win11${PLATFORM,,}" )
|
||||
url="$host/11/en-us_windows_11_23h2_${PLATFORM,,}.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}")
|
||||
"win10${PLATFORM,,}" )
|
||||
url="$host/10/en-us_windows_10_22h2_${PLATFORM,,}.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval")
|
||||
"win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval" )
|
||||
url="$host/10/en-us_windows_10_iot_enterprise_ltsc_2021_${PLATFORM,,}_dvd_257ad90f.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval")
|
||||
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
|
||||
url="$host/10/en-us_windows_10_enterprise_ltsc_2021_${PLATFORM,,}_dvd_d289cf96.iso"
|
||||
;;
|
||||
"win81${PLATFORM,,}")
|
||||
"win81${PLATFORM,,}" )
|
||||
url="$host/8.x/8.1/en_windows_8.1_with_update_${PLATFORM,,}_dvd_6051480.iso"
|
||||
;;
|
||||
"win2022" | "win2022-eval")
|
||||
"win2022" | "win2022-eval" )
|
||||
url="$host/server/2022/en-us_windows_server_2022_updated_jan_2024_${PLATFORM,,}_dvd_2b7a0c9f.iso"
|
||||
;;
|
||||
"win2019" | "win2019-eval")
|
||||
"win2019" | "win2019-eval" )
|
||||
url="$host/server/2019/en-us_windows_server_2019_updated_aug_2021_${PLATFORM,,}_dvd_a6431a28.iso"
|
||||
;;
|
||||
"win2016" | "win2016-eval")
|
||||
"win2016" | "win2016-eval" )
|
||||
url="$host/server/2016/en_windows_server_2016_updated_feb_2018_${PLATFORM,,}_dvd_11636692.iso"
|
||||
;;
|
||||
"win2012r2" | "win2012r2-eval")
|
||||
"win2012r2" | "win2012r2-eval" )
|
||||
url="$host/server/2012r2/en_windows_server_2012_r2_with_update_${PLATFORM,,}_dvd_6052708-004.iso"
|
||||
;;
|
||||
"win2008r2" | "win2008r2-eval")
|
||||
"win2008r2" | "win2008r2-eval" )
|
||||
url="$host/server/2008r2/en_windows_server_2008_r2_with_sp1_${PLATFORM,,}_dvd_617601-018.iso"
|
||||
;;
|
||||
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise")
|
||||
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise" )
|
||||
url="$host/7/en_windows_7_enterprise_with_sp1_${PLATFORM,,}_dvd_u_677651.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}" | "winvista${PLATFORM,,}-ultimate")
|
||||
"win7${PLATFORM,,}-ultimate" )
|
||||
url="$host/7/en_windows_7_with_sp1_${PLATFORM,,}.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}-ultimate" )
|
||||
url="$host/vista/en_windows_vista_sp2_${PLATFORM,,}_dvd_342267.iso"
|
||||
;;
|
||||
"winxpx86")
|
||||
"winxpx86" )
|
||||
url="$host/xp/professional/en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso"
|
||||
;;
|
||||
"winxpx64")
|
||||
"winxpx64" )
|
||||
url="$host/xp/professional/en_win_xp_pro_${PLATFORM,,}_vl.iso"
|
||||
;;
|
||||
esac
|
||||
|
|
@ -388,28 +354,34 @@ getLink2() {
|
|||
local host="https://files.dog/MSDN"
|
||||
|
||||
case "${id,,}" in
|
||||
"win81${PLATFORM,,}")
|
||||
"win81${PLATFORM,,}" )
|
||||
url="$host/Windows%208.1%20with%20Update/en_windows_8.1_with_update_${PLATFORM,,}_dvd_6051480.iso"
|
||||
;;
|
||||
"win81${PLATFORM,,}-enterprise" | "win81${PLATFORM,,}-enterprise-eval")
|
||||
"win81${PLATFORM,,}-enterprise" | "win81${PLATFORM,,}-enterprise-eval" )
|
||||
url="$host/Windows%208.1%20with%20Update/en_windows_8.1_enterprise_with_update_${PLATFORM,,}_dvd_6054382.iso"
|
||||
;;
|
||||
"win2012r2" | "win2012r2-eval")
|
||||
"win2012r2" | "win2012r2-eval" )
|
||||
url="$host/Windows%20Server%202012%20R2%20with%20Update/en_windows_server_2012_r2_with_update_${PLATFORM,,}_dvd_6052708.iso"
|
||||
;;
|
||||
"win2008r2" | "win2008r2-eval")
|
||||
"win2008r2" | "win2008r2-eval" )
|
||||
url="$host/Windows%20Server%202008%20R2/en_windows_server_2008_r2_with_sp1_${PLATFORM,,}_dvd_617601.iso"
|
||||
;;
|
||||
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise")
|
||||
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise" )
|
||||
url="$host/Windows%207/en_windows_7_enterprise_with_sp1_${PLATFORM,,}_dvd_u_677651.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}" | "winvista${PLATFORM,,}-ultimate")
|
||||
"win7${PLATFORM,,}-ultimate" )
|
||||
url="$host/Windows%207/en_windows_7_ultimate_with_sp1_${PLATFORM,,}_dvd_u_677332.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}" | "winvista${PLATFORM,,}-enterprise" )
|
||||
url="$host/Windows%20Vista/en_windows_vista_enterprise_sp2_${PLATFORM,,}_dvd_342332.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}-ultimate" )
|
||||
url="$host/Windows%20Vista/en_windows_vista_sp2_${PLATFORM,,}_dvd_342267.iso"
|
||||
;;
|
||||
"winxpx86")
|
||||
"winxpx86" )
|
||||
url="$host/Windows%20XP/en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso"
|
||||
;;
|
||||
"winxpx64")
|
||||
"winxpx64" )
|
||||
url="$host/Windows%20XP/en_win_xp_pro_${PLATFORM,,}_vl.iso"
|
||||
;;
|
||||
esac
|
||||
|
|
@ -425,15 +397,9 @@ getLink3() {
|
|||
local host="https://file.cnxiaobai.com/Windows"
|
||||
|
||||
case "${id,,}" in
|
||||
"core11")
|
||||
url="$host/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8C%85/Tiny%2010_11/tiny11%20core%20${PLATFORM,,}%20beta%201.iso"
|
||||
;;
|
||||
"tiny11")
|
||||
url="$host/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8C%85/Tiny%2010_11/tiny11%202311%20${PLATFORM,,}.iso"
|
||||
;;
|
||||
"tiny10")
|
||||
url="$host/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8C%85/Tiny%2010_11/tiny10%2023H2%20${PLATFORM,,}.iso"
|
||||
;;
|
||||
"core11" ) url="$host/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8C%85/Tiny%2010_11/tiny11%20core%20${PLATFORM,,}%20beta%201.iso" ;;
|
||||
"tiny11" ) url="$host/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8C%85/Tiny%2010_11/tiny11%202311%20${PLATFORM,,}.iso" ;;
|
||||
"tiny10" ) url="$host/%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E5%8C%85/Tiny%2010_11/tiny10%2023H2%20${PLATFORM,,}.iso" ;;
|
||||
esac
|
||||
|
||||
echo "$url"
|
||||
|
|
@ -447,15 +413,9 @@ getLink4() {
|
|||
local host="https://archive.org/download"
|
||||
|
||||
case "${id,,}" in
|
||||
"core11")
|
||||
url="$host/tiny-11-core-x-64-beta-1/tiny11%20core%20${PLATFORM,,}%20beta%201.iso"
|
||||
;;
|
||||
"tiny11")
|
||||
url="$host/tiny11-2311/tiny11%202311%20${PLATFORM,,}.iso"
|
||||
;;
|
||||
"tiny10")
|
||||
url="$host/tiny-10-23-h2/tiny10%20${PLATFORM,,}%2023h2.iso"
|
||||
;;
|
||||
"core11" ) url="$host/tiny-11-core-x-64-beta-1/tiny11%20core%20${PLATFORM,,}%20beta%201.iso" ;;
|
||||
"tiny11" ) url="$host/tiny11-2311/tiny11%202311%20${PLATFORM,,}.iso" ;;
|
||||
"tiny10" ) url="$host/tiny-10-23-h2/tiny10%20${PLATFORM,,}%2023h2.iso" ;;
|
||||
esac
|
||||
|
||||
echo "$url"
|
||||
|
|
@ -471,49 +431,55 @@ getLink5() {
|
|||
local host="https://drive.massgrave.dev"
|
||||
|
||||
case "${id,,}" in
|
||||
"win11${PLATFORM,,}")
|
||||
"win11${PLATFORM,,}" )
|
||||
url="$host/en-us_windows_11_consumer_editions_version_23h2_updated_april_2024_${PLATFORM,,}_dvd_d986680b.iso"
|
||||
;;
|
||||
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval")
|
||||
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval" )
|
||||
url="$host/en-us_windows_11_business_editions_version_23h2_updated_april_2024_${PLATFORM,,}_dvd_349cd577.iso"
|
||||
;;
|
||||
"win11${PLATFORM,,}-iot" | "win11${PLATFORM,,}-enterprise-iot-eval")
|
||||
"win11${PLATFORM,,}-iot" | "win11${PLATFORM,,}-enterprise-iot-eval" )
|
||||
url="$host/en-us_windows_11_iot_enterprise_version_23h2_${PLATFORM,,}_dvd_fb37549c.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}")
|
||||
"win10${PLATFORM,,}" )
|
||||
url="$host/en-us_windows_10_consumer_editions_version_22h2_updated_april_2024_${PLATFORM,,}_dvd_9a92dc89.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval")
|
||||
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
|
||||
url="$host/en-us_windows_10_business_editions_version_22h2_updated_april_2024_${PLATFORM,,}_dvd_c00090a7.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval")
|
||||
"win10${PLATFORM,,}-iot" | "win10${PLATFORM,,}-enterprise-iot-eval" )
|
||||
url="$host/en-us_windows_10_iot_enterprise_ltsc_2021_${PLATFORM,,}_dvd_257ad90f.iso"
|
||||
;;
|
||||
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval")
|
||||
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
|
||||
url="$host/en-us_windows_10_enterprise_ltsc_2021_${PLATFORM,,}_dvd_d289cf96.iso"
|
||||
;;
|
||||
"win81${PLATFORM,,}-enterprise" | "win81${PLATFORM,,}-enterprise-eval")
|
||||
"win81${PLATFORM,,}-enterprise" | "win81${PLATFORM,,}-enterprise-eval" )
|
||||
url="$host/en_windows_8.1_enterprise_with_update_${PLATFORM,,}_dvd_6054382.iso"
|
||||
;;
|
||||
"win2022" | "win2022-eval")
|
||||
"win2022" | "win2022-eval" )
|
||||
url="$host/en-us_windows_server_2022_updated_april_2024_${PLATFORM,,}_dvd_164349f3.iso"
|
||||
;;
|
||||
"win2019" | "win2019-eval")
|
||||
"win2019" | "win2019-eval" )
|
||||
url="$host/en_windows_server_2019_${PLATFORM,,}_dvd_4cb967d8.iso"
|
||||
;;
|
||||
"win2016" | "win2016-eval")
|
||||
"win2016" | "win2016-eval" )
|
||||
url="$host/en_windows_server_2016_${PLATFORM,,}_dvd_9327751.iso"
|
||||
;;
|
||||
"win2012r2" | "win2012r2-eval")
|
||||
"win2012r2" | "win2012r2-eval" )
|
||||
url="$host/en_windows_server_2012_r2_with_update_${PLATFORM,,}_dvd_6052708.iso"
|
||||
;;
|
||||
"win2008r2" | "win2008r2-eval")
|
||||
"win2008r2" | "win2008r2-eval" )
|
||||
url="$host/en_windows_server_2008_r2_with_sp1_${PLATFORM,,}_dvd_617601.iso"
|
||||
;;
|
||||
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise")
|
||||
"win7${PLATFORM,,}" | "win7${PLATFORM,,}-enterprise" )
|
||||
url="$host/en_windows_7_enterprise_with_sp1_${PLATFORM,,}_dvd_u_677651.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}" | "winvista${PLATFORM,,}-ultimate")
|
||||
"win7${PLATFORM,,}-ultimate" )
|
||||
url="$host/en_windows_7_ultimate_with_sp1_${PLATFORM,,}_dvd_u_677332.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}" | "winvista${PLATFORM,,}-enterprise" )
|
||||
url="$host/en_windows_vista_enterprise_sp2_${PLATFORM,,}_dvd_342332.iso"
|
||||
;;
|
||||
"winvista${PLATFORM,,}-ultimate" )
|
||||
url="$host/en_windows_vista_sp2_${PLATFORM,,}_dvd_342267.iso"
|
||||
;;
|
||||
esac
|
||||
|
|
@ -525,26 +491,12 @@ getLink5() {
|
|||
getLink() {
|
||||
|
||||
local url=""
|
||||
local index="$1"
|
||||
local id="$2"
|
||||
local func="getLink$1"
|
||||
|
||||
case "${index,,}" in
|
||||
"1")
|
||||
url=$(getLink1 "$id")
|
||||
;;
|
||||
"2")
|
||||
url=$(getLink2 "$id")
|
||||
;;
|
||||
"3")
|
||||
url=$(getLink3 "$id")
|
||||
;;
|
||||
"4")
|
||||
url=$(getLink4 "$id")
|
||||
;;
|
||||
"5")
|
||||
url=$(getLink5 "$id")
|
||||
;;
|
||||
esac
|
||||
if [ "$1" -gt 0 ] && [ "$1" -le "$MIRRORS" ]; then
|
||||
url=$($func "$id")
|
||||
fi
|
||||
|
||||
echo "$url"
|
||||
return 0
|
||||
|
|
@ -558,7 +510,7 @@ validVersion() {
|
|||
isESD "$id" && return 0
|
||||
isMido "$id" && return 0
|
||||
|
||||
for i in {1..9}
|
||||
for i in {1..MIRRORS}
|
||||
do
|
||||
|
||||
url=$(getLink "$i" "$id")
|
||||
|
|
@ -661,10 +613,12 @@ configXP() {
|
|||
fi
|
||||
|
||||
if [[ "${arch,,}" == "x86" ]]; then
|
||||
# Windows XP Pro x86 generic key (no activation)
|
||||
# Windows XP Professional x86 generic key (no activation, trial-only)
|
||||
# This is not a pirated key, it comes from the official MS documentation.
|
||||
key="DR8GV-C8V6J-BYXHG-7PYJR-DB66Y"
|
||||
else
|
||||
# Windows XP Pro x64 generic key (no activation)
|
||||
# Windows XP Professional x64 generic key (no activation, trial-only)
|
||||
# This is not a pirated key, it comes from the official MS documentation.
|
||||
key="B2RBK-7KPT9-4JP6X-QQFWM-PJD6G"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue