From 9245d6d8d6989704c1f22a54303877ac37c81e91 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 7 May 2015 18:48:43 +0300 Subject: sign.bat: fail gracefully if the DDK's not present --- build_driver.bat | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'build_driver.bat') diff --git a/build_driver.bat b/build_driver.bat index 750a0f8..7eeaa24 100644 --- a/build_driver.bat +++ b/build_driver.bat @@ -14,7 +14,6 @@ call check_env.bat || exit /b !errorlevel! call check_ddk.bat || exit /b !errorlevel! set driver_src_root=%~f1 -cd "%driver_src_root%" for /f %%i in ("%driver_src_root%") do ( set driver_name=%%~ni @@ -34,7 +33,10 @@ echo ========================= END DRIVER INFO ========================= echo. echo ============================== BUILD ============================== set LIBDISTDIR=%lib_dist_dir% -build.exe /cegwZ +pushd "%driver_src_root%" && ( + build.exe /cegwZ + popd +) if %errorlevel% equ 0 ( echo ========================== BUILD SUCCESS ========================== ) else ( @@ -43,15 +45,15 @@ if %errorlevel% equ 0 ( ) if [%_BUILDARCH%] == [x86] ( - set sys_path=obj%BUILD_ALT_DIR%\i386\%driver_name%.sys - set pdb_path=obj%BUILD_ALT_DIR%\i386\%driver_name%.pdb - set lib_path=obj%BUILD_ALT_DIR%\i386\%driver_name%.lib + set buildarch_directory=i386 ) else ( - set sys_path=obj%BUILD_ALT_DIR%\%_BUILDARCH%\%driver_name%.sys - set pdb_path=obj%BUILD_ALT_DIR%\%_BUILDARCH%\%driver_name%.pdb - set lib_path=obj%BUILD_ALT_DIR%\%_BUILDARCH%\%driver_name%.lib + set buildarch_directory=%_BUILDARCH% ) +set sys_path=%driver_src_root%\obj%BUILD_ALT_DIR%\%buildarch_directory%\%driver_name%.sys +set pdb_path=%driver_src_root%\obj%BUILD_ALT_DIR%\%buildarch_directory%\%driver_name%.pdb +set lib_path=%driver_src_root%\obj%BUILD_ALT_DIR%\%buildarch_directory%\%driver_name%.lib + echo. call "%root%\sign.bat" "%sys_path%" || exit /b !errorlevel! -- cgit v1.2.3