forked from weldpua2008/HomeNET_instalation_pack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew_x64_and_x86_4_kill_proc_vnc.nsi
325 lines (252 loc) · 9.76 KB
/
new_x64_and_x86_4_kill_proc_vnc.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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
; Script generated with the Venis Install Wizard
; Define your application name
!define APPNAME "Homenet"
!define APPNAMEANDVERSION "Homenet pack 0.1.8"
VIProductVersion "1.0.0.0"
VIAddVersionKey "FileVersion" "1.0.0"
VIAddVersionKey "ProductName" "HomenetPack"
VIAddVersionKey "CompanyName" "Homenet"
VIAddVersionKey "LegalTrademarks" "home-net.org"
VIAddVersionKey "LegalCopyright" "CopyRights 2010© to [email protected]"
VIAddVersionKey "FileDescription" "dc++"
; !define SF_SELECTED 1
; !define SF_SUBSEC 2
; !define SF_SUBSECEND 4
; !define SF_BOLD 8
; !define SF_RO 16
; !define SF_EXPAND 32
; !define SECTION_OFF 0xFFFFFFFE
; ExecShell
; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\Homenet"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "homenet_pack_full.exe"
; Modern interface settings
!include "MUI.nsh"
;kill
!include "nsProcess.nsh"
!include "Sections.nsh"
!define MUI_ABORTWARNING
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Âûáåðåòè ÷òî áû çàïóñòèòü DC++"
!define MUI_FINISHPAGE_RUN "$INSTDIR\greylink\greylink.exe"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Set languages (first is default language)
;!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_RESERVEFILE_LANGDLL
Section /o "x86" Section1
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\greylink\"
File /r "greylink05999\greylink\*.*"
SetOutPath "$INSTDIR\homenet\"
File /r "homenet_tool\*.*"
SetOutPath "$INSTDIR\tightvnc\"
File /r "tightvnc\*.*"
CreateShortCut "$DESKTOP\Greylink.lnk" "$INSTDIR\greylink\greylink.exe"
CreateDirectory "$SMPROGRAMS\Homenet"
CreateShortCut "$SMPROGRAMS\Homenet\ping_test.lnk" "$INSTDIR\homenet\ping.exe"
CreateShortCut "$SMPROGRAMS\Homenet\Greylink.lnk" "$INSTDIR\greylink\greylink.exe"
CreateShortCut "$SMPROGRAMS\Homenet\Uninstall.lnk" "$INSTDIR\uninstall.exe"
CreateShortCut "$SMPROGRAMS\Homenet\VNC.lnk" "$INSTDIR\tightvnc\WinVNC.exe"
;autostart
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "homenet" "$INSTDIR\greylink\greylink.exe"
SectionEnd
Section /o "x64" Section2
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\greylink\"
File /r "greylink_homenet-x64\greylink\*.*"
SetOutPath "$INSTDIR\homenet\"
File /r "homenet_tool\*.*"
SetOutPath "$INSTDIR\tightvnc\"
File /r "tightvnc\*.*"
CreateShortCut "$DESKTOP\Greylink.lnk" "$INSTDIR\greylink\greylink.exe"
CreateDirectory "$SMPROGRAMS\Homenet"
CreateShortCut "$SMPROGRAMS\Homenet\ping_test.lnk" "$INSTDIR\homenet\ping.exe"
CreateShortCut "$SMPROGRAMS\Homenet\Greylink.lnk" "$INSTDIR\greylink\greylink.exe"
CreateShortCut "$SMPROGRAMS\Homenet\Uninstall.lnk" "$INSTDIR\uninstall.exe"
CreateShortCut "$SMPROGRAMS\Homenet\VNC.lnk" "$INSTDIR\tightvnc\WinVNC.exe"
SectionEnd
;ñëóæáà DHCP-êëèåíò (DHCP Client)
Section /o "âêëþ÷èòü DHCP-êëèåíò" Section3
; Set Section properties
SetOverwrite on
GetVersion::WindowsName
Pop $R0
StrCmp $R0 "7" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dhcp" "Start" "00000002"
StrCmp $R0 "Vista" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dhcp" "Start" "00000002"
StrCmp $R0 "XP" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dhcp" "Start" "00000002"
StrCmp $R0 "XP x64" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dhcp" "Start" "00000002"
SectionEnd
;DNS-êëèåíò (DNS Client)
Section /o "âêëþ÷èòü DNS-êëèåíò" Section4
; Set Section properties
SetOverwrite on
GetVersion::WindowsName
Pop $R0
StrCmp $R0 "7" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dnscache" "Start" "00000002"
StrCmp $R0 "Vista" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dnscache" "Start" "00000002"
StrCmp $R0 "XP" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dnscache" "Start" "00000002"
StrCmp $R0 "XP x64" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dnscache" "Start" "00000002"
SectionEnd
;IPSEC Services (Ñëóæáû IPSEC)
Section /o "Îòêëþ÷èòü ñëóæáó IPSEC" Section5
; Set Section properties
SetOverwrite on
GetVersion::WindowsName
Pop $R0
StrCmp $R0 "7" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\PolicyAgent" "Start" "00000004"
StrCmp $R0 "Vista" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\PolicyAgent" "Start" "00000004"
StrCmp $R0 "XP" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\PolicyAgent" "Start" "00000004"
StrCmp $R0 "XP x64" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\PolicyAgent" "Start" "00000004"
SectionEnd
;àâòîçàãðóçêà ÄÑ+++
Section /o "àâòîçàãðóçêà DC++" Section6
;autostart
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "homenet" "$INSTDIR\greylink\greylink.exe"
SectionEnd
Section /o "îòêëþ÷èòü IP âåðñèè 6" Section7
;ipv6
GetVersion::WindowsName
Pop $R0
StrCmp $R0 "Vista" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\" "DisabledComponents" "0xffffffff"
StrCmp $R0 "7" 0 +2
WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\" "DisabledComponents" "4294967295"
SectionEnd
Function .onSelChange
SectionGetFlags ${section1} $1
SectionGetFlags ${section2} $2
StrCmp $1 "1" 0 N1
SectionGetFlags ${section2} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section2} $0
N1:
StrCmp $2 "1" 0 N2
SectionGetFlags ${section1} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${section1} $0
N2:
FunctionEnd
Section -FinishSection
WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
;vnc section
;seven
GetVersion::WindowsName
Pop $R0
;DHCP-êëèåíò (DHCP Client)
;DNS-êëèåíò (DNS Client)
;Àãåíò ïîëèòèêè IPsec (IPsec Policy Agent)
;Ìàðøðóòèçàöèÿ è óäàëåííûé äîñòóï (Routing and Remote Access)
;StrCmp $R0 "7" 0 +7
;WriteRegBin HKCU "Software\ORL\WinVNC3" "Password" "04a80c01b072856f"
;WriteRegBin HKCU "Software\ORL\WinVNC3" "PasswordViewOnly" "04a80c01b072856f"
;WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dhcp" "Start" "00000002"
;WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\Dnscache" "Start" "00000002"
;WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\PolicyAgent" "Start" "00000003"
;WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\RemoteAccess" "Start" "00000004"
;GetVersion::WindowsName
;Pop $R0
;StrCmp $R0 "xp" 0 +3
;WriteRegBin HKCU "S-1-5-21-1801674531-1343024091-789743027-1004\Software\ORL\WinVNC3" "Password" "04a80c01b072856f"
;WriteRegBin HKCU "S-1-5-21-1801674531-1343024091-789743027-1004\Software\ORL\WinVNC3" "PasswordViewOnly" "04a80c01b072856f"
MessageBox MB_YESNO|MB_ICONQUESTION "Íóæíî ïåðåçåãðóçèòüñÿ. Õîòèòå âûïîëíèòü ïåðåçàãðóçêó ñåé÷àñ?" IDNO +2
Reboot
SectionEnd
; Modern install component descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Windows XP,Vista,7 32bit"
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Widows XP, Vista, 7 64bit"
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} "Âêëþ÷èòü ñëóæáó DHCP-êëèåíò (DHCP Client)"
!insertmacro MUI_DESCRIPTION_TEXT ${Section4} "Âêëþ÷èòü ñëóæáó DNS-êëèåíò (DNS Client)"
!insertmacro MUI_DESCRIPTION_TEXT ${Section5} "Îòêëþ÷èòü ñëóæáó IPSEC"
!insertmacro MUI_DESCRIPTION_TEXT ${Section6} "âêëþ÷èòü àâòîçàãðóçêó ÄÑ++"
!insertmacro MUI_DESCRIPTION_TEXT ${Section7} "îòêëþ÷èòü TCP/IP âåðñèè 6"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;Uninstall section
Section Uninstall
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "homenet"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
; Delete self
Delete "$INSTDIR\uninstall.exe"
; Delete Shortcuts
Delete "$DESKTOP\Greylink.lnk"
Delete "$SMPROGRAMS\Homenet\ping_test.lnk"
Delete "$SMPROGRAMS\Homenet\Greylink.lnk"
Delete "$SMPROGRAMS\Homenet\Uninstall.lnk"
Delete "$SMPROGRAMS\Homenet\VNC.lnk"
; RMDir /r "$SMPROGRAMS\Homenet\"
RMDir /r "$INSTDIR\greylink\"
SectionEnd
; On initialization
Function .onInit
;enable DHCP client by default
SectionSetFlags ${section3} 1
;enable DNS client by default
SectionSetFlags ${section4} 1
;disable IPSEC Services (Ñëóæáû IPSEC)
SectionSetFlags ${section5} 1
;autostart dc++
SectionSetFlags ${section6} 1
;èï âåðñèè 6
SectionSetFlags ${Section7} 1
;if 32 bit set for 32bit
GetVersion::WindowsPlatformId
Pop $R0
SectionSetFlags ${section1} 0
SectionSetFlags ${section2} 1
;Goto +7
StrCmp $R0 "64" 0 +4
SectionSetFlags ${section1} 0
SectionSetFlags ${section2} 1
Goto +3
SectionSetFlags ${section1} 1
SectionSetFlags ${section2} 0
;;;;;;;;;;;;;;;;;
Goto start
end:
Quit
start:
${nsProcess::FindProcess} "greylink.exe" $R0
StrCmp $R0 0 0 +5
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'Çàêðûòü "ÄÑ++" äëÿ ïðîäîëæåíèÿ óñòàíîâêè?' IDOK loop IDCANCEL end
loop:
${nsProcess::KillProcess} "greylink.exe" $R0
MessageBox MB_OK "Ïðèëîæåíèå ÄÑ++ áûëî çàâåðøåíî" ; Errorlevel: [$R0]"
${nsProcess::Unload}
;end:
; kill DC++
; nsExec::Exec '$INSTDIR\homenet\wkill.exe -n "greylink.exe"'
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
BrandingText "home-net"
; eof