forked from hackedteam/rcs-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRCS-Exploits.nsi
128 lines (94 loc) · 2.95 KB
/
RCS-Exploits.nsi
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
128
;NSIS Modern User Interface
;--------------------------------
!include "MUI2.nsh"
!include nsDialogs.nsh
!include Sections.nsh
!include LogicLib.nsh
!include WinVer.nsh
!include StrFunc.nsh
${StrStr}
;--------------------------------
;General
!define PACKAGE_NAME "RCS-Exploits"
!Define /file PACKAGE_VERSION "..\config\VERSION_BUILD"
;Name and file
Name "RCS-Exploits"
OutFile "rcs-exploits-${PACKAGE_VERSION}.exe"
;Default installation folder
InstallDir "C:\RCS\"
ShowInstDetails "show"
ShowUnInstDetails "show"
!include "WordFunc.nsh"
;--------------------------------
!macro _RunningX64 _a _b _t _f
!insertmacro _LOGICLIB_TEMP
System::Call kernel32::GetCurrentProcess()i.s
System::Call kernel32::IsWow64Process(is,*i.s)
Pop $_LOGICLIB_TEMP
!insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
!macroend
!define RunningX64 `"" RunningX64 ""`
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
!define MUI_WELCOMEFINISHPAGE_BITMAP "HT.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!define MUI_ICON "RCS.ico"
!define MUI_UNICON "RCS.ico"
BrandingText "]HackingTeam[ ${PACKAGE_NAME} (${PACKAGE_VERSION})"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section "Install Section" SecInstall
SetDetailsPrint "both"
DetailPrint "Extracting Exploits..."
SetDetailsPrint "textonly"
!cd '..'
RMDir /r "$INSTDIR\DB\exploits"
SetOutPath "$INSTDIR\DB\exploits"
File /r "exploits\*.*"
SetDetailsPrint "both"
DetailPrint "done"
!cd "nsis"
SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function .onInit
; check that 9.2.x is already installed
FileOpen $4 "$INSTDIR\DB\config\VERSION" r
FileRead $4 $1
FileClose $4
${If} $1 != ""
${StrStr} $0 $1 "9.2"
${If} $0 == ""
MessageBox MB_OK "This version can only be installed on 9.2.x systems, you have $1"
Quit
${EndIf}
${EndIf}
${IfNot} ${RunningX64}
MessageBox MB_OK "RCS can be installed only on 64 bit systems"
Quit
${EndIf}
${If} ${IsWin2008R2}
${AndIfNot} ${AtLeastServicePack} 1
MessageBox MB_OK "Please install Windows Server 2008 R2 SP1 before installing RCS"
${EndIf}
${IfNot} ${AtLeastWin2008R2}
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "RCS can be installed only on Windows Server 2008 R2 or above"
Quit
${EndIf}
${EndIf}
ReadRegDWORD $R0 HKLM "Software\HT\RCS" "installed"
; RCS is not installed
IntCmp $R0 1 +3 0 0
MessageBox MB_OK "RCS Agents can be installed only if RCS is already installed"
Quit
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;