This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
installer.nsi
295 lines (235 loc) · 10.4 KB
/
installer.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
!addplugindir "plugins\"
Var uninstallerPath
Section "-hidden"
;Search if mhddos_proxy_installer is already installed.
FindFirst $0 $1 "$uninstallerPath\${UNINSTALLER_NAME}.exe"
FindClose $0
StrCmp $1 "" done
;Run the uninstaller of the previous install.
DetailPrint $(inst_unist)
ExecWait '"$uninstallerPath\${UNINSTALLER_NAME}.exe" /S _?=$uninstallerPath'
Delete "$uninstallerPath\${UNINSTALLER_NAME}.exe"
RMDir "$uninstallerPath"
done:
SectionEnd
Section
SectionIn RO # Just means if in component mode this is locked
;Set output path to the installation directory.
SetOutPath $INSTDIR
;Store installation folder in registry
WriteRegStr HKLM "Software\${PRODUCT}" "" $INSTDIR
;Registry information for add/remove programs
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayName" "${PRODUCT}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "UninstallString" '"$INSTDIR\${UNINSTALLER_NAME}.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayIcon" '"$INSTDIR\itarmy.ico",0'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "Publisher" "IT Army of Ukraine"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "URLInfoAbout" "https://github.com/OleksandrBlack/ukita_installer"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "NoRepair" 1
WriteUninstaller "${UNINSTALLER_NAME}.exe"
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "EstimatedSize" "$0"
;Create optional start menu shortcut for uninstaller and Main component
CreateDirectory "$SMPROGRAMS\${PRODUCT}"
CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall ${PRODUCT}.lnk" "$INSTDIR\${UNINSTALLER_NAME}.exe" "" "$INSTDIR\${UNINSTALLER_NAME}.exe" 0
nsExec::Exec 'cmd /c "powershell -ExecutionPolicy Bypass -NoProfile -Command Add-MpPreference -ExclusionPath "$INSTDIR""'
;Create uninstaller
WriteUninstaller "${UNINSTALLER_NAME}.exe"
SectionEnd
Section ;RUNNER
SetOutPath $INSTDIR
FileOpen $9 runner.bat w
FileWrite $9 "@ECHO off$\r$\n"
FileWrite $9 "SET AUTO_MH=1$\r$\n"
FileWrite $9 "CLS$\r$\n"
FileWrite $9 "COLOR 0A$\r$\n"
FileWrite $9 ":MAIN$\r$\n"
FileWrite $9 "FOR %%A IN (%*) DO (IF '%%A'=='' goto MAIN_INFO)$\r$\n"
FileWrite $9 ":RUN_MHDDOS_PROXY$\r$\n"
FileWrite $9 "FOR %%A IN (%*) DO (IF '%%A'=='-itarmy' goto ITARMY)$\r$\n"
FileWrite $9 "FOR %%A IN (%*) DO (IF '%%A'=='-itarmy_powerfull' goto ITARMY_POWERFULL)$\r$\n"
FileWrite $9 "FOR %%A IN (%*) DO (IF '%%A'=='-itarmy_db1000n' goto ITARMY_DB1000N)$\r$\n"
FileWrite $9 "FOR %%A IN (%*) DO (IF '%%A'=='-itarmy_distress' goto ITARMY_DISTRESS)$\r$\n"
FileWrite $9 ":MAIN_INFO$\r$\n"
FileWrite $9 "ECHO.$\r$\n"
FileWrite $9 "ECHO 1. Run MHDDOS_PROXY Attack$\r$\n"
FileWrite $9 "ECHO 2. Run DB1000N Attack$\r$\n"
FileWrite $9 "ECHO 3. Run DSTREES Attack$\r$\n"
FileWrite $9 "set /p choice=Enter a number to start the action:$\r$\n"
FileWrite $9 "if '%choice%'=='' ECHO '%choice%' is not a valid option, please try again$\r$\n"
FileWrite $9 "if '%choice%'=='1' goto ITARMY$\r$\n"
FileWrite $9 "if '%choice%'=='2' goto ITARMY_DB1000N$\r$\n"
FileWrite $9 "if '%choice%'=='3' goto ITARMY_DISTRESS$\r$\n"
FileWrite $9 "goto END$\r$\n"
FileWrite $9 ":ITARMY$\r$\n"
FileWrite $9 "CD ${MHDDOS_PROXY_DIR}$\r$\n"
FileWrite $9 "ECHO Start MHDDOS_PROXY Attack ItArmy Targets$\r$\n"
${If} ${RunningX64}
FileWrite $9 "mhddos_proxy_win.exe$\r$\n"
${Else}
FileWrite $9 "mhddos_proxy_win_x86.exe$\r$\n"
${EndIf}
FileWrite $9 "goto END$\r$\n"
FileWrite $9 ":ITARMY_DB1000N$\r$\n"
FileWrite $9 "CD ${DB1000N_DIR}$\r$\n"
FileWrite $9 "ECHO Start DB1000N Attack ItArmy Targets$\r$\n"
${If} $UserID_State == ${BST_CHECKED}
FileWrite $9 "db1000n.exe -enable-self-update --user-id $UserID$\r$\n"
${Else}
FileWrite $9 "db1000n.exe -enable-self-update$\r$\n"
${EndIf}
FileWrite $9 "goto END$\r$\n"
FileWrite $9 ":ITARMY_DISTRESS$\r$\n"
FileWrite $9 "CD ${DISTRESS_DIR}$\r$\n"
FileWrite $9 "ECHO Start DISTRESS Attack ItArmy Targets$\r$\n"
${If} ${RunningX64}
${If} $UserID_State == ${BST_CHECKED}
FileWrite $9 "distress_x86_64-pc-windows-msvc.exe -c 4096 --user-id $UserID$\r$\n"
${Else}
FileWrite $9 "distress_x86_64-pc-windows-msvc.exe -c 4096$\r$\n"
${EndIf}
${Else}
${If} $UserID_State == ${BST_CHECKED}
FileWrite $9 "distress_i686-pc-windows-msvc.exe -c 2048 --user-id $UserID$\r$\n"
${Else}
FileWrite $9 "distress_i686-pc-windows-msvc.exe -c 2048$\r$\n"
${EndIf}
${EndIf}
FileWrite $9 "goto END$\r$\n"
FileWrite $9 ":END$\r$\n"
FileWrite $9 "EXIT$\r$\n"
FileClose $9
SectionEnd
Section "mhddos_proxy"
SetOutPath ${MHDDOS_PROXY_DIR}
;Add mhddos firewall rules
File "resources\mhddos_config.ico"
FileOpen $9 mhddos.ini w
FileWrite $9 "###$(mhs_settings) mhddos_proxy###$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(userid_title) (https://t.me/itarmy_stat_bot)##$\r$\n"
${If} $UserID_State == ${BST_CHECKED}
FileWrite $9 "user-id=$UserID$\r$\n"
${Else}
FileWrite $9 "#user-id=your personal statistics identifier$\r$\n"
${EndIf}
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_text_lng)##$\r$\n"
FileWrite $9 "#lang = ua | en | es | de | pl | lt$\r$\n"
FileWrite $9 "lang = $(mhs_lang)$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_copies)##$\r$\n"
FileWrite $9 "#copies = 1 | 2 | auto$\r$\n"
FileWrite $9 "copies = 1$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_vpn)##$\r$\n"
FileWrite $9 "#vpn = true | false$\r$\n"
FileWrite $9 "vpn = false$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_percents)##$\r$\n"
FileWrite $9 "#vpn-percents = 2$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_threads)##$\r$\n"
FileWrite $9 "#threads = 8000$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_requests)##$\r$\n"
FileWrite $9 "#requests-per-connection = 2000$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_proxy)##$\r$\n"
FileWrite $9 "#proxy = [socks4://114.231.123.38:3065, socks5://114.231.123.38:1080]$\r$\n"
FileWrite $9 "$\r$\n"
FileWrite $9 "##$(mhs_proxies)##$\r$\n"
FileWrite $9 "#proxies = proxies.txt | https://pastebin.com/raw/UkFWzLOt$\r$\n"
FileClose $9
${If} ${RunningX64}
File /nonfatal /r "requirements\mhddos\x64\*"
${Else}
File /nonfatal /r "requirements\mhddos\x86\*"
${EndIf}
DetailPrint "AddAuthorizedApplication UkITA_MHDDOS_PROXY"
${If} ${RunningX64}
SimpleFC::AddApplication "UkITA_MHDDOS_PROXY" "${MHDDOS_PROXY_DIR}\mhddos_proxy_win.exe" 0 2 "" 1
nsExec::Exec 'cmd /c "powershell -ExecutionPolicy Bypass -NoProfile -Command Add-MpPreference -ExclusionProcess "mhddos_proxy_win.exe""'
${Else}
SimpleFC::AddApplication "UkITA_MHDDOS_PROXY" "${MHDDOS_PROXY_DIR}\mhddos_proxy_win_x86.exe" 0 2 "" 1
nsExec::Exec 'cmd /c "powershell -ExecutionPolicy Bypass -NoProfile -Command Add-MpPreference -ExclusionProcess "mhddos_proxy_win_x86.exe""'
${EndIf}
CreateShortCut "$DESKTOP\MHDDOS_PROXY.lnk" "${MHDDOS_PROXY_DIR}\mhddos_proxy_win.exe" "" "${MHDDOS_PROXY_DIR}\mhddos_proxy_win.exe" 0
CreateShortCut "$DESKTOP\MHDDOS_PROXY_CONFIG.lnk" "${MHDDOS_PROXY_DIR}\mhddos.ini" "" "${MHDDOS_PROXY_DIR}\mhddos_config.ico" 0
SectionEnd
Section "db1000n"
SetOutPath ${DB1000N_DIR}
;Add mhddos firewall rules
File "resources\itarmy_d1000n.ico"
${If} ${RunningX64}
File /nonfatal /r "requirements\db1000n\x64\*"
${Else}
File /nonfatal /r "requirements\db1000n\x86\*"
${EndIf}
DetailPrint "AddAuthorizedApplication UkITA_DB1000N"
SimpleFC::AddApplication "UkITA_DB1000N" "${DB1000N_DIR}\db1000n.exe" 0 2 "" 1
nsExec::Exec 'cmd /c "powershell -ExecutionPolicy Bypass -NoProfile -Command Add-MpPreference -ExclusionProcess "db1000n.exe""'
CreateShortCut "$DESKTOP\DB1000N.lnk" "$INSTDIR\runner.bat" "-itarmy_db1000n" "${DB1000N_DIR}\itarmy_d1000n.ico" 0
SectionEnd
Section "distress"
;SectionIn RO
SetOutPath ${DISTRESS_DIR}
;Add mhddos firewall rules
File "resources\itarmy_distress.ico"
${If} ${RunningX64}
File /nonfatal /r "requirements\distress\x64\*"
${Else}
File /nonfatal /r "requirements\distress\x86\*"
${EndIf}
DetailPrint "AddAuthorizedApplication UkITA_DISTRESS"
${If} ${RunningX64}
SimpleFC::AddApplication "UkITA_DISTRESS" "${DISTRESS_DIR}\distress_x86_64-pc-windows-msvc.exe" 0 2 "" 1
nsExec::Exec 'cmd /c "powershell -ExecutionPolicy Bypass -NoProfile -Command Add-MpPreference -ExclusionProcess "distress_x86_64-pc-windows-msvc.exe""'
${Else}
SimpleFC::AddApplication "UkITA_DISTRESS" "${DISTRESS_DIR}\distress_i686-pc-windows-msvc.exe" 0 2 "" 1
nsExec::Exec 'cmd /c "powershell -ExecutionPolicy Bypass -NoProfile -Command Add-MpPreference -ExclusionProcess "distress_i686-pc-windows-msvc.exe""'
${EndIf}
CreateShortCut "$DESKTOP\DISTRESS.lnk" "$INSTDIR\runner.bat" "-itarmy_distress" "${DISTRESS_DIR}\itarmy_distress.ico" 0
SectionEnd
var TelegramCheckbox
var DiscordCheckbox
Function ShowFinishCheckbox
${NSD_CreateCheckbox} 125u 175u 100u 15u "$(open_telegram_link)"
Pop $TelegramCheckbox
SetCtlColors $TelegramCheckbox "" "ffffff"
${NSD_CreateCheckbox} 225u 175u 100u 15u "$(open_discord_link)"
Pop $DiscordCheckbox
SetCtlColors $DiscordCheckbox "" "ffffff"
FunctionEnd
Function OpenFinishLink
${NSD_GetState} $TelegramCheckbox $0
${If} $0 <> 0
ExecShell "open" "${telegram_link}"
${EndIf}
${NSD_GetState} $DiscordCheckbox $0
${If} $0 <> 0
ExecShell "open" "${discord_link}"
${EndIf}
FunctionEnd
;--------------------------------
;After Installation Function
Function .onInstSuccess
;Open 'Thank you for installing' site or something else
;ExecShell "open" "https://t.me/itarmyofukraine2022"
FunctionEnd
Function .onInit
StrCpy $Language ${LANG_UKRAINIAN}
!insertmacro MUI_LANGDLL_DISPLAY
;Search if mhddos_proxy_installer is already installed.
FindFirst $0 $1 "$INSTDIR\${UNINSTALLER_NAME}.exe"
FindClose $0
StrCmp $1 "" done
;Copy old value to var so we can call the correct uninstaller
StrCpy $uninstallerPath $INSTDIR
;Inform the user
MessageBox MB_OKCANCEL|MB_ICONINFORMATION $(inst_uninstall_question) /SD IDOK IDOK done
Quit
done:
FunctionEnd