feat: Implement Windows 95 support (#2165)

This commit is contained in:
Kroese
2026-08-20 04:50:57 +02:00
committed by GitHub
parent afb28c9234
commit eb1befd90e
9 changed files with 1316 additions and 181 deletions
+99 -1
View File
@@ -369,6 +369,12 @@ jobs:
} }
} }
if (-not (Test-Path -LiteralPath "Z:\" -PathType Container)) {
throw "Mapped Z: drive is not available."
}
$driveZ = "ok"
$share = ( $share = (
Get-Content ` Get-Content `
-LiteralPath "\\host.lan\Data\validation.token" ` -LiteralPath "\\host.lan\Data\validation.token" `
@@ -431,6 +437,7 @@ jobs:
version = [string]$windows.Version version = [string]$windows.Version
build = [string]$windows.BuildNumber build = [string]$windows.BuildNumber
platform = $platform platform = $platform
drive_z = $driveZ
oem_file = $oemFile oem_file = $oemFile
share = $share share = $share
share_write = "ok" share_write = "ok"
@@ -590,6 +597,15 @@ jobs:
TestSharedFolder = "ok" TestSharedFolder = "ok"
End Function End Function
Function TestMappedDrive(filesystem)
If Not filesystem.DriveExists("Z:") Then
Err.Raise vbObjectError + 4, "TestMappedDrive", _
"Mapped Z: drive is not available."
End If
TestMappedDrive = "ok"
End Function
Function TestInternet() Function TestInternet()
Dim request Dim request
Dim response Dim response
@@ -647,6 +663,7 @@ jobs:
Dim oemFile Dim oemFile
Dim share Dim share
Dim shareWrite Dim shareWrite
Dim driveZ
Dim internet Dim internet
Dim json Dim json
@@ -685,6 +702,7 @@ jobs:
oemFile = ReadTextFile(filesystem, "C:\OEM\validation.token") oemFile = ReadTextFile(filesystem, "C:\OEM\validation.token")
share = ReadTextFile(filesystem, "\\host.lan\Data\validation.token") share = ReadTextFile(filesystem, "\\host.lan\Data\validation.token")
shareWrite = TestSharedFolder(filesystem, token) shareWrite = TestSharedFolder(filesystem, token)
driveZ = TestMappedDrive(filesystem)
internet = TestInternet() internet = TestInternet()
End If End If
@@ -700,6 +718,7 @@ jobs:
"""oem_file"":""" & EscapeJson(oemFile) & """," & _ """oem_file"":""" & EscapeJson(oemFile) & """," & _
"""share"":""" & EscapeJson(share) & """," & _ """share"":""" & EscapeJson(share) & """," & _
"""share_write"":""" & EscapeJson(shareWrite) & """," & _ """share_write"":""" & EscapeJson(shareWrite) & """," & _
"""drive_z"":""" & EscapeJson(driveZ) & """," & _
"""internet"":""" & EscapeJson(internet) & """" & _ """internet"":""" & EscapeJson(internet) & """" & _
"}" "}"
@@ -779,11 +798,14 @@ jobs:
:retry :retry
if not exist \\host.lan\Data\validation.token goto wait if not exist \\host.lan\Data\validation.token goto wait
if not exist Z:\NUL goto wait
echo TOKEN> C:\OEM\validation.result echo TOKEN> C:\OEM\validation.result
type C:\OEM\validation.token >> C:\OEM\validation.result type C:\OEM\validation.token >> C:\OEM\validation.result
echo SHARE>> C:\OEM\validation.result echo SHARE>> C:\OEM\validation.result
type \\host.lan\Data\validation.token >> C:\OEM\validation.result type \\host.lan\Data\validation.token >> C:\OEM\validation.result
echo DRIVE_Z>> C:\OEM\validation.result
echo ok>> C:\OEM\validation.result
echo VERSION>> C:\OEM\validation.result echo VERSION>> C:\OEM\validation.result
ver >> C:\OEM\validation.result ver >> C:\OEM\validation.result
@@ -940,6 +962,7 @@ jobs:
EXPECTED_PLATFORM: ${{ inputs.platform }} EXPECTED_PLATFORM: ${{ inputs.platform }}
MINIMUM_BUILD: ${{ inputs.minimum_build }} MINIMUM_BUILD: ${{ inputs.minimum_build }}
DISPLAY_NAME: ${{ inputs.name }} DISPLAY_NAME: ${{ inputs.name }}
VERSION: ${{ inputs.version }}
run: | run: |
set -Eeuo pipefail set -Eeuo pipefail
@@ -1094,12 +1117,62 @@ jobs:
return 0 return 0
} }
check_rdp_port() {
local container_ip
local attempt
container_ip="$(
docker inspect \
--format '{{range .NetworkSettings.Networks}}{{println .IPAddress}}{{end}}' \
"$CONTAINER" 2>/dev/null |
head -n 1 || true
)"
if [[ -z "$container_ip" ]]; then
echo "Could not determine the Windows container IP address."
return 1
fi
echo
echo "Checking TCP port 3389 at $container_ip..."
for attempt in {1..30}; do
if timeout 2 bash -c \
"exec 3<>/dev/tcp/$container_ip/3389; exec 3>&-; exec 3<&-" \
2>/dev/null; then
echo "TCP port 3389 is open."
return 0
fi
sleep 2
done
case "${VERSION,,}" in
95 | 98 | me)
echo "::warning::TCP port 3389 is not open for $DISPLAY_NAME; this is allowed."
return 0
;;
esac
echo "TCP port 3389 is not open for $DISPLAY_NAME."
return 1
}
deadline=$((SECONDS + INSTALL_TIMEOUT)) deadline=$((SECONDS + INSTALL_TIMEOUT))
reboot_timeout="$REBOOT_TIMEOUT" reboot_timeout="$REBOOT_TIMEOUT"
minimum_reboots="$MINIMUM_REBOOTS" minimum_reboots="$MINIMUM_REBOOTS"
boot_loop_limit="$BOOT_LOOP_LIMIT" boot_loop_limit="$BOOT_LOOP_LIMIT"
first_bios_start=-1 first_bios_start=-1
version_lower="${VERSION,,}"
case "$version_lower" in
95 | 98 | me)
reboot_timeout=$((REBOOT_TIMEOUT * 2))
echo "Extended first reboot timeout to $((reboot_timeout / 60)) minutes for $DISPLAY_NAME."
;;
esac
while (( SECONDS < deadline )); do while (( SECONDS < deadline )); do
state="$( state="$(
docker inspect \ docker inspect \
@@ -1259,6 +1332,10 @@ jobs:
awk '$0 == "SHARE" { getline; print; exit }' <<< "$basic_response" awk '$0 == "SHARE" { getline; print; exit }' <<< "$basic_response"
)" )"
drive_z="$(
awk '$0 == "DRIVE_Z" { getline; print; exit }' <<< "$basic_response"
)"
version="$( version="$(
awk ' awk '
$0 == "VERSION" { found = 1; next } $0 == "VERSION" { found = 1; next }
@@ -1266,7 +1343,7 @@ jobs:
' <<< "$basic_response" ' <<< "$basic_response"
)" )"
if [[ -z "$oem_file" || -z "$share" || -z "$version" ]] || if [[ -z "$oem_file" || -z "$share" || -z "$drive_z" || -z "$version" ]] ||
! grep -Eq '[0-9]+\.[0-9]+\.[0-9]+' <<< "$version"; then ! grep -Eq '[0-9]+\.[0-9]+\.[0-9]+' <<< "$version"; then
sleep 1 sleep 1
continue continue
@@ -1298,6 +1375,11 @@ jobs:
exit 1 exit 1
fi fi
if [[ "$drive_z" != "ok" ]]; then
echo "The mapped Z: drive test did not succeed."
exit 1
fi
normalized_caption="${version//\(R\)/}" normalized_caption="${version//\(R\)/}"
normalized_expected_caption="${EXPECTED_CAPTION//\(R\)/}" normalized_expected_caption="${EXPECTED_CAPTION//\(R\)/}"
@@ -1332,12 +1414,17 @@ jobs:
exit 1 exit 1
fi fi
if ! check_rdp_port; then
exit 1
fi
echo echo
echo "$DISPLAY_NAME installed successfully." echo "$DISPLAY_NAME installed successfully."
echo "Version: $version_number" echo "Version: $version_number"
echo "Build: $build" echo "Build: $build"
echo "OEM files: copied successfully" echo "OEM files: copied successfully"
echo "Shared folder: readable and writable" echo "Shared folder: readable and writable"
echo "Mapped Z: drive: available"
exit 0 exit 0
fi fi
@@ -1371,6 +1458,7 @@ jobs:
oem_file="$(jq -r '.oem_file // empty' <<< "$response")" oem_file="$(jq -r '.oem_file // empty' <<< "$response")"
share="$(jq -r '.share // empty' <<< "$response")" share="$(jq -r '.share // empty' <<< "$response")"
share_write="$(jq -r '.share_write // empty' <<< "$response")" share_write="$(jq -r '.share_write // empty' <<< "$response")"
drive_z="$(jq -r '.drive_z // empty' <<< "$response")"
internet="$(jq -r '.internet // empty' <<< "$response")" internet="$(jq -r '.internet // empty' <<< "$response")"
if [[ "$token" != "$EXPECTED_TOKEN" ]]; then if [[ "$token" != "$EXPECTED_TOKEN" ]]; then
@@ -1401,6 +1489,11 @@ jobs:
exit 1 exit 1
fi fi
if [[ "$drive_z" != "ok" ]]; then
echo "The mapped Z: drive test did not succeed."
exit 1
fi
if [[ "$internet" != "ok" ]]; then if [[ "$internet" != "ok" ]]; then
echo "The guest internet connection test did not succeed." echo "The guest internet connection test did not succeed."
exit 1 exit 1
@@ -1451,6 +1544,10 @@ jobs:
exit 1 exit 1
fi fi
if ! check_rdp_port; then
exit 1
fi
echo echo
echo "$DISPLAY_NAME installed successfully." echo "$DISPLAY_NAME installed successfully."
echo "Version: $version" echo "Version: $version"
@@ -1458,6 +1555,7 @@ jobs:
echo "Platform: $platform" echo "Platform: $platform"
echo "OEM files: copied successfully" echo "OEM files: copied successfully"
echo "Shared folder: readable and writable" echo "Shared folder: readable and writable"
echo "Mapped Z: drive: available"
echo "Internet connection: accessible" echo "Internet connection: accessible"
exit 0 exit 0
fi fi
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
tunnel_delay: 1800 tunnel_delay: 1800
kill_on_failure: true kill_on_failure: true
install_timeout: 9000 install_timeout: 9000
reboot_timeout: 1800 reboot_timeout: 18000
minimum_reboots: 1 minimum_reboots: 1
boot_loop_limit: 10 boot_loop_limit: 10
expected_caption: ${{ inputs.expected_caption }} expected_caption: ${{ inputs.expected_caption }}
+53 -5
View File
@@ -526,17 +526,28 @@ updateAutologinXML() {
return 0 return 0
} }
usesWscriptLogonLauncher() {
case "${DETECTED,,}" in
"winvista"* | "win7"* | "win2008r2"* ) return 0 ;;
esac
return 1
}
updateLogonCommandXML() { updateLogonCommandXML() {
local asset="$1" local asset="$1"
case "${DETECTED,,}" in
"winvista"* ) return 0 ;;
esac
local command="$XML_COMPONENT_SHELL_OOBE/u:FirstLogonCommands/u:SynchronousCommand/u:CommandLine" local command="$XML_COMPONENT_SHELL_OOBE/u:FirstLogonCommands/u:SynchronousCommand/u:CommandLine"
local expected='cmd.exe /d /c call "%WINDIR%\Setup\Scripts\SetupComplete.cmd" logon' local expected='cmd.exe /d /c call "%WINDIR%\Setup\Scripts\SetupComplete.cmd" logon'
local hidden="powershell.exe -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -Command \"& \$env:ComSpec /d /c ('call ' + [char]34 + \$env:WINDIR + '\Setup\Scripts\SetupComplete.cmd' + [char]34 + ' logon'); exit \$LASTEXITCODE\"" local hidden
if usesWscriptLogonLauncher; then
hidden='wscript.exe //B //NoLogo C:\Windows\Setup\Scripts\RunHidden.vbs'
else
hidden="powershell.exe -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -Command \"\$cmd = 'call ' + [char]34 + \$env:WINDIR + '\Setup\Scripts\SetupComplete.cmd' + [char]34 + ' logon'; & \$env:ComSpec /d /c \$cmd; exit \$LASTEXITCODE\""
fi
local count value local count value
count=$(getXMLNodeCount "$asset" "$command") || return 1 count=$(getXMLNodeCount "$asset" "$command") || return 1
@@ -1957,12 +1968,49 @@ prepareSetupScript() {
[ -n "$staged" ] || return 0 [ -n "$staged" ] || return 0
stageHiddenLogonLauncher "$stage" || return 1
updateSetupScript "$staged" "$asset" || return 1 updateSetupScript "$staged" "$asset" || return 1
finalizeSetupScript "$staged" || return 1 finalizeSetupScript "$staged" || return 1
return 0 return 0
} }
stageHiddenLogonLauncher() {
local stage="$1"
usesWscriptLogonLauncher || return 0
local target="$stage/\$OEM\$/\$\$/Setup/Scripts/RunHidden.vbs"
if ! mkdir -p "$(dirname "$target")"; then
error "Failed to create hidden logon launcher directory!"
return 1
fi
if ! cat > "$target" <<'EOF'
Option Explicit
Dim shell, command, result
Set shell = CreateObject("WScript.Shell")
command = shell.ExpandEnvironmentStrings("%ComSpec% /d /c call " & Chr(34) & "%WINDIR%\Setup\Scripts\SetupComplete.cmd" & Chr(34) & " logon")
result = shell.Run(command, 0, True)
WScript.Quit result
EOF
then
error "Failed to create hidden logon launcher!"
return 1
fi
if ! unix2dos -q "$target"; then
error "Failed to convert hidden logon launcher to DOS format!"
return 1
fi
return 0
}
updateSetupScript() { updateSetupScript() {
local script="$1" local script="$1"
+1033 -95
View File
File diff suppressed because it is too large Load Diff
+2 -18
View File
@@ -113,9 +113,9 @@ parseVersion() {
VERSION="win2019-hv" ;; VERSION="win2019-hv" ;;
"2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" ) "2012" | "2012r2" | "win2012" | "win2012r2" | "windows2012" | "windows 2012" )
VERSION="win2012r2-eval" ;; VERSION="win2012r2-eval" ;;
"2008" | "2008r2" | "win2008" | "win2008r2" | "windows2008" | "windows 2008" ) "2008" | "2008r2" | "2k8" | "win2008" | "win2008r2" | "windows2008" | "windows 2008" )
VERSION="win2008r2" ;; VERSION="win2008r2" ;;
"2003" | "2003r2" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" ) "2003" | "2003r2" | "2k3" | "win2003" | "win2003r2" | "windows2003" | "windows 2003" )
VERSION="win2003r2" ;; VERSION="win2003r2" ;;
"core11" | "core 11" ) "core11" | "core 11" )
VERSION="core11" VERSION="core11"
@@ -875,22 +875,6 @@ supportsSIF() {
return 1 return 1
} }
supportsACPI() {
local id="$1"
case "${id,,}" in
"reactos" )
# If the ISO is a Live-CD it will ignore ACPI signals.
hasSystemImage && return 1 ;;
esac
return 0
}
supportsBootKey() { supportsBootKey() {
local id="$1" local id="$1"
+67 -14
View File
@@ -388,7 +388,7 @@ finishInstall() {
local aborted="$2" local aborted="$2"
local boot="$3" local boot="$3"
local base secure=0 local base file bios target
if ! hasImage "$iso"; then if ! hasImage "$iso"; then
error "Failed to find ISO file: $iso" && return 1 error "Failed to find ISO file: $iso" && return 1
@@ -400,7 +400,7 @@ finishInstall() {
fi fi
fi fi
local file="$STORAGE/windows.ver" file="$(stateFile "ver")"
cp -f /etc/version "$file" || { cp -f /etc/version "$file" || {
error "Failed to save the Windows installation version!" error "Failed to save the Windows installation version!"
return 1 return 1
@@ -435,17 +435,16 @@ finishInstall() {
# Aborted Win11 installs boot without any answer file present, # Aborted Win11 installs boot without any answer file present,
# so enable Secure Boot and TPM to satisfy its hardware checks. # so enable Secure Boot and TPM to satisfy its hardware checks.
if enabled "$aborted" || enabled "$MANUAL"; then if enabled "$aborted" || enabled "$MANUAL"; then
[[ "${DETECTED,,}" == "win11"* ]] && secure=1
fi
if (( secure )); then if [[ "${DETECTED,,}" == "win11"* ]]; then
BOOT_MODE="windows_secure" BOOT_MODE="windows_secure"
writeState "mode" "$BOOT_MODE" || { writeState "mode" "$BOOT_MODE" || {
error "Failed to save the Windows boot mode!" error "Failed to save the Windows boot mode!"
return 1 return 1
} }
fi
fi fi
fi fi
@@ -460,12 +459,12 @@ finishInstall() {
if [[ "$SYSTEM" == "$TMP/"* ]]; then if [[ "$SYSTEM" == "$TMP/"* ]]; then
if ! mv -f -- "$SYSTEM" "$STORAGE/windows.img"; then if ! mv -f -- "$SYSTEM" "$(stateFile "img")"; then
error "Failed to finalize the Windows system image!" error "Failed to finalize the Windows system image!"
return 1 return 1
fi fi
BOOT="$STORAGE/windows.img" BOOT="$(stateFile "img")"
else else
@@ -481,6 +480,36 @@ finishInstall() {
BOOT="$SYSTEM" BOOT="$SYSTEM"
fi fi
if ! setOwner "$BOOT"; then
warn "failed to set the owner for \"$BOOT\" !"
fi
fi
if [ -n "${BIOS:-}" ]; then
bios="$(stateFile "bios")"
target="${bios}.tmp"
if ! cp -f -- "$BIOS" "$target"; then
rm -f -- "$target"
error "Failed to copy the BIOS file!"
return 1
fi
if ! mv -f -- "$target" "$bios"; then
rm -f -- "$target"
error "Failed to finalize the BIOS file!"
return 1
fi
BIOS="$bios"
if ! setOwner "$BIOS"; then
warn "failed to set the owner for \"$BIOS\" !"
fi
fi fi
if ! rm -rf -- "$TMP"; then if ! rm -rf -- "$TMP"; then
@@ -964,9 +993,33 @@ isLegacyBoot() {
[[ "${BOOT_MODE,,}" == "windows_legacy" ]] [[ "${BOOT_MODE,,}" == "windows_legacy" ]]
} }
hasMarker() {
[ -f "$(stateFile "$1")" ]
}
hasBootMarker() { hasBootMarker() {
[ -f "$STORAGE/windows.boot" ] [ -f "$(stateFile "boot")" ]
}
createMarker() {
local marker
marker="$(stateFile "$1")"
if ! touch "$marker"; then
warn "failed to create marker \"$marker\" !"
return 1
fi
if ! setOwner "$marker"; then
rm -f "$marker"
warn "failed to set the owner for \"$marker\" !"
return 1
fi
return 0
} }
hasImage() { hasImage() {
@@ -991,7 +1044,7 @@ getSystemImage() {
return 0 return 0
fi fi
image="$STORAGE/windows.img" image="$(stateFile "img")"
hasImage "$image" || return 1 hasImage "$image" || return 1
echo "$image" echo "$image"
+27 -12
View File
@@ -15,7 +15,6 @@ setMachine() {
return 1 return 1
fi fi
writeState "vga" "std" || return 1
writeState "mode" "windows_legacy" || return 1 writeState "mode" "windows_legacy" || return 1
case "${id,,}" in case "${id,,}" in
@@ -23,25 +22,27 @@ setMachine() {
"win9"* | "winnt4" | "win2k"* | "reactos" ) "win9"* | "winnt4" | "win2k"* | "reactos" )
writeState "old" "pc" || return 1 writeState "old" "pc" || return 1
writeState "type" "auto" || return 1 writeState "type" "auto" || return 1 ;;
esac esac
case "${id,,}" in case "${id,,}" in
"win95" | "winnt4" ) "winnt4" | "win2k"* )
writeState "vga" "cirrus" || return 1 ;;
*) writeState "vga" "std" || return 1 ;;
esac
case "${id,,}" in
"win9"* | "winnt4" )
writeState "usb" "N" || return 1 writeState "usb" "N" || return 1
writeState "port" "on" || return 1 writeState "port" "on" || return 1
writeState "net" "pcnet" || return 1 writeState "net" "pcnet" || return 1
writeState "sound" "sb16" || return 1 ;; writeState "sound" "AC97" || return 1 ;;
"win98" | "win9x" )
writeState "port" "on" || return 1
writeState "net" "pcnet" || return 1
writeState "sound" "sb16" || return 1
writeState "usb" "pci-ohci" || return 1 ;;
"win2k"* ) "win2k"* )
@@ -63,13 +64,23 @@ setMachine() {
if isReactOSLiveCD "$iso"; then if isReactOSLiveCD "$iso"; then
SYSTEM="$iso" SYSTEM="$iso"
createMarker "kill" || return 1
fi ;; fi ;;
esac esac
fi fi
restoreBootMode || return 1
restoreMachine || return 1 restoreMachine || return 1
restoreBootMode || return 1
case "${id,,}" in
"win95" | "winnt4" )
# Windows 95 does not support ACPI so disable graceful shutdown
createMarker "kill" || return 1 ;;
esac
case "${id,,}" in case "${id,,}" in
@@ -135,6 +146,10 @@ restoreMachineState() {
restoreState "CPU_MODEL" "cpu" || return 1 restoreState "CPU_MODEL" "cpu" || return 1
restoreState "DISK_TYPE" "type" || return 1 restoreState "DISK_TYPE" "type" || return 1
if [ -z "${BIOS:-}" ] && [ -s "$(stateFile "bios")" ]; then
BIOS="$(stateFile "bios")"
fi
mergeState "CPU_FLAGS" "flag" "," || return 1 mergeState "CPU_FLAGS" "flag" "," || return 1
mergeState "ARGUMENTS" "args" " " || return 1 mergeState "ARGUMENTS" "args" " " || return 1
+9 -24
View File
@@ -398,18 +398,7 @@ markWindowsBooted() {
# now booting from the installed disk rather than from setup media. # now booting from the installed disk rather than from setup media.
ready || return 0 ready || return 0
local marker="$STORAGE/windows.boot" createMarker "boot" || return 0
if ! touch "$marker"; then
warn "failed to create Windows installation marker!"
return 0
fi
if ! setOwner "$marker"; then
rm -f "$marker"
warn "failed to set the owner for \"$marker\" !"
return 0
fi
if ! disabled "$REMOVE"; then if ! disabled "$REMOVE"; then
case "${BOOT,,}" in case "${BOOT,,}" in
@@ -506,20 +495,16 @@ gracefulShutdown() {
finish "$code" finish "$code"
fi fi
if ! supportsACPI "$DETECTED"; then if hasMarker "kill"; then
if [[ "${DETECTED,,}" != "reactos" ]]; then
info "This $(app) version does not support ACPI shutdown, decreasing timeout to 10 seconds..." info "This $(app) version does not support ACPI shutdown, decreasing timeout to 1 second..."
TIMEOUT=13 TIMEOUT=7
else
info "ReactOS LiveCD does not support ACPI shutdown, decreasing timeout to 1 second..." elif ! ready || { hasSystemImage && ! hasBootMarker; }; then
TIMEOUT=7
fi
elif hasSystemImage && ! hasBootMarker; then
info "$(app) will ignore ACPI signals during setup, decreasing timeout to 10 seconds..."
TIMEOUT=13
elif ! ready; then
info "$(app) will ignore ACPI signals during setup, decreasing timeout to 10 seconds..." info "$(app) will ignore ACPI signals during setup, decreasing timeout to 10 seconds..."
TIMEOUT=13 TIMEOUT=13
fi fi
normalizeTimeout 105 normalizeTimeout 105
+25 -11
View File
@@ -10,6 +10,9 @@ SIFInstall() {
local shortcut="Y" local shortcut="Y"
local drivers="/tmp/drivers" local drivers="/tmp/drivers"
local msg="Preparing $desc installation..."
info "$msg" && html "$msg"
if disabled "$SHORTCUT" || disabled "${SAMBA:-Y}"; then if disabled "$SHORTCUT" || disabled "${SAMBA:-Y}"; then
shortcut="N" shortcut="N"
fi fi
@@ -69,8 +72,8 @@ SIFInstall() {
oem=$(writeCommand "$install") || return 1 oem=$(writeCommand "$install") || return 1
[ -z "$WIDTH" ] && WIDTH="1280" [ -z "$WIDTH" ] && WIDTH="1024"
[ -z "$HEIGHT" ] && HEIGHT="720" [ -z "$HEIGHT" ] && HEIGHT="768"
validateResolution "WIDTH" "$WIDTH" 320 || return 1 validateResolution "WIDTH" "$WIDTH" 320 || return 1
validateResolution "HEIGHT" "$HEIGHT" 200 || return 1 validateResolution "HEIGHT" "$HEIGHT" 200 || return 1
@@ -551,7 +554,7 @@ writeSIF() {
' AutoPartition=1' \ ' AutoPartition=1' \
' MsDosInitiated="0"' \ ' MsDosInitiated="0"' \
' UnattendedInstall="Yes"' \ ' UnattendedInstall="Yes"' \
' AutomaticUpdates="Yes"' \ ' AutomaticUpdates="No"' \
'' \ '' \
'[Unattended]' \ '[Unattended]' \
' UnattendSwitch=Yes' \ ' UnattendSwitch=Yes' \
@@ -658,6 +661,9 @@ writeRegistry() {
'[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc]' \ '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc]' \
'"Start"=dword:00000004' \ '"Start"=dword:00000004' \
'' \ '' \
'[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]' \
'"NoAutoUpdate"=dword:00000001' \
'' \
'[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List]' \ '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List]' \
'"3389:TCP"="3389:TCP:*:Enabled:@xpsp2res.dll,-22009"' \ '"3389:TCP"="3389:TCP:*:Enabled:@xpsp2res.dll,-22009"' \
'' \ '' \
@@ -712,6 +718,7 @@ appendRegistry() {
'[HKEY_CURRENT_USER\Control Panel\Desktop]' \ '[HKEY_CURRENT_USER\Control Panel\Desktop]' \
'"SCRNSAVE.EXE"="off"' \ '"SCRNSAVE.EXE"="off"' \
'"ScreenSaveActive"="0"' \ '"ScreenSaveActive"="0"' \
'"DragFullWindows"="1"' \
'"MenuShowDelay"="100"' \ '"MenuShowDelay"="100"' \
'' \ '' \
'[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]' \ '[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]' \
@@ -733,6 +740,12 @@ appendRegistry() {
if [[ "$driver" == "2k" ]]; then if [[ "$driver" == "2k" ]]; then
{ {
printf '%s\n' \ printf '%s\n' \
'[HKEY_CURRENT_USER\Control Panel\PowerCfg]' \
'"CurrentPowerPolicy"="3"' \
'' \
'[HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\3]' \
'"Policies"=hex:01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,32,32,00,00,04,00,00,00,04,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,64,64,64,64,00,00' \
'' \
'[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Runonce]' \ '[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Runonce]' \
'"^SetupICWDesktop"=-' '' '"^SetupICWDesktop"=-' ''
} | unix2dos >> "$dir/\$OEM\$/install.reg" || return 1 } | unix2dos >> "$dir/\$OEM\$/install.reg" || return 1
@@ -857,15 +870,16 @@ writeVBS() {
'Set FSO = WScript.CreateObject("Scripting.FileSystemObject")' \ 'Set FSO = WScript.CreateObject("Scripting.FileSystemObject")' \
'PowerCfg = Shell.ExpandEnvironmentStrings("%SystemRoot%\System32\POWERCFG.EXE")' \ 'PowerCfg = Shell.ExpandEnvironmentStrings("%SystemRoot%\System32\POWERCFG.EXE")' \
'' \ '' \
'Shell.RegWrite "HKCU\Control Panel\Desktop\SCRNSAVE.EXE", "off", "REG_SZ"' \
'Shell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveActive", "0", "REG_SZ"' \
'' \
'If FSO.FileExists(PowerCfg) Then' \ 'If FSO.FileExists(PowerCfg) Then' \
' Err.Clear' \ ' Policy = 3' \
' Policy = Shell.RegRead("HKCU\Control Panel\PowerCfg\CurrentPowerPolicy")' \ ' Cmd = Chr(34) & PowerCfg & Chr(34) & " /CHANGE " & Policy & " /NUMERICAL "' \
' If Err.Number = 0 Then' \ ' For Each Setting In Array("/monitor-timeout-ac", "/monitor-timeout-dc", "/disk-timeout-ac", "/disk-timeout-dc", "/standby-timeout-ac", "/standby-timeout-dc")' \
' Cmd = Chr(34) & PowerCfg & Chr(34) & " /CHANGE " & Policy & " /NUMERICAL "' \ ' Shell.Run Cmd & Setting & " 0", 0, True' \
' For Each Setting In Array("/monitor-timeout-ac", "/monitor-timeout-dc", "/disk-timeout-ac", "/disk-timeout-dc", "/standby-timeout-ac", "/standby-timeout-dc")' \ ' Next' \
' Shell.Run Cmd & Setting & " 0", 0, True' \ ' Shell.Run Chr(34) & PowerCfg & Chr(34) & " /SETACTIVE 3 /NUMERICAL", 0, True' \
' Next' \
' End If' \
'End If' \ 'End If' \
'' ''
} | unix2dos > "$power" || return 1 } | unix2dos > "$power" || return 1