mirror of
https://github.com/dockur/windows.git
synced 2026-06-10 11:59:33 +08:00
fix: High resolutions produce wrong hex value (#1745)
This commit is contained in:
+6
-6
@@ -1577,8 +1577,8 @@ prepareInstall() {
|
|||||||
[ -z "$WIDTH" ] && WIDTH="1280"
|
[ -z "$WIDTH" ] && WIDTH="1280"
|
||||||
[ -z "$HEIGHT" ] && HEIGHT="720"
|
[ -z "$HEIGHT" ] && HEIGHT="720"
|
||||||
|
|
||||||
XHEX=$(printf '%x\n' "$WIDTH")
|
XHEX=$(printf '%08x\n' "$WIDTH")
|
||||||
YHEX=$(printf '%x\n' "$HEIGHT")
|
YHEX=$(printf '%08x\n' "$HEIGHT")
|
||||||
|
|
||||||
local username=""
|
local username=""
|
||||||
local password=""
|
local password=""
|
||||||
@@ -1697,13 +1697,13 @@ prepareInstall() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]"
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]"
|
||||||
echo "\"DefaultSettings.BitsPerPel\"=dword:00000020"
|
echo "\"DefaultSettings.BitsPerPel\"=dword:00000020"
|
||||||
echo "\"DefaultSettings.XResolution\"=dword:00000$XHEX"
|
echo "\"DefaultSettings.XResolution\"=dword:$XHEX"
|
||||||
echo "\"DefaultSettings.YResolution\"=dword:00000$YHEX"
|
echo "\"DefaultSettings.YResolution\"=dword:$YHEX"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Control\VIDEO\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]"
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Control\VIDEO\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]"
|
||||||
echo "\"DefaultSettings.BitsPerPel\"=dword:00000020"
|
echo "\"DefaultSettings.BitsPerPel\"=dword:00000020"
|
||||||
echo "\"DefaultSettings.XResolution\"=dword:00000$XHEX"
|
echo "\"DefaultSettings.XResolution\"=dword:$XHEX"
|
||||||
echo "\"DefaultSettings.YResolution\"=dword:00000$YHEX"
|
echo "\"DefaultSettings.YResolution\"=dword:$YHEX"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]"
|
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]"
|
||||||
echo "\"ScreenSaver\"=\"reg add \\\"HKCU\\\\Control Panel\\\\Desktop\\\" /f /v \\\"SCRNSAVE.EXE\\\" /t REG_SZ /d \\\"off\\\"\""
|
echo "\"ScreenSaver\"=\"reg add \\\"HKCU\\\\Control Panel\\\\Desktop\\\" /f /v \\\"SCRNSAVE.EXE\\\" /t REG_SZ /d \\\"off\\\"\""
|
||||||
|
|||||||
+3
-5
@@ -37,8 +37,6 @@ backup () {
|
|||||||
dir="$root/$folder"
|
dir="$root/$folder"
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -rf "$dir"
|
|
||||||
|
|
||||||
if ! makeDir "$dir"; then
|
if ! makeDir "$dir"; then
|
||||||
error "Failed to create directory \"$dir\" !"
|
error "Failed to create directory \"$dir\" !"
|
||||||
return 1
|
return 1
|
||||||
@@ -110,7 +108,7 @@ skipInstall() {
|
|||||||
[ ! -s "$iso" ] && return 1
|
[ ! -s "$iso" ] && return 1
|
||||||
|
|
||||||
# Check if the ISO was already processed by our script
|
# Check if the ISO was already processed by our script
|
||||||
magic=$(dd if="$iso" seek=0 bs=1 count=1 status=none | tr -d '\000')
|
magic=$(dd if="$iso" bs=1 count=1 status=none | tr -d '\000')
|
||||||
magic="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')"
|
magic="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')"
|
||||||
byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17"
|
byte="16" && [[ "$MANUAL" == [Yy1]* ]] && byte="17"
|
||||||
|
|
||||||
@@ -164,7 +162,7 @@ startInstall() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! makeDir "$TMP"; then
|
if ! makeDir "$TMP"; then
|
||||||
error "Failed to create directory \"$TMP\" !"
|
error "Failed to create directory \"$TMP\" !" && exit 50
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CUSTOM" ]; then
|
if [ -z "$CUSTOM" ]; then
|
||||||
@@ -1180,7 +1178,7 @@ buildImage() {
|
|||||||
error "Failed to locate file \"$ETFS\" in ISO image!" && return 1
|
error "Failed to locate file \"$ETFS\" in ISO image!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
size=$(du -h -b --max-depth=0 "$dir" | cut -f1)
|
size=$(du -b --max-depth=0 "$dir" | cut -f1)
|
||||||
size_gb=$(formatBytes "$size")
|
size_gb=$(formatBytes "$size")
|
||||||
space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
|
space=$(df --output=avail -B 1 "$TMP" | tail -n 1)
|
||||||
space_gb=$(formatBytes "$space")
|
space_gb=$(formatBytes "$space")
|
||||||
|
|||||||
+11
-25
@@ -63,18 +63,12 @@ download_windows() {
|
|||||||
local id="$1"
|
local id="$1"
|
||||||
local lang="$2"
|
local lang="$2"
|
||||||
local desc="$3"
|
local desc="$3"
|
||||||
local sku_id=""
|
local ovw="" rtick="" sku_id="" sku_url=""
|
||||||
local sku_url=""
|
local iso_url="" iso_json="" language="" org_id=""
|
||||||
local iso_url=""
|
local instance_id="" vls_url="" ov_url="" ov_data=""
|
||||||
local iso_json=""
|
local session_id="" user_agent="" download_type=""
|
||||||
local language=""
|
local windows_version="" iso_download_link=""
|
||||||
local session_id=""
|
local download_page_html="" product_edition_id=""
|
||||||
local user_agent=""
|
|
||||||
local download_type=""
|
|
||||||
local windows_version=""
|
|
||||||
local iso_download_link=""
|
|
||||||
local download_page_html=""
|
|
||||||
local product_edition_id=""
|
|
||||||
local language_skuid_json=""
|
local language_skuid_json=""
|
||||||
local profile="606624d44113"
|
local profile="606624d44113"
|
||||||
|
|
||||||
@@ -229,13 +223,8 @@ download_windows_eval() {
|
|||||||
local id="$1"
|
local id="$1"
|
||||||
local lang="$2"
|
local lang="$2"
|
||||||
local desc="$3"
|
local desc="$3"
|
||||||
local filter=""
|
local filter="" culture="" compare="" language=""
|
||||||
local culture=""
|
local user_agent="" enterprise_type="" windows_version=""
|
||||||
local compare=""
|
|
||||||
local language=""
|
|
||||||
local user_agent=""
|
|
||||||
local enterprise_type=""
|
|
||||||
local windows_version=""
|
|
||||||
|
|
||||||
case "${id,,}" in
|
case "${id,,}" in
|
||||||
"win11${PLATFORM,,}-enterprise-eval" )
|
"win11${PLATFORM,,}-enterprise-eval" )
|
||||||
@@ -273,6 +262,7 @@ download_windows_eval() {
|
|||||||
culture=$(getLanguage "$lang" "culture")
|
culture=$(getLanguage "$lang" "culture")
|
||||||
|
|
||||||
local country="${culture#*-}"
|
local country="${culture#*-}"
|
||||||
|
local iso_download_link=""
|
||||||
local iso_download_links=""
|
local iso_download_links=""
|
||||||
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"
|
||||||
@@ -512,12 +502,8 @@ getESD() {
|
|||||||
local version="$2"
|
local version="$2"
|
||||||
local lang="$3"
|
local lang="$3"
|
||||||
local desc="$4"
|
local desc="$4"
|
||||||
local file
|
local file result culture
|
||||||
local result
|
local language edition catalog
|
||||||
local culture
|
|
||||||
local language
|
|
||||||
local edition
|
|
||||||
local catalog
|
|
||||||
|
|
||||||
file=$(getCatalog "$version" "file")
|
file=$(getCatalog "$version" "file")
|
||||||
catalog=$(getCatalog "$version" "url")
|
catalog=$(getCatalog "$version" "url")
|
||||||
|
|||||||
Reference in New Issue
Block a user