Posted to tcl by dbohdan at Mon Aug 08 15:07:58 GMT 2016view raw

  1. ;--------------------------------
  2. ;Include Modern UI
  3.  
  4. !include "MUI2.nsh"
  5.  
  6. ;--------------------------------
  7. ;General
  8.  
  9. !define APPNAME "Tcl 8.6 for Windows (Unofficial)"
  10. !define VERSION "8.6.6-0.1.0"
  11.  
  12. ;Name and file
  13. Name "${APPNAME}"
  14. OutFile "tcl86-installer-${VERSION}.exe"
  15. SetCompressor /SOLID lzma
  16.  
  17. ;Default installation folder
  18. InstallDir "$LOCALAPPDATA\Tcl86"
  19.  
  20. ;Get installation folder from registry if available
  21. InstallDirRegKey HKCU "Software\${APPNAME}" ""
  22.  
  23. ;Request application privileges for Windows Vista
  24. RequestExecutionLevel user
  25.  
  26. ;--------------------------------
  27. ;Interface Settings
  28.  
  29. !define MUI_ABORTWARNING
  30.  
  31. ;--------------------------------
  32. ;Pages
  33.  
  34. ; !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
  35. !insertmacro MUI_PAGE_COMPONENTS
  36. !insertmacro MUI_PAGE_DIRECTORY
  37. !insertmacro MUI_PAGE_INSTFILES
  38.  
  39. !insertmacro MUI_UNPAGE_CONFIRM
  40. !insertmacro MUI_UNPAGE_INSTFILES
  41.  
  42. ;--------------------------------
  43. ;Languages
  44.  
  45. !insertmacro MUI_LANGUAGE "English"
  46.  
  47. ;--------------------------------
  48. ;Installer Sections
  49.  
  50. Section "Tcl 8.6 for Windows" SecTcl
  51.  
  52. SetOutPath "$INSTDIR"
  53.  
  54. ;ADD YOUR OWN FILES HERE...
  55. File /r "Tcl86\"
  56.  
  57. ;Store installation folder
  58. WriteRegStr HKCU "Software\${APPNAME}" "" $INSTDIR
  59.  
  60. ;Create uninstaller
  61. WriteUninstaller "$INSTDIR\Uninstall.exe"
  62.  
  63. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \
  64. "DisplayName" "${APPNAME}"
  65. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \
  66. "DisplayVersion" "${VERSION}"
  67. WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \
  68. "UninstallString" "$INSTDIR\Uninstall.exe"
  69. SectionEnd
  70.  
  71. Section "Start menu shortcuts"
  72. createDirectory "$SMPROGRAMS\${APPNAME}"
  73. createShortCut "$SMPROGRAMS\${APPNAME}\Tcl command shell.lnk" "$INSTDIR\bin\tclsh.exe" "" "" "" "" "" "Console for interactive execution of commands in the Tcl language"
  74. createShortCut "$SMPROGRAMS\${APPNAME}\Tk graphical console.lnk" "$INSTDIR\bin\wish.exe" "" "" "" "" "" "Graphical console for interactive execution of commands using the Tcl/Tk toolkit"
  75. createShortCut "$SMPROGRAMS\${APPNAME}\Tkcon enhanced console.lnk" "$INSTDIR\bin\wish.exe" "$\"$INSTDIR\bin\tkcon.tcl$\"" "" "" "" "" "Graphical enhanced console for interactive execution of commands using the Tcl/Tk toolkit"
  76. createShortCut "$SMPROGRAMS\${APPNAME}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "" "" "" "" "Uninstall ${APPNAME}"
  77. SectionEnd
  78.  
  79. ;--------------------------------
  80. ;Uninstaller Section
  81.  
  82. Section "Uninstall"
  83.  
  84. ;ADD YOUR OWN FILES HERE...
  85. RMDir /r /r "$INSTDIR\bin\"
  86. RMDir /r "$INSTDIR\lib\"
  87.  
  88. Delete "$SMPROGRAMS\${APPNAME}\Tcl command shell.lnk"
  89. Delete "$SMPROGRAMS\${APPNAME}\Tk graphical console.lnk"
  90. Delete "$SMPROGRAMS\${APPNAME}\Tkcon enhanced console.lnk"
  91. Delete "$SMPROGRAMS\${APPNAME}\Uninstall.lnk"
  92. RMDir "$SMPROGRAMS\${APPNAME}"
  93.  
  94. Delete "$INSTDIR\Uninstall.exe"
  95.  
  96. RMDir "$INSTDIR"
  97.  
  98. DeleteRegKey /ifempty HKCU "Software\${APPNAME}"
  99. DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
  100. SectionEnd