From 4e473448c3596204fa96a04ecfbad7e7b50d892d Mon Sep 17 00:00:00 2001 From: Andro24 Date: Sat, 12 Jun 2021 23:08:35 +0200 Subject: [PATCH] installer --- install.bat | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 install.bat diff --git a/install.bat b/install.bat new file mode 100644 index 0000000..40ae6ed --- /dev/null +++ b/install.bat @@ -0,0 +1,71 @@ +@echo off +title Discord Token Protector Installer +echo ========================================================== +echo Discord Token Protector Installer +echo Dev build. +echo By Andro24 +echo ========================================================== +echo. + +set "workingPath=%APPDATA%\DiscordTokenProtector\" + +if exist "%workingPath%\DiscordTokenProtector.exe" goto oldInstall +if exist "%workingPath%\glfw3.dll" goto oldInstall +if exist "%workingPath%\ProtectionPayload.dll" goto oldInstall + +call :checkExists DiscordTokenProtector.exe +call :checkExists glfw3.dll +call :checkExists ProtectionPayload.dll + +call :install +echo Installation complete! +:end +pause +exit + +:oldInstall +echo An old installation has been detected. +echo Would you like to (R)emove it or (U)pdate it? +choice /C RU +if %errorlevel%==1 call :removeOld +if %errorlevel%==2 call :update +goto end + +:install +if not exist "%workingPath%" md "%workingPath%" +echo Copying new files... +copy DiscordTokenProtector.exe "%workingPath%\DiscordTokenProtector.exe" +copy glfw3.dll "%workingPath%\glfw3.dll" +copy ProtectionPayload.dll "%workingPath%\ProtectionPayload.dll" +echo Done. +echo. +exit /b + +:update +call :removeOld +call :install +exit /b + +:removeOld +echo Removing old versions... +call :removeOld "%workingPath%\DiscordTokenProtector.exe" +call :removeOld "%workingPath%\glfw3.dll" +call :removeOld "%workingPath%\ProtectionPayload.dll" +echo Done. +echo. +exit /b + +REM arg : filepath +:removeOld +if exist %1 ( + del %1>nul + echo Detected an old installation of %1. Removed. +) +exit /b +REM arg : filepath +:checkExists +if not exist %1 ( + echo %1 is missing. Please redownload it. + exit +) +exit /b \ No newline at end of file