@echo off

@cd   /d %~dp0

@set dworkPath=%CD%

@cd     %dworkPath%

set num=%dworkPath%\rtn.txt

call %dworkPath%\GetVersion.exe  > %num%

set /p FileVer=<%num%
if %FileVer%==11 goto Win11OK
goto Win11ERROR

:Win11OK
echo Win11
rem call  %dworkPath%\Win11\Install.cmd
pnputil -i -a %dworkPath%\Win11\rt25cx21x64\rt25cx21x64.inf
pnputil -i -a %dworkPath%\Win11\rt25dcx21x64\rt25dcx21x64.inf
pnputil -i -a %dworkPath%\Win11\rt68cx21x64\rt68cx21x64.inf
pnputil -i -a %dworkPath%\Win11\rt68dcx21x64\rt68dcx21x64.inf
pnputil -i -a %dworkPath%\Win11\rtots640x64\rtots640x64.inf

goto end

:Win11ERROR
echo Win10
rem call  %dworkPath%\Win10\Install.cmd
pnputil -i -a %dworkPath%\Win10\rt25cx21x64_1125.005.0112.2022\rt25cx21x64.inf
pnputil -i -a %dworkPath%\Win10\rt25dcx21x64_1124.005.0112.2022\rt25dcx21x64.inf
pnputil -i -a %dworkPath%\Win10\rt640x64_10.63.1014.2022\rt640x64.inf
pnputil -i -a %dworkPath%\Win10\rtots640x64_10.056.0119.2022\rtots640x64.inf

:end
del /q %dworkPath%\rtn.txt
