-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.bat
63 lines (54 loc) · 1.8 KB
/
uninstall.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
@echo off
setlocal
cd /d %~dp0
:: Check for Python installation
where python >nul 2>nul
if errorlevel 1 (
echo Python is not installed. Cannot proceed with uninstallation.
goto :eof
)
:: Check Python version
for /f "tokens=*" %%i in ('python --version 2^>^&1') do set PYTHON_VERSION=%%i
echo %PYTHON_VERSION% | findstr /R "Python 3\..*" >nul
if errorlevel 1 (
echo This script requires Python 3.x. Cannot proceed with uninstallation.
goto :eof
)
:: Stop the Owlette Windows service if it's running
echo Stopping the Owlette Windows service if it's running...
net stop OwletteService
:: Close the Owlette Configuration window if it's open
echo Closing the Owlette Configuration window if it's running...
taskkill /F /FI "WINDOWTITLE eq Owlette Configuration"
:: Uninstall the Owlette Windows service
echo Uninstalling the Owlette Windows service...
cd %~dp0
cd src
python owlette_service.py remove
:: Optional: Ask the user if they want to remove stored credentials
set /p remove_creds=Do you want to remove stored credentials (Slack and/or Gmail Tokens)? (y/n):
if "%remove_creds%"=="y" (
echo Removing stored credentials...
cd %~dp0
cd src
python remove_creds.py
) else if "%remove_creds%"=="n" (
echo Skipping stored credential removal.
) else (
echo Invalid choice. Skipping stored credential removal.
)
:: Optional: Ask the user if they want to remove Python dependencies
set /p uninstall_deps=Do you want to remove Python dependencies? (y/n):
if "%uninstall_deps%"=="y" (
echo Uninstalling Python dependencies...
cd %~dp0
python -m pip uninstall -r requirements.txt -y
) else if "%uninstall_deps%"=="n" (
echo Skipping Python dependency removal.
) else (
echo Invalid choice. Skipping Python dependency removal.
)
:: Done
echo Uninstallation complete!
endlocal
pause