-
Notifications
You must be signed in to change notification settings - Fork 183
/
RCS-Agents.nsi
139 lines (102 loc) · 3.18 KB
/
RCS-Agents.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
129
130
131
132
133
134
135
136
137
138
139
;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-Agents"
!Define /file PACKAGE_VERSION "..\config\VERSION_BUILD"
;Name and file
Name "RCS-Agents"
OutFile "rcs-agents-${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 Agents files..."
SetDetailsPrint "textonly"
!cd '..'
SetOutPath "$INSTDIR\DB\cores"
File /r "cores\*.*"
SetOutPath "$INSTDIR\DB\config"
File "config\blacklist"
File "config\blacklist_analysis"
File "config\VERSION_BUILD"
File "config\VERSION"
SetDetailsPrint "both"
DetailPrint "done"
DetailPrint "ReStarting RCS DB..."
SimpleSC::RestartService "RCSDB" "" 30
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;