Simple hotkey putty session launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

install.nsi 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ;NSIS Modern User Interface
  2. ;Basic Example Script
  3. ;Written by Joost Verburg
  4. ;--------------------------------
  5. ;Include Modern UI
  6. !define Vendor "Ruckus Software"
  7. !define Title "Putty Session Launcher"
  8. !define Binary "PuttySessionLauncher.exe"
  9. !include "MUI2.nsh"
  10. ;--------------------------------
  11. ;General
  12. SetCompressor /SOLID lzma
  13. ;Name and file
  14. Name "${Vendor} - ${Title}"
  15. OutFile ".\Dist\${Title} Installer.exe"
  16. ;Default installation folder
  17. InstallDir "$PROGRAMFILES\${Vendor}\${Title}"
  18. ;Get installation folder from registry if available
  19. InstallDirRegKey HKCU "Software\${Vendor}\${Title}" ""
  20. ;RequestExecutionLevel admin
  21. ;--------------------------------
  22. ;Interface Settings
  23. !define MUI_ABORTWARNING
  24. ;--------------------------------
  25. ;Pages
  26. !insertmacro MUI_PAGE_LICENSE "LICENSE"
  27. !insertmacro MUI_PAGE_COMPONENTS
  28. !insertmacro MUI_PAGE_DIRECTORY
  29. !insertmacro MUI_PAGE_INSTFILES
  30. !insertmacro MUI_UNPAGE_CONFIRM
  31. !insertmacro MUI_UNPAGE_INSTFILES
  32. ;--------------------------------
  33. ;Languages
  34. !insertmacro MUI_LANGUAGE "English"
  35. ;--------------------------------
  36. ;Installer Sections
  37. Section "${Title}" SecMain
  38. ; Core
  39. SetOutPath "$INSTDIR"
  40. CreateDirectory "$INSTDIR"
  41. File "PuttySessionLauncher\PuttySessionLauncher\bin\Release\${Binary}"
  42. # File "PuttySessionLauncher\PuttySessionLauncher\bin\Release\config.txt"
  43. SectionEnd
  44. Section "Start Menu Shortcuts" SecShortcuts
  45. CreateDirectory "$SMPROGRAMS\${Vendor}\${Title}"
  46. CreateShortCut "$SMPROGRAMS\${Vendor}\${Title}\${Title}.lnk" "$INSTDIR\${Binary}"
  47. CreateShortCut "$SMPROGRAMS\${Vendor}\${Title}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  48. SectionEnd
  49. Section "-Uninstaller" SecUninstaller
  50. ; Store installation folder
  51. WriteRegStr HKCU "Software\${Vendor}\${Title}" "" $INSTDIR
  52. ; Create uninstaller
  53. CreateDirectory "$PROGRAMFILES\${Vendor}\${Title}"
  54. WriteUninstaller "$PROGRAMFILES\${Vendor}\${Title}\Uninstall.exe"
  55. ; Add uninstaller to Add/Remove Programs (Programs and Features in Vista+)
  56. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Title}" "DisplayName" "${Title}"
  57. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Title}" "UninstallString" "$\"$PROGRAMFILES\${Vendor}\${Title}\Uninstall.exe$\""
  58. SectionEnd
  59. ;--------------------------------
  60. ;Descriptions
  61. ;Language strings
  62. LangString DESC_SecMain ${LANG_ENGLISH} "${Title} core application"
  63. LangString DESC_SecUninstaller ${LANG_ENGLISH} "Adds an uninstaller to remove ${Title}"
  64. ;Assign language strings to sections
  65. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  66. !insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain)
  67. !insertmacro MUI_DESCRIPTION_TEXT ${SecUninstaller} $(DESC_SecUninstaller)
  68. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  69. ;--------------------------------
  70. ;Uninstaller Section
  71. Section "Uninstall"
  72. ; Remove installed files here
  73. Delete "$INSTDIR\Uninstall.exe"
  74. Delete "$INSTDIR\${Binary}"
  75. RMDir "$INSTDIR"
  76. Delete "$SMPRograms\${Vendor}\${Title}\Uninstall.lnk"
  77. Delete "$SMPRograms\${Vendor}\${Title}\${Title}.lnk"
  78. RMDir "$SMPROGRAMS\${Vendor}\${Title}"
  79. RMDir "$SMPROGRAMS\${Vendor}"
  80. DeleteRegKey HKCU "Software\${Vendor}\${Title}"
  81. DeleteRegKey /ifempty HKCU "Software\${Vendor}\${Title}"
  82. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${Title}"
  83. SectionEnd