diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-07 18:48:43 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-07 18:48:43 +0300 |
commit | 9245d6d8d6989704c1f22a54303877ac37c81e91 (patch) | |
tree | 83543173a8af5fa4e10aa7e00695cc7507a79b12 | |
parent | README update (diff) | |
download | windows7-drivers-9245d6d8d6989704c1f22a54303877ac37c81e91.tar.gz windows7-drivers-9245d6d8d6989704c1f22a54303877ac37c81e91.zip |
sign.bat: fail gracefully if the DDK's not present
-rw-r--r-- | add_cert.bat | 1 | ||||
-rw-r--r-- | build_driver.bat | 18 | ||||
-rw-r--r-- | sign.bat | 1 |
3 files changed, 12 insertions, 8 deletions
diff --git a/add_cert.bat b/add_cert.bat index 3673dac..ed42e52 100644 --- a/add_cert.bat +++ b/add_cert.bat @@ -14,6 +14,7 @@ echo Certificate name: "%cert_name%" echo ========================== END CERT INFO ========================== echo. echo ======================= ADDING CERTIFICATE ======================== +call check_ddk.bat || goto :add_cert_failure echo makecert.exe -$ individual -r -pe -ss "%cert_store%" -n CN="%cert_name%" "%cert_name%.cer" makecert.exe -$ individual -r -pe -ss "%cert_store%" -n CN="%cert_name%" "%cert_name%.cer" >nul || goto :add_cert_failure echo certmgr.exe /add "%cert_name%.cer" /s /r localMachine root 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! @@ -21,6 +21,7 @@ echo Certificate name: "%cert_name%" echo ========================== END CERT INFO ========================== echo. echo ============================= SIGNING ============================= +call check_ddk.bat || goto :signing_failure echo signtool.exe sign /s "%cert_store%" /n "%cert_name%" "%sys_path%" signtool.exe sign /s "%cert_store%" /n "%cert_name%" "%sys_path%" >nul || goto :signing_failure echo signtool.exe verify /pa "%sys_path%" |