REM +=======================================================+ REM | Comment out what you don't need. These are mostly | REM | examples to give you an idea of how it all works. | REM +=======================================================+ REM +=======================================================+ REM | Finding CDROM driveletter | REM |-------------------------------------------------------| set tagfile=\WIN51 for %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:%tagfile%" set CDDRIVE=%%i: REM +=======================================================+ REM +=======================================================+ REM | We should be already in system32, this is just to be | REM | sure | REM |-------------------------------------------------------| %SystemDrive% cd %SystemRoot%\system32 REM +=======================================================+ REM +=======================================================+ REM | Trick Windows into identifying the original setup.exe | REM | deleting the setup.exe will not work, just rename it | REM |-------------------------------------------------------| if exist setup.exe ren setup.exe setupold.exe if exist setupORG.exe ren setupORG.exe setup.exe REM +=======================================================+ REM +=======================================================+ REM | Do other stuff like copying useful tools (optional) | REM |-------------------------------------------------------| cd %SystemRoot%\system32 %CDDRIVE%\OEM\bin\7za.exe x -y -aoa %CDDRIVE%\OEM\data\System32.7z REM +=======================================================+ REM +=======================================================+ REM | If you are using compressed drivers unpack them here: | REM |-------------------------------------------------------| %SystemDrive% cd \ %CDDRIVE%\OEM\bin\7za.exe x -y -aoa %CDDRIVE%\OEM\drivers.7z REM +=======================================================+ REM +=======================================================+ REM | Scanning for driverdirectories | REM | ONLY USE ONE OF THE FOLLOWING COMMANDS, NOT BOTH! | REM |-------------------------------------------------------| REM | This one is for uncompressed drivers on the CD | REM %CDDRIVE%\OEM\bin\SetDevicePath.exe %CDDRIVE%\OEM\drivers REM | This one is for your unpacked drivers on your HD | %CDDRIVE%\OEM\bin\SetDevicePath.exe %SystemDrive%\drivers REM +=======================================================+ REM +=======================================================+ REM | Enable installation of unsigned drivers | REM |-------------------------------------------------------| start %CDDRIVE%\OEM\bin\WatchDriverSigningPolicy.exe REM +=======================================================+ REM +=======================================================+ REM | Prepare later installations (optional) | REM |-------------------------------------------------------| SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY%\998 /V 1 /D "%CDDRIVE%\OEM\bin\t-13_install.cmd" /F REG ADD %KEY%\999 /V 1 /D "REG ADD %KEY%\zzz999 /V 1 /D %CDDRIVE%\OEM\bin\postinstall.cmd /F" /F REM +=======================================================+ REM +=======================================================+ REM | Finally start the installation with the originally | REM | given parameters | REM |-------------------------------------------------------| start /WAIT setup.exe %* REM +=======================================================+ REM +=======================================================+ REM | Cleanup | RD /Q /S %SystemDrive%\drivers REM | Reset DevicePath | REM +=======================================================+