Check whether certutil is in PATH

This commit is contained in:
Yukino Song
2025-02-15 04:10:23 +08:00
parent e35f9fac60
commit 6489c554a2

View File

@@ -1,12 +1,14 @@
@echo off
pushd %~dp0
set "CERTUTIL=certutil"
where certutil >nul 2>&1 || set "CERTUTIL=%SystemRoot%\System32\certutil.exe"
echo ================
echo Installing cert for the SudoVDA driver...
certutil -addstore -f root "code_signing.crt"
certutil -addstore -f TrustedPublisher "code_signing.crt"
%CERTUTIL% -addstore -f root "code_signing.crt"
%CERTUTIL% -addstore -f TrustedPublisher "code_signing.crt"
echo ================
echo Removing the old driver... It's OK to show an error if you're installing the driver for the first time.
@@ -22,4 +24,4 @@ nefconc.exe --install-driver --inf-path "SudoVDA.inf"
echo ================
echo Done!
popd
popd