@echo off
rem :_make_temp_path_loop
rem set TMP_PATH=%TMP%\driver_%RANDOM%_%RANDOM%
rem if exist "%TMP_PATH%" GOTO :_make_temp_path_loop
rem mkdir %TMP_PATH%
rem if not exist "%TMP_PATH%" GOTO :_make_temp_path_loop
rem echo "Temp path name is %TMP_PATH%"

rem check version
rem for /f "tokens=4-7 delims=[.] " %%i in ('ver') do (if %%i==Version (set v=%%j.%%k) else (set v=%%i.%%j))
rem echo %v%
for /f "tokens=4-7 delims=[.] " %%i in ('ver') do (if %%i==Version (set vMajor=%%j) else (set vMajor=%%i))
rem echo %vMajor%

set path_ext=
if %vMajor% GEQ 10 set path_ext=_Win10

rem echo %path_ext%

if %PROCESSOR_ARCHITECTURE%==AMD64 goto _run_setup64
if not defined PROCESSOR_ARCHITEW6432 goto _skip_wow6432
if %PROCESSOR_ARCHITEW6432%==AMD64 goto _run_setup64
:_skip_wow6432
:_run_setup32
rem echo calling .\x86%path_ext%\Setup.exe
.\x86%path_ext%\Setup.exe
goto _finished
:_run_setup64
rem echo calling .\x64%path_ext%\Setup.exe
.\x64%path_ext%\Setup.exe
goto _finished
:_finished