-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathInstall.cmd
52 lines (37 loc) · 1.51 KB
/
Install.cmd
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
@echo off
title DifferentSLI Sign and Install
setlocal EnableExtensions
cd /d "%~dp0"
set _nvlddmkm=nvlddmkm
if exist "nvlddmkm2.sys" then set _nvlddmkm=nvlddmkm2
if not exist "tools\" goto wtfrudoin
net session >nul 2>&1
if %errorlevel% neq 0 goto notadmin
call "%SystemRoot%\System32\certutil.exe" -store root DifferentSLIAuto
if %errorlevel% equ 0 goto certexists
call "tools\makecert.exe" -r -pe -ss "DifferentSLIAuto" -n "CN=DifferentSLIAuto" "%SystemRoot%\DifferentSLIAuto.cer"
call "tools\CertMgr.exe" /add "%SystemRoot%\DifferentSLIAuto.cer" /s /r localMachine root
:certexists
call "tools\ChecksumFix.exe" "%_nvlddmkm%.sys"
call "tools\signtool.exe" sign /v /s DifferentSLIAuto /n DifferentSLIAuto /t http://timestamp.verisign.com/scripts/timstamp.dll "%_nvlddmkm%.sys"
call "%SystemRoot%\System32\takeown.exe" /f "%SystemRoot%\System32\drivers\%_nvlddmkm%.sys" /a
call "%SystemRoot%\System32\icacls.exe" "%SystemRoot%\System32\drivers\%_nvlddmkm%.sys" /grant "%USERNAME%":f
call "%SystemRoot%\System32\bcdedit.exe" /set TESTSIGNING ON
if exist "%SystemRoot%\Sysnative\" goto x32mode
copy "%_nvlddmkm%.sys" "%SystemRoot%\System32\drivers\%_nvlddmkm%.sys" /y
goto filecopied
:x32mode
copy "%_nvlddmkm%.sys" "%SystemRoot%\Sysnative\drivers\%_nvlddmkm%.sys" /y
:filecopied
color 0a
echo Reboot now for changes to take effect
goto end
:wtfrudoin
color 0c
echo Please extract everything from the package including the contents of the tools folder.
goto end
:notadmin
color 0e
echo Please run this as administrator!
:end
pause > nul