mirror of
https://github.com/dockur/windows.git
synced 2024-11-15 01:34:41 +00:00
feat: Make resolution configurable (#582)
This commit is contained in:
parent
2f5f01dbb2
commit
5bf54a4158
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -Eeuo pipefail
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
: "${XRES:=""}"
|
||||||
|
: "${YRES:=""}"
|
||||||
: "${VERIFY:=""}"
|
: "${VERIFY:=""}"
|
||||||
: "${REGION:=""}"
|
: "${REGION:=""}"
|
||||||
: "${MANUAL:=""}"
|
: "${MANUAL:=""}"
|
||||||
@ -2073,6 +2075,12 @@ prepareInstall() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -z "$YRES" ] && YRES="720"
|
||||||
|
[ -z "$XRES" ] && XRES="1280"
|
||||||
|
|
||||||
|
XHEX=$(printf '%x\n' "$XRES")
|
||||||
|
YHEX=$(printf '%x\n' "$YRES")
|
||||||
|
|
||||||
local username="Docker"
|
local username="Docker"
|
||||||
local password="*"
|
local password="*"
|
||||||
|
|
||||||
@ -2118,13 +2126,14 @@ prepareInstall() {
|
|||||||
echo " OrgName=\"Windows for Docker\""
|
echo " OrgName=\"Windows for Docker\""
|
||||||
echo " ProductKey=$key"
|
echo " ProductKey=$key"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[LicenseFilePrintData]"
|
|
||||||
echo " AutoMode=PerServer"
|
|
||||||
echo " AutoUsers=5"
|
|
||||||
echo ""
|
|
||||||
echo "[Identification]"
|
echo "[Identification]"
|
||||||
echo " JoinWorkgroup = WORKGROUP"
|
echo " JoinWorkgroup = WORKGROUP"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "[Display]"
|
||||||
|
echo " BitsPerPel=32"
|
||||||
|
echo " XResolution=$XRES"
|
||||||
|
echo " YResolution=$YRES"
|
||||||
|
echo ""
|
||||||
echo "[Networking]"
|
echo "[Networking]"
|
||||||
echo " InstallDefaultComponents=Yes"
|
echo " InstallDefaultComponents=Yes"
|
||||||
echo ""
|
echo ""
|
||||||
@ -2140,6 +2149,17 @@ prepareInstall() {
|
|||||||
echo ""
|
echo ""
|
||||||
} | unix2dos > "$target/WINNT.SIF"
|
} | unix2dos > "$target/WINNT.SIF"
|
||||||
|
|
||||||
|
if [[ "$driver" == "2k3" ]]; then
|
||||||
|
{ echo "[Components]"
|
||||||
|
echo " TerminalServer=On"
|
||||||
|
echo ""
|
||||||
|
echo "[LicenseFilePrintData]"
|
||||||
|
echo " AutoMode=PerServer"
|
||||||
|
echo " AutoUsers=5"
|
||||||
|
echo ""
|
||||||
|
} | unix2dos >> "$target/WINNT.SIF"
|
||||||
|
fi
|
||||||
|
|
||||||
{ echo "Windows Registry Editor Version 5.00"
|
{ echo "Windows Registry Editor Version 5.00"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security]"
|
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security]"
|
||||||
@ -2157,18 +2177,12 @@ prepareInstall() {
|
|||||||
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]"
|
echo "[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]"
|
||||||
echo "\"LimitBlankPasswordUse\"=dword:00000000"
|
echo "\"LimitBlankPasswordUse\"=dword:00000000"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\srvWiz]"
|
|
||||||
echo "@=dword:00000000"
|
|
||||||
echo ""
|
|
||||||
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]"
|
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]"
|
||||||
echo "\"RunCount\"=dword:00000000"
|
echo "\"RunCount\"=dword:00000000"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]"
|
echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]"
|
||||||
echo "\"HideFileExt\"=dword:00000000"
|
echo "\"HideFileExt\"=dword:00000000"
|
||||||
echo ""
|
echo ""
|
||||||
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ServerOOBE\SecurityOOBE]"
|
|
||||||
echo "\"DontLaunchSecurityOOBE\"=dword:00000000"
|
|
||||||
echo ""
|
|
||||||
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"
|
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]"
|
||||||
echo "\"DefaultUserName\"=\"$username\""
|
echo "\"DefaultUserName\"=\"$username\""
|
||||||
echo "\"DefaultDomainName\"=\"Dockur\""
|
echo "\"DefaultDomainName\"=\"Dockur\""
|
||||||
@ -2178,15 +2192,31 @@ 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:00000780"
|
echo "\"DefaultSettings.XResolution\"=dword:00000$XHEX"
|
||||||
echo "\"DefaultSettings.YResolution\"=dword:00000438"
|
echo "\"DefaultSettings.YResolution\"=dword:00000$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 ""
|
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\\\"\""
|
||||||
echo "\"ScreenSaverOff\"=\"reg add \\\"HKCU\\\\Control Panel\\\\Desktop\\\" /f /v \\\"ScreenSaveActive\\\" /t REG_SZ /d \\\"0\\\"\""
|
echo "\"ScreenSaverOff\"=\"reg add \\\"HKCU\\\\Control Panel\\\\Desktop\\\" /f /v \\\"ScreenSaveActive\\\" /t REG_SZ /d \\\"0\\\"\""
|
||||||
echo "$oem"
|
echo "$oem"
|
||||||
|
echo ""
|
||||||
} | unix2dos > "$dir/\$OEM\$/install.reg"
|
} | unix2dos > "$dir/\$OEM\$/install.reg"
|
||||||
|
|
||||||
|
if [[ "$driver" == "2k3" ]]; then
|
||||||
|
{ echo "[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\srvWiz]"
|
||||||
|
echo "@=dword:00000000"
|
||||||
|
echo ""
|
||||||
|
echo "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ServerOOBE\SecurityOOBE]"
|
||||||
|
echo "\"DontLaunchSecurityOOBE\"=dword:00000000"
|
||||||
|
echo ""
|
||||||
|
} | unix2dos >> "$dir/\$OEM\$/install.reg"
|
||||||
|
fi
|
||||||
|
|
||||||
{ echo "Set WshShell = WScript.CreateObject(\"WScript.Shell\")"
|
{ echo "Set WshShell = WScript.CreateObject(\"WScript.Shell\")"
|
||||||
echo "Set WshNetwork = WScript.CreateObject(\"WScript.Network\")"
|
echo "Set WshNetwork = WScript.CreateObject(\"WScript.Network\")"
|
||||||
echo "Set oMachine = GetObject(\"WinNT://\" & WshNetwork.ComputerName)"
|
echo "Set oMachine = GetObject(\"WinNT://\" & WshNetwork.ComputerName)"
|
||||||
|
@ -119,10 +119,11 @@ finishInstall() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f "$STORAGE/windows.old"
|
rm -f "$STORAGE/windows.old"
|
||||||
rm -f "$STORAGE/windows.type"
|
rm -f "$STORAGE/windows.vga"
|
||||||
rm -f "$STORAGE/windows.base"
|
rm -f "$STORAGE/windows.base"
|
||||||
rm -f "$STORAGE/windows.boot"
|
rm -f "$STORAGE/windows.boot"
|
||||||
rm -f "$STORAGE/windows.mode"
|
rm -f "$STORAGE/windows.mode"
|
||||||
|
rm -f "$STORAGE/windows.type"
|
||||||
|
|
||||||
cp -f /run/version "$STORAGE/windows.ver"
|
cp -f /run/version "$STORAGE/windows.ver"
|
||||||
|
|
||||||
@ -155,6 +156,10 @@ finishInstall() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${VGA:-}" ] && [[ "${VGA:-}" != "virtio" ]] && [[ "${VGA:-}" != "ramfb" ]]; then
|
||||||
|
echo "$VGA" > "$STORAGE/windows.vga"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
|
if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then
|
||||||
echo "$DISK_TYPE" > "$STORAGE/windows.type"
|
echo "$DISK_TYPE" > "$STORAGE/windows.type"
|
||||||
fi
|
fi
|
||||||
@ -613,6 +618,12 @@ updateXML() {
|
|||||||
local language="$2"
|
local language="$2"
|
||||||
local culture region user admin pass keyboard
|
local culture region user admin pass keyboard
|
||||||
|
|
||||||
|
[ -z "$YRES" ] && YRES="720"
|
||||||
|
[ -z "$XRES" ] && XRES="1280"
|
||||||
|
|
||||||
|
sed -i "s/<VerticalResolution>1080<\/VerticalResolution>/<VerticalResolution>$YRES<\/VerticalResolution>/g" "$asset"
|
||||||
|
sed -i "s/<HorizontalResolution>1920<\/HorizontalResolution>/<HorizontalResolution>$XRES<\/HorizontalResolution>/g" "$asset"
|
||||||
|
|
||||||
culture=$(getLanguage "$language" "culture")
|
culture=$(getLanguage "$language" "culture")
|
||||||
|
|
||||||
if [ -n "$culture" ] && [[ "${culture,,}" != "en-us" ]]; then
|
if [ -n "$culture" ] && [[ "${culture,,}" != "en-us" ]]; then
|
||||||
@ -967,10 +978,14 @@ bootWindows() {
|
|||||||
|
|
||||||
rm -rf "$TMP"
|
rm -rf "$TMP"
|
||||||
|
|
||||||
[[ "${PLATFORM,,}" == "arm64" ]] && VGA="virtio-gpu"
|
if [ -s "$STORAGE/windows.vga" ] && [ -f "$STORAGE/windows.vga" ]; then
|
||||||
|
[ -z "${VGA:-}" ] && VGA=$(<"$STORAGE/windows.vga")
|
||||||
|
else
|
||||||
|
[ -z "${VGA:-}" ] && [[ "${PLATFORM,,}" == "arm64" ]] && VGA="virtio-gpu"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then
|
if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then
|
||||||
DISK_TYPE=$(<"$STORAGE/windows.type")
|
[ -z "${DISK_TYPE:-}" ] && DISK_TYPE=$(<"$STORAGE/windows.type")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then
|
if [ -s "$STORAGE/windows.mode" ] && [ -f "$STORAGE/windows.mode" ]; then
|
||||||
|
@ -3,8 +3,8 @@ set -Eeuo pipefail
|
|||||||
|
|
||||||
: "${SAMBA:="Y"}"
|
: "${SAMBA:="Y"}"
|
||||||
|
|
||||||
[[ "$SAMBA" != [Yy1]* ]] && return 0
|
[[ "$SAMBA" == [Nn]* ]] && return 0
|
||||||
[[ "$NETWORK" != [Yy1]* ]] && return 0
|
[[ "$NETWORK" == [Nn]* ]] && return 0
|
||||||
|
|
||||||
hostname="host.lan"
|
hostname="host.lan"
|
||||||
interface="dockerbridge"
|
interface="dockerbridge"
|
||||||
|
Loading…
Reference in New Issue
Block a user