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 |   Slightly Modified For use with usb_prep.cmd - 8-11-2007                |
REM +==========================================================================+

SET CDDRIVE=
REM +==========================================================================+
REM |   Finding CD/DVD driveletter                                             |
REM | First Limited Range to Prevent Windows No Drive Alert due to Cardreader  |
REM | For case of Repair Install when Drive not found, than Extended Range and |
REM | Windows No Drive Alert - Press 4x Continue for Cardreader Drives         |
REM |--------------------------------------------------------------------------|
SET TAGFILE=\OEM
FOR %%i IN (C D M N O P Q R S T U V W X Y) DO IF EXIST "%%i:%TAGFILE%" SET CDDRIVE=%%i:

if "%CDDRIVE%" == "" (
   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:
) 

REM +==========================================================================+
REM |   Decompressing the DriverPacks to the harddisk - using un7zip.exe.      |
REM |--------------------------------------------------------------------------|
%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

DEL /F %systemroot%\system32\setupold.exe
EXIT
