-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_filterbox.bat
42 lines (36 loc) · 1009 Bytes
/
install_filterbox.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
@echo off
:: Batch script to build and install FilterBox on Windows using Makefile
:: Check for administrative privileges (if not, restart the script with them)
net session >nul 2>&1
if %errorLevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:: Set the current directory to the script directory
cd %~dp0
:: Run make build
echo Building project...
make all
if %errorLevel% neq 0 (
echo Failed to build project.
pause
exit /b %errorLevel%
)
:: Check if the FilterBoxDaemon service is running and stop it
echo Checking if FilterBoxDaemon service is running...
sc query FilterBoxDaemon | find "RUNNING" >nul 2>&1
if %errorLevel% equ 0 (
echo Uninstalling FilterBoxDaemon service...
make uninstall
)
:: Run make install
echo Installing project...
make install
if %errorLevel% neq 0 (
echo Failed to install project.
pause
exit /b %errorLevel%
)
echo FilterBox installed successfully.
pause