@echo off
set root=%CD%

::Checking OS architechture.
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OSarch=32BIT || set OSarch=64BIT

echo.
echo Installing Intel(R) PRO/1000 LAN Adapter Software for Windows 10 x64. Please wait...
echo.

if %OSarch%==32BIT ( 
	goto ERROR_BIT
) else if %OSarch%==64BIT ( 
	cd APPS\SETUP\SETUPBD\Win10_x64
) else (
	goto ERROR
)

::Install driver in Silent mode.
SetupBD.exe /s

::Check return value.
if errorlevel 0 (
	echo Installation completed.
	goto END
) else (
	goto ERROR
)
:ERROR_BIT
echo.
echo Error: This architecture is not supported. Make sure your Win10 has 64bit architecture.
goto END


:ERROR
echo.
echo Error: An error occured while installing the driver.
goto END

:END
cd %ROOT%
