mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Add Windows 11 support to quickget
This commit is contained in:
parent
86e634b2bd
commit
aa2c8d0913
2 changed files with 24 additions and 10 deletions
27
quickget
27
quickget
|
@ -293,11 +293,13 @@ function get_ubuntu() {
|
|||
|
||||
# Adapted from https://gist.github.com/hongkongkiwi/15a5bf16437315df256c118c163607cb
|
||||
function get_windows() {
|
||||
if [ "${RELEASE}" != "10" ]; then
|
||||
echo "ERROR! Unknown release: ${RELEASE}"
|
||||
releases_windows
|
||||
exit 1
|
||||
fi
|
||||
case ${RELEASE} in
|
||||
10|11) true;;
|
||||
*) echo "ERROR! Windows ${RELEASE} is not supported."
|
||||
releases_windows
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
local ARCH="x64"
|
||||
local LANG_CODE="en"
|
||||
|
@ -313,10 +315,21 @@ function get_windows() {
|
|||
local DOWNLOAD_URL=""
|
||||
|
||||
echo "Getting Windows ${RELEASE} URL..."
|
||||
LATEST_WINDOWS_VERSION=$(wget -q -O- "https://tb.rg-adguard.net/php/get_version.php?type_id=1" | jq '.versions | sort_by(-(.version_id | tonumber))[0]')
|
||||
WINDOWS_VERSIONS=$(wget -q -O- "https://tb.rg-adguard.net/php/get_version.php?type_id=1" | jq '.versions | sort_by(-(.version_id | tonumber))')
|
||||
|
||||
case ${RELEASE} in
|
||||
10) LATEST_WINDOWS_VERSION=$(echo "${WINDOWS_VERSIONS}" | jq -c 'map(select(.name | contains("Windows 10")))[0]');;
|
||||
11) LATEST_WINDOWS_VERSION=$(echo "${WINDOWS_VERSIONS}" | jq -c 'map(select(.name | contains("Windows 11")))[0]');;
|
||||
esac
|
||||
|
||||
WINDOWS_NAME=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .name)
|
||||
VERSION_ID=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .version_id)
|
||||
EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows 10").edition_id')
|
||||
|
||||
case ${RELEASE} in
|
||||
10) EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows 10").edition_id');;
|
||||
11) EDITION_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_edition.php?version_id=${VERSION_ID}&lang=name_${LANG_CODE}" | jq -r '.editions[] | select(.name_'${LANG_CODE}'=="Windows 11").edition_id');;
|
||||
esac
|
||||
|
||||
LANGUAGE_ID=$(wget -q -O- "https://tb.rg-adguard.net/php/get_language.php?edition_id=${EDITION_ID}&lang=name_${LANG_CODE}" | jq -r '.languages[] | select(.name_'${LANG_CODE}'=="'"${LANG_NAME}"'").language_id')
|
||||
ARCH_INFO=$(wget -q -O- "https://tb.rg-adguard.net/php/get_arch.php?language_id=${LANGUAGE_ID}")
|
||||
FILE_NAME=$(echo "${ARCH_INFO}" | jq -r '.archs[] | select(.name | contains("'${ARCH}'")).name')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue