From c717a98d5111418709ce4d6df21706a2a0a011d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 08:40:00 +0000 Subject: [PATCH] Fix bugs 7-13: variable shadowing, dead code, inverted registry value, malformed dword format Agent-Logs-Url: https://github.com/dockur/windows/sessions/20956c77-2636-43d2-913e-28ea857b78ef Co-authored-by: kroese <5763256+kroese@users.noreply.github.com> --- src/define.sh | 18 +++++++++--------- src/install.sh | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/define.sh b/src/define.sh index b86dfe6..bacd5d2 100644 --- a/src/define.sh +++ b/src/define.sh @@ -1391,6 +1391,7 @@ prepareInstall() { local pid="" local file="" + local iso="$1" local dir="$2" local desc="$3" local driver="$4" @@ -1575,8 +1576,8 @@ prepareInstall() { [ -z "$WIDTH" ] && WIDTH="1280" [ -z "$HEIGHT" ] && HEIGHT="720" - XHEX=$(printf '%x\n' "$WIDTH") - YHEX=$(printf '%x\n' "$HEIGHT") + XHEX=$(printf '%08x' "$WIDTH") + YHEX=$(printf '%08x' "$HEIGHT") local username="" local password="" @@ -1695,13 +1696,13 @@ prepareInstall() { echo "" echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]" echo "\"DefaultSettings.BitsPerPel\"=dword:00000020" - echo "\"DefaultSettings.XResolution\"=dword:00000$XHEX" - echo "\"DefaultSettings.YResolution\"=dword:00000$YHEX" + echo "\"DefaultSettings.XResolution\"=dword:$XHEX" + echo "\"DefaultSettings.YResolution\"=dword:$YHEX" echo "" 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.XResolution\"=dword:00000$XHEX" - echo "\"DefaultSettings.YResolution\"=dword:00000$YHEX" + echo "\"DefaultSettings.XResolution\"=dword:$XHEX" + echo "\"DefaultSettings.YResolution\"=dword:$YHEX" echo "" 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\\\"\"" @@ -1722,7 +1723,7 @@ prepareInstall() { echo "@=dword:00000000" echo "" echo "[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ServerOOBE\SecurityOOBE]" - echo "\"DontLaunchSecurityOOBE\"=dword:00000000" + echo "\"DontLaunchSecurityOOBE\"=dword:00000001" echo "" } | unix2dos >> "$dir/\$OEM\$/install.reg" fi @@ -1860,8 +1861,7 @@ detectLegacy() { [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51IB -print -quit) [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51ID -print -quit) [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51IL -print -quit) - [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51IS -print -quit) - [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51AA -print -quit) + [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51IE -print -quit) [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51AD -print -quit) [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51AS -print -quit) [ -z "$find" ] && find=$(find "$dir" -maxdepth 1 -type f -iname WIN51MA -print -quit) diff --git a/src/install.sh b/src/install.sh index ce47af1..71a7cb7 100644 --- a/src/install.sh +++ b/src/install.sh @@ -379,8 +379,8 @@ extractESD() { local version="$3" local desc="$4" local size size_gb sizes space space_gb - local desc total total1 total2 total3 total4 - local imageIndex links links1 links2 links3 links4 + local total total1 total2 total3 total4 + local retVal imageIndex links links1 links2 links3 links4 local msg="Extracting $desc bootdisk" info "$msg..." && html "$msg..." @@ -1218,11 +1218,11 @@ buildImage() { error "Failed to build image!" && return 1 fi - local error="" + local log_content="" local hide="Warning: creating filesystem that does not conform to ISO-9660." - [ -s "$log" ] && error="$(<"$log")" - [[ "$error" != "$hide" ]] && echo "$error" + [ -s "$log" ] && log_content="$(<"$log")" + [[ "$log_content" != "$hide" ]] && echo "$log_content" mv -f "$out" "$BOOT" || return 1 ! setOwner "$BOOT" && error "Failed to set the owner for \"$BOOT\" !"