From b02f65a41eac7dc8ca5776d803a6731f70897174 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 5 Apr 2024 16:34:35 +0200 Subject: [PATCH] feat: Improve Windows XP configuration (#350) --- Dockerfile | 2 +- src/install.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2508af2..910b559 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM scratch -COPY --from=qemux/qemu-docker:4.19 / / +COPY --from=qemux/qemu-docker:4.20 / / ARG DEBCONF_NOWARNINGS "yes" ARG DEBIAN_FRONTEND "noninteractive" diff --git a/src/install.sh b/src/install.sh index e5b21f2..35df436 100644 --- a/src/install.sh +++ b/src/install.sh @@ -768,7 +768,7 @@ prepareXP() { find "$target" -maxdepth 1 -type f -iname winnt.sif -exec rm {} \; - { echo "[Data]" + { echo "[Data]" echo "AutoPartition=1" echo "MsDosInitiated=\"0\"" echo "UnattendedInstall=\"Yes\"" @@ -811,10 +811,12 @@ prepareXP() { echo "[Networking]" echo "InstallDefaultComponents=Yes" echo "" + echo "[Branding]" + echo "BrandIEUsingUnattended=Yes" + echo "" echo "[URL]" echo "Home_Page = http://www.google.com" - echo "Search_Page = http://www.google.com/ie_rsearch.html" - echo "AutoConfig = 0" + echo "Search_Page = http://www.google.com" echo "" echo "[RegionalSettings]" echo "Language=00000409" @@ -823,6 +825,57 @@ prepareXP() { echo "AllowConnections=1" } | unix2dos > "$target/WINNT.SIF" + { echo "Windows Registry Editor Version 5.00" + echo "" + echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security]" + echo "\"FirstRunDisabled\"=dword:00000001" + echo "\"AntiVirusOverride\"=dword:00000001" + echo "\"FirewallOverride\"=dword:00000001" + echo "\"FirewallDisableNotify\"=dword:00000001" + echo "\"UpdatesDisableNotify\"=dword:00000001" + echo "\"AntiVirusDisableNotify\"=dword:00000001" + echo "" + echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc]" + echo "\"Start\"=dword:00000004" + echo "" + echo "[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\StandardProfile]" + echo "\"EnableFirewall\"=dword:00000000" + echo "" + echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess]" + echo "\"Start\"=dword:00000004" + echo + echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List]" + echo "\"3389:TCP\"=\"3389:TCP:*:Enabled:@xpsp2res.dll,-22009\"" + echo "" + echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]" + echo "\"LimitBlankPasswordUse\"=dword:00000000" + echo "" + echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]" + echo "\"RunCount\"=dword:00000000" + echo "" + echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]" + echo "\"HideFileExt\"=dword:00000000" + echo "" + echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]" + echo "\"DefaultUserName\"=\"Docker\"" + echo "\"DefaultDomainName\"=\"Dockur\"" + echo "\"AltDefaultUserName\"=\"Docker\"" + echo "\"AltDefaultDomainName\"=\"Dockur\"" + echo "\"AutoAdminLogon\"=\"1\"" + } | unix2dos > "$dir/\$OEM\$/install.reg" + + { echo "Set WshShell = WScript.CreateObject(\"WScript.Shell\")" + echo "Set WshNetwork = WScript.CreateObject(\"WScript.Network\")" + echo "Set oMachine = GetObject(\"WinNT://\" & WshNetwork.ComputerName)" + echo "Set oInfoUser = GetObject(\"WinNT://\" & WshNetwork.ComputerName & \"/Administrator,user\")" + echo "Set oUser = oMachine.MoveHere(oInfoUser.ADsPath,\"Docker\")" + } | unix2dos > "$dir/\$OEM\$/admin.vbs" + + { echo "[COMMANDS]" + echo "\"REGEDIT /s install.reg\"" + echo "\"Wscript admin.vbs\"" + } | unix2dos > "$dir/\$OEM\$/cmdlines.txt" + rm -rf "$drivers" return 0 }