Added version-agnostic uninstaller for Windows

This uninstaller.bat removes BetterDiscord from all app-* folders in %localappdata%\Discord\ and restarts Discord afterwards.
This commit is contained in:
Yozora 2016-08-06 12:50:27 +02:00 committed by GitHub
parent f751f540ec
commit d067bc2cfc
1 changed files with 46 additions and 0 deletions

46
misc/uninstall.bat Normal file
View File

@ -0,0 +1,46 @@
@ECHO off
:prompt
set /P c=Are you sure you want to uninstall BetterDiscord [Y/N]?
echo.
if /I "%c%" EQU "Y" goto :removeBetterDiscord
if /I "%c%" EQU "N" goto :eof
goto :prompt
:removeBetterDiscord
echo Removing BetterDiscord...
echo.
:: Delete %appdata%\BetterDiscord
call:deleteFolder %appdata%\BetterDiscord
:: Remove BetterDiscord from all app versions
for /d %%G in ("%localappdata%\Discord\app-*") do (
call:deleteFolder "%%G\resources\node_modules\BetterDiscord"
call:deleteFolder "%%G\resources\app"
SET latestDiscordVersion=%%G
)
goto:end
:: Checks whether a folder exists and deletes it if it does
:deleteFolder
if exist "%~1" (
@RD /S /Q "%~1"
echo Folder "%~1" removed.
) else (
echo Folder "%~1" does not exist.
)
goto:eof
:end
echo.
echo Restarting Discord...
taskkill /f /im Discord.exe 1>nul 2>nul
"%localappdata%\Discord\Update.exe" --processStart Discord.exe
echo.
echo BetterDiscord has been removed!
echo.
pause