From afa55b476c17e1cfb72fe6dab6dd6c38ce498334 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 21 Aug 2026 19:30:23 +0200 Subject: [PATCH] feat: Disable menu animations on NT5 and Win9x (#2177) --- src/batch.sh | 18 ++++++++++++++---- src/sif.sh | 47 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/src/batch.sh b/src/batch.sh index 8a0d943c..f9c552cc 100644 --- a/src/batch.sh +++ b/src/batch.sh @@ -2100,7 +2100,8 @@ writeWin9xAnswerFile() { '[Install]' \ "CopyFiles=$copyFiles" \ "UpdateInis=$updateInis" \ - "AddReg=$addReg" + "AddReg=$addReg" \ + 'BitReg=Win9x.DisableAnimationsDefault' if [ -n "$installDelReg" ]; then printf '%s\n' "DelReg=$installDelReg" @@ -2189,7 +2190,8 @@ writeWin9xAnswerFile() { printf '%s\n' \ '' \ '[Win9x.FirstLogon]' \ - "AddReg=$firstLogonAddReg" + "AddReg=$firstLogonAddReg" \ + 'BitReg=Win9x.DisableAnimations' if [ -n "$firstLogonDelReg" ]; then printf '%s\n' "DelReg=$firstLogonDelReg" @@ -2480,7 +2482,7 @@ writeWin9xUserRegistry() { 'HKU,".DEFAULT\Control Panel\Desktop","SCRNSAVE.EXE",,""' \ 'HKU,".DEFAULT\Control Panel\Desktop","ScreenSaveActive",,"0"' \ 'HKU,".DEFAULT\Control Panel\Desktop","DragFullWindows",,"1"' \ - 'HKU,".DEFAULT\Control Panel\Desktop","MenuShowDelay",,"100"' \ + 'HKU,".DEFAULT\Control Panel\Desktop","MenuShowDelay",,"0"' \ 'HKU,".DEFAULT\Control Panel\Desktop","FontSmoothing",,"1"' \ 'HKU,".DEFAULT\Control Panel\Desktop","SmoothScroll",0x00010001,0' \ 'HKU,".DEFAULT\Control Panel\Desktop\WindowMetrics","MinAnimate",,"0"' \ @@ -2506,7 +2508,7 @@ writeWin9xUserRegistry() { 'HKCU,"Control Panel\Desktop","SCRNSAVE.EXE",,""' \ 'HKCU,"Control Panel\Desktop","ScreenSaveActive",,"0"' \ 'HKCU,"Control Panel\Desktop","DragFullWindows",,"1"' \ - 'HKCU,"Control Panel\Desktop","MenuShowDelay",,"100"' \ + 'HKCU,"Control Panel\Desktop","MenuShowDelay",,"0"' \ 'HKCU,"Control Panel\Desktop","FontSmoothing",,"1"' \ 'HKCU,"Control Panel\Desktop","SmoothScroll",0x00010001,0' \ 'HKCU,"Control Panel\Desktop\WindowMetrics","MinAnimate",,"0"' \ @@ -2525,6 +2527,14 @@ writeWin9xUserRegistry() { 'HKCU,"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer","StartMenuLogOff",0x00010001,1' fi fi + + printf '%s\n' \ + '' \ + '[Win9x.DisableAnimationsDefault]' \ + 'HKU,".DEFAULT\Control Panel\Desktop","UserPreferencesMask",0,0x02,0' \ + '' \ + '[Win9x.DisableAnimations]' \ + 'HKCU,"Control Panel\Desktop","UserPreferencesMask",0,0x02,0' } writeWin9xMachineRegistry() { diff --git a/src/sif.sh b/src/sif.sh index c27b2f19..409ec4c6 100644 --- a/src/sif.sh +++ b/src/sif.sh @@ -160,9 +160,10 @@ SIFInstall() { "$product" "$sifHost" "$sifUsername" "$sifPassword" "$sifOrganization" "$sifWorkgroup" \ "$localeID" "$inputLocaleID" "$keyboardID" "$timezone" || return 1 - writeRegistry "$dir" "$shortcut" "$oem" "$regUsername" "$regPassword" || return 1 + writeRegistry "$dir" "$shortcut" "$oem" "$regUsername" "$regPassword" "$driver" || return 1 appendRegistry "$dir" "$driver" || return 1 + writeNT5Effects "$dir" || return 1 writeVBS "$dir" "$username" "$shortcut" "$driver" || return 1 return 0 @@ -748,6 +749,9 @@ writeSIF() { local inputLocaleID="${10}" local keyboardID="${11}" local timezone="${12}" + local bitsPerPel=32 + + [[ "$driver" == "2k3" ]] && bitsPerPel=16 find "$target" -maxdepth 1 -type f -iname winnt.sif -delete || return 1 @@ -807,7 +811,7 @@ writeSIF() { " JoinWorkgroup = \"$sifWorkgroup\"" \ '' \ '[Display]' \ - ' BitsPerPel=32' \ + " BitsPerPel=$bitsPerPel" \ " XResolution=$WIDTH" \ " YResolution=$HEIGHT" \ '' \ @@ -850,6 +854,10 @@ writeRegistry() { local oem="$3" local regUsername="$4" local regPassword="$5" + local driver="$6" + local bitsPerPelHex="00000020" + + [[ "$driver" == "2k3" ]] && bitsPerPelHex="00000010" { printf '%s\n' \ @@ -904,12 +912,12 @@ writeRegistry() { printf '%s\n' \ '' \ '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]' \ - '"DefaultSettings.BitsPerPel"=dword:00000020' \ + "\"DefaultSettings.BitsPerPel\"=dword:$bitsPerPelHex" \ "\"DefaultSettings.XResolution\"=dword:$XHEX" \ "\"DefaultSettings.YResolution\"=dword:$YHEX" \ '' \ '[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Control\VIDEO\{23A77BF7-ED96-40EC-AF06-9B1F4867732A}\0000]' \ - '"DefaultSettings.BitsPerPel"=dword:00000020' \ + "\"DefaultSettings.BitsPerPel\"=dword:$bitsPerPelHex" \ "\"DefaultSettings.XResolution\"=dword:$XHEX" \ "\"DefaultSettings.YResolution\"=dword:$YHEX" \ '' \ @@ -933,7 +941,7 @@ appendRegistry() { '"SCRNSAVE.EXE"="off"' \ '"ScreenSaveActive"="0"' \ '"DragFullWindows"="1"' \ - '"MenuShowDelay"="100"' \ + '"MenuShowDelay"="0"' \ '' \ '[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]' \ '"MinAnimate"="0"' \ @@ -993,6 +1001,34 @@ appendRegistry() { return 0 } +writeNT5Effects() { + + local dir="$1" + local target="$dir/\$OEM\$/effects.inf" + + { + printf '%s\n' \ + '[Version]' \ + "Signature=\"\$CHICAGO\$\"" \ + '' \ + '[DefaultInstall]' \ + 'BitReg=DisableAnimations' \ + '' \ + '[DisableAnimations]' \ + '; Fade or slide menus into view' \ + 'HKCU,"Control Panel\Desktop","UserPreferencesMask",0,0x02,0' \ + '' \ + '; Fade out menu items after clicking' \ + 'HKCU,"Control Panel\Desktop","UserPreferencesMask",0,0x04,1' \ + '' \ + '; Fade or slide ToolTips into view' \ + 'HKCU,"Control Panel\Desktop","UserPreferencesMask",0,0x08,1' \ + '' + } | unix2dos > "$target" || return 1 + + return 0 +} + writeVBS() { local dir="$1" @@ -1092,6 +1128,7 @@ writeVBS() { printf '%s\n' \ '[COMMANDS]' \ '"REGEDIT /s install.reg"' \ + '"RUNDLL32.EXE setupapi.dll,InstallHinfSection DefaultInstall 128 effects.inf"' \ '"Wscript install.vbs"' \ '' } | unix2dos > "$dir/\$OEM\$/cmdlines.txt" || return 1