~ubuntu-branches/ubuntu/hardy/openvpn/hardy-security

« back to all changes in this revision

Viewing changes to install-win32/openvpn.nsi

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Gonzalez Iniesta
  • Date: 2005-01-05 19:03:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050105190311-mvqzpuhmlvobg9nh
Tags: 1.99+2.rc6-1
* The 'Three Wise Men' release.
* New upstream release.
* Update README.Debian with comments on changed string remapping.
  Thanks ron@debian.org for noting this first. (Closes: #288669)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
!include "MUI.nsh"
12
12
!include "setpath.nsi"
13
13
 
14
 
!define MASTER "z:\openvpn"
 
14
!define MASTER "y:\openvpn\20\openvpn"
 
15
 
15
16
!define HOME "c:\src\openvpn"
16
17
!define BIN "${HOME}\bin"
17
18
 
18
19
!define MUI_PRODUCT "OpenVPN"
19
 
!define MUI_VERSION "1.6.0" # AUTO_VERSION
 
20
!define MUI_VERSION "2.0_rc6" # AUTO_VERSION
 
21
 
 
22
!define TAP "tap0801"
 
23
!define TAPDRV "${TAP}.sys"
20
24
 
21
25
; something like "-DBG2"
22
26
!define OUTFILE_LABEL ""
53
57
  !define SOURCE_ZIP_DEST "openvpn-${MUI_VERSION}.zip"
54
58
  !define SOURCE_ZIP_SRC "${MASTER}\${SOURCE_ZIP_DEST}"
55
59
 
 
60
# For testing only
 
61
#!define SOURCE_ZIP_SRC "c:\src\openvpn\install-win32\null.zip"
 
62
 
56
63
;--------------------------------
57
64
;Modern UI Configuration
58
65
 
66
73
  !define MUI_FINISHPAGE
67
74
  !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\INSTALL-win32.txt"
68
75
  !define MUI_FINISHPAGE_NOAUTOCLOSE
69
 
  !define MUI_FINISHPAGE_NOREBOOTSUPPORT
 
76
  !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
70
77
  
71
78
  !define MUI_ABORTWARNING
72
79
  
153
160
Pop $R0
154
161
!macroend
155
162
 
 
163
;------------------------------------------
 
164
;Set reboot flag based on tapinstall return
 
165
 
 
166
Function CheckReboot
 
167
  IntCmp $R0 1 "" noreboot noreboot
 
168
  IntOp $R0 0 & 0
 
169
  SetRebootFlag true
 
170
  DetailPrint "REBOOT flag set"
 
171
 noreboot:
 
172
FunctionEnd
 
173
 
156
174
;--------------------------------
157
175
;Installer Sections
158
176
 
230
248
 
231
249
  SetOverwrite on
232
250
  SetOutPath "$INSTDIR\bin"
233
 
  File "${BIN}\ti2600.1106\tapinstall.exe"
 
251
  File "${BIN}\ti3790\tapinstall.exe"
234
252
 
235
253
  FileOpen $R0 "$INSTDIR\bin\addtap.bat" w
236
254
  FileWrite $R0 "rem Add a new TAP-Win32 virtual ethernet adapter$\r$\n"
237
 
  FileWrite $R0 '"$INSTDIR\bin\tapinstall.exe" install "$INSTDIR\driver\OemWin2k.inf" TAP$\r$\n'
 
255
  FileWrite $R0 '"$INSTDIR\bin\tapinstall.exe" install "$INSTDIR\driver\OemWin2k.inf" ${TAP}$\r$\n'
238
256
  FileWrite $R0 "pause$\r$\n"
239
257
  FileClose $R0
240
258
 
241
259
  FileOpen $R0 "$INSTDIR\bin\deltapall.bat" w
242
260
  FileWrite $R0 "echo WARNING: this script will delete ALL TAP-Win32 virtual adapters (use the device manager to delete adapters one at a time)$\r$\n"
243
261
  FileWrite $R0 "pause$\r$\n"
244
 
  FileWrite $R0 '"$INSTDIR\bin\tapinstall.exe" remove TAP$\r$\n'
 
262
  FileWrite $R0 '"$INSTDIR\bin\tapinstall.exe" remove ${TAP}$\r$\n'
245
263
  FileWrite $R0 "pause$\r$\n"
246
264
  FileClose $R0
247
265
 
248
266
  SetOutPath "$INSTDIR\driver"
249
267
  File "${HOME}\tap-win32\i386\OemWin2k.inf"
250
 
  File "${HOME}\tap-win32\i386\tapdrvr.sys"
 
268
  File "${HOME}\tap-win32\i386\${TAPDRV}"
251
269
 
252
270
SectionEnd
253
271
 
301
319
    ; If tapinstall error occurred, $5 will
302
320
    ; be nonzero.
303
321
    IntOp $5 0 & 0
304
 
    nsExec::ExecToStack '"$INSTDIR\bin\tapinstall.exe" hwids TAP'
 
322
    nsExec::ExecToStack '"$INSTDIR\bin\tapinstall.exe" hwids ${TAP}'
305
323
    Pop $R0 # return value/error/timeout
306
324
    IntOp $5 $5 | $R0
307
325
    DetailPrint "tapinstall hwids returned: $R0"
308
326
 
309
 
    ; If tapinstall output string contains "TAP" we assume
 
327
    ; If tapinstall output string contains "${TAP}" we assume
310
328
    ; that TAP device has been previously installed,
311
329
    ; therefore we will update, not install.
312
 
    Push "TAP"
 
330
    Push "${TAP}"
313
331
    Call StrStr
314
332
    Pop $R0
315
333
 
316
 
    IntCmp $5 0 +1 tapinstall_check_error tapinstall_check_error
 
334
    IntCmp $5 0 "" tapinstall_check_error tapinstall_check_error
317
335
    IntCmp $R0 -1 tapinstall
318
336
 
319
337
 ;tapupdate:
320
338
    DetailPrint "TAP-Win32 UPDATE"
321
 
    nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" update "$INSTDIR\driver\OemWin2k.inf" TAP'
 
339
    nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" update "$INSTDIR\driver\OemWin2k.inf" ${TAP}'
322
340
    Pop $R0 # return value/error/timeout
 
341
    Call CheckReboot
323
342
    IntOp $5 $5 | $R0
324
343
    DetailPrint "tapinstall update returned: $R0"
325
344
    Goto tapinstall_check_error
326
345
 
327
346
 tapinstall:
328
 
    DetailPrint "TAP-Win32 INSTALL"
329
 
    nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" install "$INSTDIR\driver\OemWin2k.inf" TAP'
330
 
    Pop $R0 # return value/error/timeout
 
347
    DetailPrint "TAP-Win32 REMOVE OLD TAP"
 
348
    nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" remove TAP'
 
349
    Pop $R0 # return value/error/timeout
 
350
    DetailPrint "tapinstall remove TAP returned: $R0"
 
351
    nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" remove TAPDEV'
 
352
    Pop $R0 # return value/error/timeout
 
353
    DetailPrint "tapinstall remove TAPDEV returned: $R0"
 
354
 
 
355
    DetailPrint "TAP-Win32 INSTALL (${TAP})"
 
356
    nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" install "$INSTDIR\driver\OemWin2k.inf" ${TAP}'
 
357
    Pop $R0 # return value/error/timeout
 
358
    Call CheckReboot
331
359
    IntOp $5 $5 | $R0
332
360
    DetailPrint "tapinstall install returned: $R0"
333
361
 
334
362
 tapinstall_check_error:
335
 
    IntCmp $5 +1 notap
 
363
    DetailPrint "tapinstall cumulative status: $5"
 
364
    IntCmp $5 0 notap
336
365
    MessageBox MB_OK "An error occurred installing the TAP-Win32 device driver."
337
366
 
338
367
 notap:
354
383
    !insertmacro WriteRegStringIfUndef HKLM "SOFTWARE\OpenVPN" "log_append"  "${SERV_LOG_APPEND}"
355
384
 
356
385
    ; install openvpnserv as a service
 
386
    DetailPrint "Previous Service REMOVE (if exists)"
 
387
    nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -remove'
 
388
    Pop $R0 # return value/error/timeout
357
389
    DetailPrint "Service INSTALL"
358
390
    nsExec::ExecToLog '"$INSTDIR\bin\openvpnserv.exe" -install'
359
391
    Pop $R0 # return value/error/timeout
416
448
  WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVPN" "UninstallString" "$INSTDIR\Uninstall.exe"
417
449
 
418
450
  ; Advise a reboot
419
 
  Messagebox MB_OK "IMPORTANT: Rebooting the system is advised in order to finalize TAP-Win32 driver installation/upgrade (this is an informational message only, pressing OK will not reboot)."
 
451
  ;Messagebox MB_OK "IMPORTANT: Rebooting the system is advised in order to finalize TAP-Win32 driver installation/upgrade (this is an informational message only, pressing OK will not reboot)."
420
452
 
421
453
SectionEnd
422
454
 
464
496
  Sleep 2000
465
497
 
466
498
  DetailPrint "TAP-Win32 REMOVE"
467
 
  nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" remove TAP'
 
499
  nsExec::ExecToLog '"$INSTDIR\bin\tapinstall.exe" remove ${TAP}'
468
500
  Pop $R0 # return value/error/timeout
469
501
  DetailPrint "tapinstall remove returned: $R0"
470
502
 
487
519
  Delete "$INSTDIR\log\README.txt"
488
520
 
489
521
  Delete "$INSTDIR\driver\OemWin2k.inf"
490
 
  Delete "$INSTDIR\driver\tapdrvr.sys"
 
522
  Delete "$INSTDIR\driver\${TAPDRV}"
491
523
 
492
524
  Delete "$INSTDIR\bin\openssl.exe"
493
525
 
507
539
  DeleteRegKey HKCU "Software\${MUI_PRODUCT}"
508
540
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVPN"
509
541
 
510
 
  Messagebox MB_OK "IMPORTANT: If you intend on reinstalling OpenVPN after this uninstall, and you are running Win2K, you are strongly urged to reboot before reinstalling (this is an informational message only, pressing OK will not reboot)."
 
542
  ;Messagebox MB_OK "IMPORTANT: If you intend on reinstalling OpenVPN after this uninstall, and you are running Win2K, you are strongly urged to reboot before reinstalling (this is an informational message only, pressing OK will not reboot)."
511
543
 
512
544
  ;Display the Finish header
513
545
  !insertmacro MUI_UNFINISHHEADER