-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecryption_install.bat
127 lines (101 loc) · 3.6 KB
/
Decryption_install.bat
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@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 INSTALLATION
REM ////////////
:START_INSTALLATION
cls
echo DECRYPTION
echo ----------
echo.
echo Installation started...
REM Get Paths
set CURRENTPATH=%~dp0
set INSTALLDIR=%PROGRAMFILES%\Decryption
set CONFIGPATH=%APPDATA%\Decryption
echo Path of the Installer-Files: %CURRENTPATH%
echo Path to install the software: %INSTALLDIR%
echo Path of the config file: %CONFIGPATH%
echo.
echo Creating Directorys...
mkdir "%INSTALLDIR%"
mkdir "%INSTALLDIR%\scripts"
mkdir "%INSTALLDIR%\intelligence"
mkdir "%INSTALLDIR%\thumbs"
mkdir "%CONFIGPATH%\config"
echo Finished Directory Creation!
echo.
echo Copying Files...
copy "%CURRENTPATH%\scripts\start_Decryption.bat" "%INSTALLDIR%\scripts\"
copy "%CURRENTPATH%\intelligence\Decryption.exe" "%INSTALLDIR%\intelligence\"
copy "%CURRENTPATH%\scripts\start_Encryption.bat" "%INSTALLDIR%\scripts\"
copy "%CURRENTPATH%\intelligence\Encryption.exe" "%INSTALLDIR%\intelligence\"
copy "%CURRENTPATH%\thumbs\key.ico" "%INSTALLDIR%\thumbs"
copy "%CURRENTPATH%\thumbs\lock.ico" "%INSTALLDIR%\thumbs"
copy "%CURRENTPATH%\config\config.txt" "%CONFIGPATH%\config"
copy "%CURRENTPATH%\Decryption_uninstall.bat" "%INSTALLDIR%"
REM Looking for existing Readme file (rename can't be forced)
if exist "%INSTALLDIR%\README.txt" goto Delete_old_Readme else goto No_old_readme
:Delete_old_Readme
erase %INSTALLDIR%\README.txt
:No_old_readme
REM Renaming Readme-file
copy "%CURRENTPATH%\README.md" "%INSTALLDIR%"
ren "%INSTALLDIR%\README.md" "README.txt"
erase "%INSTALLDIR%\README.md"
echo Finished Copy Process!
echo.
echo Adding RMB Tools
SET KEY_DECR=HKCR\*\shell\DECRYPTION (Decrypt)
SET KEY_ENCR=HKCR\*\shell\DECRYPTION (Encrypt)
SET PATH_DECR=%INSTALLDIR%\scripts\start_Decryption.bat
SET PATH_ENCR=%INSTALLDIR%\scripts\start_Encryption.bat
SET ICON_DECR=%INSTALLDIR%\thumbs\key.ico
SET ICON_ENCR=%INSTALLDIR%\thumbs\lock.ico
REG ADD "%KEY_DECR%" /v "Icon" /t REG_EXPAND_SZ /d "%ICON_DECR%" /f
REG ADD "%KEY_DECR%\command" /ve /d "%PATH_DECR% %%1" /f
REG ADD "%KEY_ENCR%" /v "Icon" /t REG_EXPAND_SZ /d "%ICON_ENCR%" /f
REG ADD "%KEY_ENCR%\command" /ve /d "%PATH_ENCR% %%1" /f
echo Finished RMB Tools Add
echo.
If Exist %INSTALLDIR% goto Successful Else goto Not_Successful
:Successful
echo Installation was successful.
REM MSGBOX - SUCCESSFUL INSTALLATION
echo msgbox"The Installation of DECRYPTION was successful!",vbInformation , "Installation successful"> %temp%\msg.vbs
echo.
cscript %temp%\msg.vbs
erase %temp%\msg.vbs
exit
:Not_Successful
echo Installation was not successful. Please contact content owner! Github: jonasarnold
:END
echo.
pause