diff --git a/src/define.sh b/src/define.sh index 2f86814..05e1885 100644 --- a/src/define.sh +++ b/src/define.sh @@ -391,18 +391,39 @@ switchEdition() { return 0 } -isESD() { +getCatalog() { local id="$1" + local ret="$2" + local url="" + local edition="" case "${id,,}" in - "win11${PLATFORM,,}" ) return 0 ;; - "win10${PLATFORM,,}" ) return 0 ;; - "win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval" ) return 0 ;; - "win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" ) return 0 ;; + "win11${PLATFORM,,}" ) + edition="Professional" + url="https://go.microsoft.com/fwlink?linkid=2156292" + ;; + "win10${PLATFORM,,}" ) + edition="Professional" + url="https://go.microsoft.com/fwlink/?LinkId=841361" + ;; + "win11${PLATFORM,,}-enterprise" ) + edition="Enterprise" + url="https://go.microsoft.com/fwlink?linkid=2156292" + ;; + "win10${PLATFORM,,}-enterprise" ) + edition="Enterprise" + url="https://go.microsoft.com/fwlink/?LinkId=841361" + ;; esac - return 1 + case "${ret,,}" in + "url" ) echo "$url" ;; + "edition" ) echo "$edition" ;; + *) echo "";; + esac + + return 0 } getMido() { @@ -472,17 +493,6 @@ getMido() { return 1 } -isMido() { - - local id="$1" - local sum - - sum=$(getMido "$id" "sum") - [ -n "$sum" ] && return 0 - - return 1 -} - getLink1() { # Fallbacks for users who cannot connect to the Microsoft servers @@ -879,6 +889,28 @@ getSize() { return 0 } +isMido() { + + local id="$1" + local sum + + sum=$(getMido "$id" "sum") + [ -n "$sum" ] && return 0 + + return 1 +} + +isESD() { + + local id="$1" + local url + + url=$(getMido "$id" "url") + [ -n "$url" ] && return 0 + + return 1 +} + validVersion() { local id="$1"