1@echo off
2set ARGS=/SE /SW /SA
3if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
4  drivers\dpinst-amd64.exe %ARGS%
5) ELSE IF "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
6  drivers\dpinst-amd64.exe %ARGS%
7) ELSE (
8  drivers\dpinst-x86.exe %ARGS%
9)
10
11@echo off
12setlocal
13for /f "tokens=4-5 delims=[.] " %%i in ('ver') do @(if %%i==Version (set VERSION=%%j) else (set VERSION=%%i))
14if %VERSION% GEQ 10 (
15  exit /b 0
16)
17endlocal
18
19REM dpinst /PATH has problems with relative paths, so use absolute path.
20if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
21  drivers\dpinst-amd64.exe /PATH %cd%\drivers\prewin10 %ARGS%
22) ELSE IF "%PROCESSOR_ARCHITEW6432%" == "AMD64" (
23  drivers\dpinst-amd64.exe /PATH %cd%\drivers\prewin10 %ARGS%
24) ELSE (
25  drivers\dpinst-x86.exe /PATH %cd%\drivers\prewin10 %ARGS%
26)
27
28exit /b 0
29