-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecryption_uninstall.bat
More file actions
103 lines (81 loc) · 2.5 KB
/
Decryption_uninstall.bat
File metadata and controls
103 lines (81 loc) · 2.5 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@echo off
REM /////////////
REM ADMIN ABFRAGE
REM /////////////
:ADMIN_REQ
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"C:\Windows\system32\cscript.exe" "%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
REM //////////////////
REM ENDE ADMIN ABFRAGE
REM //////////////////
REM //////////////
REM UNINSTALLATION
REM //////////////
:START_SCRIPT
cls
echo DECRYPTION UNINSTALL
echo --------------------
set /p ANSWER="You are about to uninstall Decryption with all it's components. Type "Y" if you want to proceed:"
IF /I "%ANSWER%" == "Y" goto START_UNINSTALLATION
IF /I "%ANSWER%" == "y" goto START_UNINSTALLATION
IF /I "%ANSWER%" == "Yes" goto START_UNINSTALLATION
IF /I "%ANSWER%" == "yes" goto START_UNINSTALLATION
exit
:START_UNINSTALLATION
REM Get Paths
set INSTALLDIR=%PROGRAMFILES%\Decryption
set CONFIGPATH=%APPDATA%\Decryption
echo Path to installed software: %INSTALLDIR%
echo Path of the config file: %CONFIGPATH%
echo.
echo Removing Files
rd /q /s "%INSTALLDIR%\intelligence"
rd /q /s "%INSTALLDIR%\scripts"
rd /q /s "%INSTALLDIR%\thumbs"
rd /q /s "%CONFIGPATH%\config"
del /q "%INSTALLDIR%\README.txt"
echo Finished Removing Files
echo.
echo Removing RMB Tools
SET KEY_DECR="HKCR\*\shell\DECRYPTION (Decrypt)"
SET KEY_ENCR="HKCR\*\shell\DECRYPTION (Encrypt)"
reg delete %KEY_DECR% /f
reg delete %KEY_ENCR% /f
echo Finished Removing RMB Tools
echo.
If Not Exist "%INSTALLDIR%\intelligence\Decryption.exe" goto Successful Else goto Not_Successful
:Successful
echo Uninstallation was successful.
echo.
pause
goto DEL_UNINSTALLFILE
:Not_Successful
echo Uninstallation was not successful. Please delete folder maually: "C:\Decryption"
echo.
pause
:DEL_UNINSTALLFILE
rd /s /q %CONFIGPATH%
rd /s /q %INSTALLDIR%
REM BATCH DELETING ITSELF
(goto) 2>nul & del "%~f0"
:END
exit