REM +==========================================================================+
REM |                                                                          |
REM |   This presetup.cmd file was dynamically generated by the DriverPacks    |
REM |   BASE, to work with the DriverPacks without any further editing.        |
REM |   However, if you would like to add some custom functionality, you can   |
REM |   edit this file without any problems. Just take into record that this   |
REM |   file will be erased if you run the DriverPacks BASE on these Windows   |
REM |   installation files again!                                              |
REM |                                                                          |
REM |   With special thanks to:                                                |
REM |   -Pyron, a06lp and iLE for their help with this method;                 |
REM |   -schalti for the optional 'Keep the Drivers' system and Pyron (again)  |
REM |    for turning it into an executable.                                    |
REM |   -SuperTibaldoKart for creating un7zip.exe                              |
REM |                                                                          |
REM +==========================================================================+

If exist "%systemroot%\system32\setupold.exe" DEL /F "%systemroot%\system32\setupold.exe"

REM +==========================================================================+
REM |   Finding CD/DVD driveletter.                                            |
REM |--------------------------------------------------------------------------|
SET TAGFILE=\OEM
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) DO IF EXIST "%%i:%TAGFILE%" SET CDDRIVE=%%i:& GOTO DPsFound
:DPsFound

REM +==========================================================================+
REM |   Decompressing the DriverPacks to the harddisk - using un7zip.exe.      |
REM |--------------------------------------------------------------------------|
Start /wait /realtime /separate "" %CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\DP*.7z %SystemDrive%\


REM +==========================================================================+
REM |   Copying/decompressing the files to finish the installation.            |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\un7zip.exe %CDDRIVE%\OEM\bin\*.7z %SystemDrive%\
COPY /Y %CDDRIVE%\OEM\bin\DPsFnshr.ini %SystemDrive%\
IF EXIST %CDDRIVE%\OEM\*.ins COPY /Y %CDDRIVE%\OEM\*.ins %SystemDrive%\


REM +==========================================================================+
REM |   Scanning for driverdirectories.                                        |
REM |--------------------------------------------------------------------------|
%CDDRIVE%\OEM\bin\DevPath.exe %SystemDrive%\D


REM +==========================================================================+
REM |   Disable Driver Signing Policy and keep it disabled.                    |
REM |--------------------------------------------------------------------------|
START %SystemDrive%\DSPdsblr.exe

EXIT
