openconnect.nsi.in 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!Nsis Installer Command Script
  2. #
  3. # This is an NSIS Installer Command Script generated automatically
  4. # by the Fedora nsiswrapper program. For more information see:
  5. #
  6. # https://fedoraproject.org/wiki/MinGW
  7. #
  8. # To build an installer from the script you would normally do:
  9. #
  10. # makensis this_script
  11. #
  12. # which will generate the output file 'openconnect-installer.exe' which is a Windows
  13. # installer containing your program.
  14. Name "OpenConnect"
  15. OutFile "openconnect-installer.exe"
  16. InstallDir "$ProgramFiles\OpenConnect"
  17. InstallDirRegKey HKLM SOFTWARE\OpenConnect "Install_Dir"
  18. ShowInstDetails hide
  19. ShowUninstDetails hide
  20. SetCompressor /FINAL lzma
  21. VIAddVersionKey ProductName "OpenConnect"
  22. XPStyle on
  23. !include "x64.nsh"
  24. Function .onInit
  25. ${If} ${RunningX64}
  26. SetRegView 64
  27. StrCpy $INSTDIR "$ProgramFiles64\OpenConnect"
  28. ${EndIf}
  29. FunctionEnd
  30. Page components
  31. Page directory
  32. Page instfiles
  33. ComponentText "Select which optional components you want to install."
  34. DirText "Please select the installation folder."
  35. Section "OpenConnect"
  36. SectionIn RO
  37. SetOutPath "$INSTDIR"
  38. !include instfiles.nsh
  39. ClearErrors
  40. FileOpen $0 "$INSTDIR\Online Documentation.url" w
  41. IfErrors done
  42. FileWrite $0 "[InternetShortcut]$\n"
  43. FileWrite $0 "URL=https://www.infradead.org/openconnect$\n"
  44. FileWrite $0 "IconIndex=0$\n"
  45. FileWrite $0 "IconFile=$INSTDIR\openconnect.exe$\n"
  46. FileClose $0
  47. done:
  48. SectionEnd
  49. Section "Start Menu Shortcuts"
  50. CreateDirectory "$SMPROGRAMS\OpenConnect"
  51. CreateShortCut "$SMPROGRAMS\OpenConnect\Uninstall OpenConnect.lnk" "$INSTDIR\Uninstall OpenConnect.exe" "" "$INSTDIR\Uninstall OpenConnect.exe" 0
  52. CreateShortCut "$SMPROGRAMS\OpenConnect\openconnect.exe.lnk" "$INSTDIR\.\openconnect.exe" "" "$INSTDIR\.\openconnect.exe" 0
  53. SectionEnd
  54. Section "Desktop Icons"
  55. CreateShortCut "$DESKTOP\openconnect.exe.lnk" "$INSTDIR\.\openconnect.exe" "" "$INSTDIR\.\openconnect.exe" 0
  56. SectionEnd
  57. Section "TAP-Windows driver"
  58. MessageBox MB_OK \
  59. "OpenConnect uses the TAP-Windows driver from OpenVPN to create virtual Ethernet adapters for \
  60. VPN connections. If you haven't already installed this driver, you should now install v9.21.2, \
  61. which works on Windows 2003, Windows Vista, or newer. \
  62. More information on this driver, and available versions, can be found at \
  63. https://community.openvpn.net/openvpn/wiki/GettingTapWindows"
  64. MessageBox MB_YESNO "Install TAP-Windows driver v9.21.2?" /SD IDYES IDNO endTapWindows
  65. DetailPrint "Running TAP-Windows driver setup..."
  66. ExecWait "$INSTDIR\tap-windows-9.21.2.exe"
  67. DetailPrint "Finished TAP-Windows driver setup"
  68. endTapWindows:
  69. SectionEnd
  70. Section "Uninstall"
  71. Delete /rebootok "$DESKTOP\openconnect.exe.lnk"
  72. Delete /rebootok "$SMPROGRAMS\OpenConnect\openconnect.exe.lnk"
  73. Delete /rebootok "$SMPROGRAMS\OpenConnect\Uninstall OpenConnect.lnk"
  74. RMDir "$SMPROGRAMS\OpenConnect"
  75. !include uninstfiles.nsh
  76. Delete /rebootok "$INSTDIR\Online Documentation.url"
  77. Delete /rebootok "$INSTDIR\Uninstall OpenConnect.exe"
  78. RMDir "$INSTDIR"
  79. SectionEnd
  80. Section -post
  81. WriteUninstaller "$INSTDIR\Uninstall OpenConnect.exe"
  82. SectionEnd