mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
fix: clean service/client logs in uninstall scripts (#1846)
- Windows (x64/x86): - Remove delegation to `AmneziaVPN.exe -c` - Delete `%ProgramData%\AmneziaVPN\log\AmneziaVPN-service.log` - Delete current user logs at `%AppData%\AmneziaVPN.ORG\AmneziaVPN\log` - Remove empty parent dirs (app/org, log) - Linux: - Delete only `/var/log/AmneziaVPN/AmneziaVPN-service.log` (preserve `post-uninstall.log`) - Delete current user logs at `$HOME/.local/share/AmneziaVPN.ORG/AmneziaVPN/log`
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
set AmneziaPath=%~dp0
|
||||
echo %AmneziaPath%
|
||||
|
||||
"%AmneziaPath%\AmneziaVPN.exe" -c
|
||||
rem Define directories for logs
|
||||
set "ORG_DIR=%AppData%\AmneziaVPN.ORG"
|
||||
set "USER_APP_DIR=%ORG_DIR%\AmneziaVPN"
|
||||
set "USER_LOG_DIR=%USER_APP_DIR%\log"
|
||||
set "SYS_APP_DIR=%ProgramData%\AmneziaVPN"
|
||||
set "SYS_LOG_DIR=%SYS_APP_DIR%\log"
|
||||
set "SYS_LOG_FILE=%SYS_LOG_DIR%\AmneziaVPN-service.log"
|
||||
|
||||
timeout /t 1
|
||||
sc stop AmneziaVPN-service
|
||||
sc delete AmneziaVPN-service
|
||||
@@ -9,4 +16,17 @@ sc stop AmneziaWGTunnel$AmneziaVPN
|
||||
sc delete AmneziaWGTunnel$AmneziaVPN
|
||||
taskkill /IM "AmneziaVPN-service.exe" /F
|
||||
taskkill /IM "AmneziaVPN.exe" /F
|
||||
|
||||
rem Delete the service log file under ProgramData
|
||||
if exist "%SYS_LOG_FILE%" del /F /Q "%SYS_LOG_FILE%"
|
||||
if exist "%SYS_LOG_DIR%" rmdir /S /Q "%SYS_LOG_DIR%"
|
||||
rem Try to remove application dir if empty
|
||||
rd "%SYS_APP_DIR%" 2>nul
|
||||
|
||||
rem Delete client logs under current user's AppData\Roaming (Organization\Application)
|
||||
if exist "%USER_LOG_DIR%" rmdir /S /Q "%USER_LOG_DIR%"
|
||||
rem Try to remove app and org directories if empty
|
||||
rd "%USER_APP_DIR%" 2>nul
|
||||
rd "%ORG_DIR%" 2>nul
|
||||
|
||||
exit /b 0
|
||||
|
||||
Reference in New Issue
Block a user