This repository has been archived by the owner on Jul 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
89 lines (70 loc) · 2.49 KB
/
install.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@echo off
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Configuration variables
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: INF2CAT Windows version:
:: 2000, XP_X86, XP_X64, Server2003_X86, Server2003_X64, Server2003_IA64,
:: Vista_X86, Vista_X64, Server2008_X86, Server2008_X64, Server2008_IA64
SET INFWINVER="Server2003_X86"
:: Object output path
SET OBJPATH="obj\i386"
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Synchronize these with sign.bat
SET CERTSTORE="PrivateCertStore"
SET CERTSUBJECT=Bastage Inc. (Test)
SET CERTFILE="obj\testcert.cer"
SET DEBUGLOG="C:\DELAYMAN.LOG"
IF NOT X%_BUILDARCH%==X GOTO PERFORM
echo You must run this batch file from the WDK Build Environment.
GOTO QUIT
:PERFORM
echo ****************************************
echo ** Building DelayMan driver kit **
echo ****************************************
build -c
echo.
echo ****************************************
echo ** Preparing files **
echo ****************************************
copy /y driver\delayman.inf %OBJPATH%
copy /y misc\* %OBJPATH%
echo.
echo ****************************************
echo ** Generating catalog file **
echo ****************************************
inf2cat /driver:%OBJPATH% /os:%INFWINVER%
echo.
echo ****************************************
echo ** Signing catalog file **
echo ****************************************
signtool sign /a /v /s %CERTSTORE% /n "%CERTSUBJECT%" /t http://timestamp.verisign.com/scripts/timestamp.dll %OBJPATH%\delayman.cat
echo.
echo ****************************************
echo ** Verifying catalog signature **
echo ****************************************
signtool verify /v /pa %OBJPATH%\delayman.cat
echo.
echo ****************************************
echo ** Installing driver **
echo ****************************************
CHOICE /M "Do you want to install the driver?"
IF ERRORLEVEL 2 GOTO SKIPINSTALL
echo.
devcon install %OBJPATH%\delayman.inf Root\DelayMan
echo.
echo You will have to reboot your computer in order for the changes to take effect.
echo.
IF NOT EXIST %DEBUGLOG% GOTO SKIPLOG
echo.
echo ****************************************
echo ** Installation debug log **
echo ****************************************
TYPE %DEBUGLOG%
echo ****************************************
DEL %DEBUGLOG% >NUL
echo.
:SKIPLOG
:SKIPINSTALL
echo.
echo Done.
:QUIT