mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Add Windows 8 support to quickget and refactor Windows 10/11 support
This commit is contained in:
		
							parent
							
								
									a6847d41aa
								
							
						
					
					
						commit
						80a05b630e
					
				
					 1 changed files with 4 additions and 8 deletions
				
			
		
							
								
								
									
										12
									
								
								quickget
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								quickget
									
										
									
									
									
								
							|  | @ -294,7 +294,7 @@ function get_ubuntu() { | ||||||
| # Adapted from https://gist.github.com/hongkongkiwi/15a5bf16437315df256c118c163607cb | # Adapted from https://gist.github.com/hongkongkiwi/15a5bf16437315df256c118c163607cb | ||||||
| function get_windows() { | function get_windows() { | ||||||
|     case ${RELEASE} in |     case ${RELEASE} in | ||||||
|       10|11) true;; |       8|10|11) true;; | ||||||
|       *) echo "ERROR! Windows ${RELEASE} is not supported." |       *) echo "ERROR! Windows ${RELEASE} is not supported." | ||||||
|          releases_windows |          releases_windows | ||||||
|          exit 1 |          exit 1 | ||||||
|  | @ -316,18 +316,14 @@ function get_windows() { | ||||||
| 
 | 
 | ||||||
|     echo "Getting Windows ${RELEASE} URL..." |     echo "Getting Windows ${RELEASE} URL..." | ||||||
|     WINDOWS_VERSIONS=$(wget -q -O- "https://tb.rg-adguard.net/php/get_version.php?type_id=1" | jq '.versions | sort_by(-(.version_id | tonumber))') |     WINDOWS_VERSIONS=$(wget -q -O- "https://tb.rg-adguard.net/php/get_version.php?type_id=1" | jq '.versions | sort_by(-(.version_id | tonumber))') | ||||||
| 
 |     LATEST_WINDOWS_VERSION=$(echo "${WINDOWS_VERSIONS}" | jq -c 'map(select(.name | contains("Windows '${RELEASE}'")))[0]') | ||||||
|     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) |     WINDOWS_NAME=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .name) | ||||||
|     VERSION_ID=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .version_id) |     VERSION_ID=$(echo "${LATEST_WINDOWS_VERSION}" | jq -r .version_id) | ||||||
| 
 | 
 | ||||||
|     case ${RELEASE} in |     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');; |         8) 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 8.1 Pro + Core").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');; |         10|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 '${RELEASE}'").edition_id');; | ||||||
|     esac |     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') |     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') | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue