@echo off echo DOSBox-X + Windows 3.11 ENG autoinstaller echo. echo This installed DOES NOT provide Windows 3.11 files. echo. echo You need to place your own installation files in .\installers\INST311 directory. echo. echo You can either copy all files from the floppy disks to .\installers\INST311 directory, echo or copy disk images in .IMG format to .\installers\INST311 echo. echo Only English Windows 3.11 version will work with this script. echo Other files - redistributables, updates and configuration files - will be downloaded automatically. echo. echo If required Windows 3.11 files are not present, you will be prompted to copy them to appropriate directory. echo. if not "%1"=="quiet" pause pushd "%~dp0" cd .. cd .. cd installers SET DBOXIN=%CD% cd 7-zip SET ZPATH=%CD% pushd "%~dp0" if not exist "%~dp0\INSTALLERS\" ( mkdir "%~dp0\INSTALLERS" ) if not exist "%~dp0\INSTALLERS\INST311\gdi.ex_" ( if not exist "%~dp0\INSTALLERS\INST311\*.img" ( mkdir "%~dp0\INSTALLERS\INST311" echo "" > "%~dp0\INSTALLERS\INST311\_PLACE_WIN311_FILES_HERE_" echo. echo Windows 3.11 files not found. Please copy them from floppy disks or place disk images here. timeout /t 1 > nul cd "%~dp0\INSTALLERS\INST311\" start. cd "%~dp0" echo. pause ) ) if not exist "%ZPATH%\7zr.exe" ( mkdir .\installers\7-zip echo Downloading 7-zip powershell wget https://www.7-zip.org/a/7zr.exe -UseBasicParsing -OutFile "%~dp0\installers\7-zip\7zr.exe" powershell wget https://www.7-zip.org/a/7z2201.exe -UseBasicParsing -OutFile "%~dp0\installers\7-zip\7z2201.exe" "%~dp0\installers\7-zip\7zr.exe" x "%~dp0\installers\7-zip\7z2201.exe" -aoa -o"%~dp0\installers\7-zip" ) if not exist "%ZPATH%\7z.exe" ( "%~dp0\installers\7-zip\7zr.exe" x "%~dp0\installers\7-zip\7z2201.exe" -aoa -o"%~dp0\installers\7-zip" ) if exist "%~dp0\INSTALLERS\INST311\*.img" ( if not exist "%~dp0\INSTALLERS\INST311\gdi.ex_" ( cd "%~dp0\INSTALLERS\INST311\" "%ZPATH%\7z.exe" x *.img -o. ) ) pushd "%~dp0" if not exist "%~dp0\dosbox-x.exe" ( if not exist "%DBOXIN%\dosbox-x-mingw*."%tempfile%" powershell "$dpi = try { (Get-ItemPropertyValue -Path 'HKCU:\Control Panel\Desktop' -Name 'LogPixels') } catch { try { powershell (Get-ItemPropertyValue -Path 'HKCU:\Control Panel\Desktop\WindowMetrics' -Name 'AppliedDPI') } catch { 96 } } ; if ($dpi -In -999..113) { echo 640x480 } ; if ($dpi -In 114..134) { echo 800x600 } ; if ($dpi -In 135..164) { echo 960x720 } ; if ($dpi -In 165..182) { echo 1120x840 } ; if ($dpi -In 183..999) { echo 1280x960 } " set /p RESOLUTIONSTRING=<"%tempfile%" del /q "%tempfile%" echo Scaling 640x480 to: echo %RESOLUTIONSTRING% powershell "Get-Content 'dosbox-x.conf' | Foreach-Object {$_ -replace '^windowresolution.+$','windowresolution = %RESOLUTIONSTRING%'} | Set-Content 'dosbox-x.new'" if exist "dosbox-x.new" ( del /Q dosbox-x.conf.bak rename dosbox-x.conf dosbox-x.conf.bak rename dosbox-x.new dosbox-x.conf ) echo Done if not "%1"=="quiet" pause