-
-
Notifications
You must be signed in to change notification settings - Fork 172
/
driver_build.bat
63 lines (50 loc) · 1.69 KB
/
driver_build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
::Parameters:
:: %1 - x86 or x64
:: %2 - WIN7
:: %3 - target directory
call C:\WinDDK\7600.16385.1\bin\setenv.bat C:\WinDDK\7600.16385.1\ fre %1 %2
cd %~dp0
CALL config.bat
if "%_BUILDARCH%"=="x86" (
set USBPcap_arch=i386
set USBPcap_catalog=USBPcapx86.cat
if "%DDK_TARGET_OS%"=="WinLH" (
set USBPcap_OS=Vista_X86
) else if "%DDK_TARGET_OS%"=="WinXP" (
set USBPcap_OS=XP_X86
) else if "%DDK_TARGET_OS%"=="Win7" (
set USBPcap_OS=7_X86
)
) else (
set USBPcap_arch=amd64
set USBPcap_catalog=USBPcapamd64.cat
if "%DDK_TARGET_OS%"=="WinLH" (
set USBPcap_OS=Vista_X64
) else if "%DDK_TARGET_OS%"=="WinNET" (
set USBPcap_OS=XP_X64
) else if "%DDK_TARGET_OS%"=="Win7" (
set USBPcap_OS=7_X64
)
)
cd %~dp0
CALL config.bat
build -ceZg
if exist build%BUILD_ALT_DIR%.err goto error
::Sign the USBPcapCMD.exe, it is not critical so do not fail on error
%_USBPCAP_SIGNTOOL% %_USBPCAP_SIGN_OPTS_SHA256% USBPcapCMD\obj%BUILD_ALT_DIR%\%USBPcap_arch%\USBPcapCMD.exe
%_USBPCAP_SIGNTOOL% %_USBPCAP_SIGN_OPTS_SHA256% USBPcapDriver\obj%BUILD_ALT_DIR%\%USBPcap_arch%\USBPcap.sys
if errorlevel 1 goto error
Inf2cat.exe /driver:USBPcapDriver\obj%BUILD_ALT_DIR%\%USBPcap_arch%\ /os:%USBPcap_OS%
goto end
:error
echo ===== BUILD FAILED! =====
pause
exit /B 1
:end
copy USBPcapDriver\obj%BUILD_ALT_DIR%\%USBPcap_arch%\USBPcap.sys %3
copy USBPcapDriver\obj%BUILD_ALT_DIR%\%USBPcap_arch%\USBPcap.pdb %3
copy USBPcapDriver\obj%BUILD_ALT_DIR%\%USBPcap_arch%\USBPcap.inf %3
copy USBPcapDriver\obj%BUILD_ALT_DIR%\%USBPcap_arch%\%USBPcap_catalog% %3
%_USBPCAP_SIGNTOOL% %_USBPCAP_SIGN_OPTS_SHA256% %3\%USBPcap_catalog%
if errorlevel 1 goto error
exit /B 0