From 4f53418e8c0db3aa513f4fdc1245e2fd14d70873 Mon Sep 17 00:00:00 2001 From: Jeff Odegard <42775175+JeffOdegard@users.noreply.github.com> Date: Wed, 3 Oct 2018 15:06:56 -0600 Subject: [PATCH] Created uinstall.bat, updated install.bat Adding an uninstall.bat that, when run as administrator, will stop the apache2.4 and mysql services, delete the mysql service (which XAMPP uninstall leaves behind...), deletes the www folder and uninstalls XAMPP. Modified the install.bat script to suppress output when deleting the unnecessary XAMPP htdocs folder and added a friendly "contact us" message to encourage some feedback from our users. --- install.bat | 20 ++++++++++++------- uninstall.bat | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 uninstall.bat diff --git a/install.bat b/install.bat index b8c69ec..822cd35 100644 --- a/install.bat +++ b/install.bat @@ -28,6 +28,7 @@ REM - Apr 5, 2017 - Added mkdir for \xampp\php\logs directory (not included when installed) REM - Jun 27, 2017 - Removed copy cgi-bin contents REM - Sep 19, 2018 - Deleting unnecessary C:\xampp\htdocs folder. + REM - Oct 3, 2018 - Redirected deletion of htdocs folder to nul mkdir c:\xampp\php\logs @@ -50,20 +51,25 @@ rename c:\xampp\php\php.ini php.ini.old copy c:\xampp\www\conf\php.ini c:\xampp\php echo Deleting unnecessary C:\xampp\htdocs folder. -del /F /S /Q c:\xampp\htdocs +del /F /S /Q c:\xampp\htdocs 1>nul @echo Installing Apache service c:\xampp\apache\bin\httpd -k install net start apache2.4 +echo Thank you for installing Sagacity. We want to know what you think! +echo Please contact us at https://www.cyberperspectives.com/contact_us +echo. +echo If you like this tool, please tell a friend or co-worker! +echo. set /p browser="Continue setup with http://localhost/setup.php? (Y/n) " -set result=0 -if "%browser%"=="Y" (set result=1) -if "%browser%"=="y" (set result=1) -if "%browser%"=="Yes" (set result=1) -if "%browser%"=="yes" (set result=1) -if "%browser%"=="YES" (set result=1) +set result=1 +if "%browser%"=="N" (set result=0) +if "%browser%"=="n" (set result=0) +if "%browser%"=="no" (set result=0) +if "%browser%"=="No" (set result=0) +if "%browser%"=="NO" (set result=0) if "%result%"=="1" ( start http://localhost diff --git a/uninstall.bat b/uninstall.bat new file mode 100644 index 0000000..5adc570 --- /dev/null +++ b/uninstall.bat @@ -0,0 +1,54 @@ +@echo off + + REM File: uninstall.bat + REM Author: Jeff Odegard + REM Purpose: Windows / XAMPP Uninstallation Script + REM Created: Oct 3, 2018 + + REM Copyright 2018: Cyber Perspective, All rights reserved + REM Released under the Apache v2.0 License + + REM See license.txt for details + + REM Change Log: + REM - Oct 3, 2018 - File created + +echo. +echo This will completely uninstall Sagacity and XAMPP and delete +echo the findings database and all result files in www/tmp. +echo. +echo This cannot be undone. +echo. +set /p uninstall="Are you sure? (y/N) " + +set result=0 +if "%uninstall%"=="Y" (set result=1) +if "%uninstall%"=="y" (set result=1) +if "%uninstall%"=="Yes" (set result=1) +if "%uninstall%"=="yes" (set result=1) +if "%uninstall%"=="YES" (set result=1) + +if "%result%"=="1" ( + cd C:\ + echo - Stopping Apache and MySQL services. + sc stop Apache2.4 + sc stop mysql + echo - Deleting the MySQL service. + sc delete mysql + echo - Deleting the Sagacity www folder. + del /F /S /Q C:\xampp\www 1>nul + rmdir /S /Q C:\xampp\www + echo - Uninstalling XAMPP + C:\xampp\uninstall.exe --mode unattended +) + +echo. +echo Thank you for trying Sagacity. If you have any questions or comments, please echo contact us at https://www.cyberperspectives.com/contact_us +echo. + +if "%result%"=="1" ( + set /p foo="Uninstall complete. Press enter to continue." +) else ( + set /p foo="Whew, that was a close one! Uninstall aborted. Press enter to continue." +) +