2021-09-05 11:21:52 +02:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set OPT=..\optional
|
|
|
|
set SOFTWARE=..\software
|
|
|
|
set MSI=openvpn-setup.msi
|
|
|
|
set SETTINGS=..\personal\settings.cmd
|
|
|
|
set openvpn_configfile=configfile
|
|
|
|
set capicli="%ProgramFiles(x86)%\OpenVPN Technologies\OpenVPN Client\core\capicli.exe"
|
|
|
|
|
|
|
|
if NOT EXIST %SOFTWARE%\%MSI% (
|
|
|
|
echo ERROR: %SOFTWARE%\%MSI% not found!
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
|
|
|
|
rem ===================
|
|
|
|
rem CONFIGFILE CHECK
|
|
|
|
rem ===================
|
|
|
|
|
|
|
|
if NOT EXIST %SETTINGS% (
|
|
|
|
echo.
|
|
|
|
echo WARNING: %SETTINGS% NOT FOUND
|
|
|
|
echo.
|
|
|
|
) else (
|
|
|
|
call %SETTINGS%
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
echo ####### %0 #######
|
|
|
|
|
|
|
|
echo installing OpenVPN ...
|
|
|
|
cd %SOFTWARE%
|
|
|
|
@echo on
|
|
|
|
msiexec /i %MSI% /q
|
|
|
|
@echo off
|
|
|
|
cd %OPT%
|
|
|
|
|
|
|
|
echo removing Desktop icon ...
|
|
|
|
del /F "%PUBLIC%\Desktop\OpenVPN Connect.lnk" 2>nul
|
|
|
|
|
|
|
|
echo refreshing desktop (W10 style) ...
|
|
|
|
ie4uinit.exe -show
|
|
|
|
|
2021-09-06 13:17:53 +02:00
|
|
|
echo sleep 5 seconds ...
|
|
|
|
ping 127.0.0.1 -n 5 > NUL 2>&1
|
|
|
|
|
2021-09-05 11:21:52 +02:00
|
|
|
rem install configfile from folder personal ...
|
|
|
|
if EXIST ..\personal\%openvpn_configfile% (
|
|
|
|
echo importing OpenVPN configfile ...
|
2021-09-06 13:17:53 +02:00
|
|
|
%capicli% -f ..\personal\%openvpn_configfile% ImportProfile
|
2021-09-05 11:21:52 +02:00
|
|
|
) else (
|
|
|
|
echo no configfile found!
|
|
|
|
)
|
|
|
|
|
|
|
|
echo ####### %0 #######
|
|
|
|
pause
|
2021-09-06 10:17:00 +02:00
|
|
|
|