installer.nsi 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. ; Haxe/Neko Install script
  2. ;--------------------------------
  3. !include "MUI.nsh"
  4. !include "LogicLib.nsh"
  5. !include "WordFunc.nsh"
  6. !include "winmessages.nsh"
  7. !include "EnvVarUpdate.nsh"
  8. ;--------------------------------
  9. ; Define version info
  10. !define VERSION "3.0.0"
  11. ; Define Neko info
  12. !define NEKO_VERSION "2.0.0"
  13. ; Installer details
  14. VIAddVersionKey "CompanyName" "Haxe Foundation"
  15. VIAddVersionKey "ProductName" "Haxe Installer"
  16. VIAddVersionKey "LegalCopyright" "Haxe Foundation 2005-2013"
  17. VIAddVersionKey "FileDescription" "Haxe Installer"
  18. VIAddVersionKey "ProductVersion" "${VERSION}.0"
  19. VIAddVersionKey "FileVersion" "${VERSION}.0"
  20. VIProductVersion "${VERSION}.0"
  21. ; The name of the installer
  22. Name "Haxe ${VERSION}"
  23. ; The captions of the installer
  24. Caption "Haxe ${VERSION} Setup"
  25. UninstallCaption "Haxe ${VERSION} Uninstall"
  26. ; The file to write
  27. OutFile "haxe-${VERSION}-win.exe"
  28. ; Default installation folder
  29. InstallDir "C:\HaxeToolkit\"
  30. ; Define executable files
  31. !define EXECUTABLE "$INSTDIR\haxe\haxe.exe"
  32. !define HaxeLIB "$INSTDIR\Haxe\haxelib.exe"
  33. !define NEKOEXE "$INSTDIR\neko\neko.exe"
  34. ; Vista redirects $SMPROGRAMS to all users without this
  35. RequestExecutionLevel admin
  36. ; Use replace and version compare
  37. !insertmacro WordReplace
  38. !insertmacro VersionCompare
  39. ; Required props
  40. SetFont /LANG=${LANG_ENGLISH} "Tahoma" 8
  41. SetCompressor /SOLID lzma
  42. CRCCheck on
  43. XPStyle on
  44. ;--------------------------------
  45. ; Interface Configuration
  46. !define MUI_HEADERIMAGE
  47. !define MUI_ABORTWARNING
  48. !define MUI_HEADERIMAGE_BITMAP "images\Banner.bmp"
  49. !define MUI_WELCOMEFINISHPAGE_BITMAP "images\Wizard.bmp"
  50. !define MUI_UNWELCOMEFINISHPAGE_BITMAP "images\Wizard.bmp"
  51. !define MUI_PAGE_HEADER_SUBTEXT "Please view the license before installing Haxe ${VERSION}."
  52. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of $(^NameDA).\r\n\r\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.\r\n\r\n$_CLICK"
  53. ;--------------------------------
  54. ; Pages
  55. !insertmacro MUI_PAGE_WELCOME
  56. !insertmacro MUI_PAGE_COMPONENTS
  57. !insertmacro MUI_PAGE_DIRECTORY
  58. !insertmacro MUI_PAGE_INSTFILES
  59. !insertmacro MUI_PAGE_FINISH
  60. !insertmacro MUI_UNPAGE_WELCOME
  61. !insertmacro MUI_UNPAGE_CONFIRM
  62. !insertmacro MUI_UNPAGE_COMPONENTS
  63. !insertmacro MUI_UNPAGE_INSTFILES
  64. !insertmacro MUI_UNPAGE_FINISH
  65. !insertmacro MUI_LANGUAGE "English"
  66. ;--------------------------------
  67. ; InstallTypes
  68. InstType "Default"
  69. InstType "un.Default"
  70. InstType "un.Full"
  71. ;--------------------------------
  72. ; Functions
  73. Function .onInit
  74. FunctionEnd
  75. ;--------------------------------
  76. ; Install Sections
  77. !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
  78. !define env_hkcu 'HKCU "Environment"'
  79. Section "Haxe ${VERSION}" Main
  80. SectionIn 1 2 RO
  81. SetOverwrite on
  82. SetOutPath "$INSTDIR\haxe"
  83. File /r /x .svn /x *.db /x Exceptions.log /x .local /x .multi /x *.pdb /x *.vshost.exe /x *.vshost.exe.config /x *.vshost.exe.manifest "resources\haxe\*.*"
  84. ExecWait "$INSTDIR\haxe\haxesetup.exe -silent"
  85. WriteUninstaller "$INSTDIR\Uninstall.exe"
  86. SectionEnd
  87. Section "Neko ${NEKO_VERSION}" Neko
  88. SectionIn 1 2
  89. SetOverwrite on
  90. SetOutPath "$INSTDIR\neko"
  91. File /r /x .svn /x *.db /x Exceptions.log /x .local /x .multi /x *.pdb /x *.vshost.exe /x *.vshost.exe.config /x *.vshost.exe.manifest "resources\neko\*.*"
  92. SectionEnd
  93. ;--------------------------------
  94. ; Install section strings
  95. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  96. !insertmacro MUI_DESCRIPTION_TEXT ${Main} "Installs Haxe and other core files."
  97. !insertmacro MUI_DESCRIPTION_TEXT ${Neko} "Installs Neko, which is required by various Haxe tools."
  98. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  99. ;--------------------------------
  100. ; Uninstall Sections
  101. Section "un.Haxe" UninstMain
  102. RMDir /r "$INSTDIR\haxe"
  103. ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "%HAXEPATH%"
  104. DeleteRegValue ${env_hkcu} HAXEPATH
  105. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  106. SectionEnd
  107. Section "un.Neko" UninstNeko
  108. RMDir /r "$INSTDIR\neko"
  109. ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "%NEKO_INSTPATH%"
  110. DeleteRegValue ${env_hkcu} NEKO_INSTPATH
  111. SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  112. SectionEnd
  113. ;--------------------------------
  114. ; Uninstall section strings
  115. !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
  116. !insertmacro MUI_DESCRIPTION_TEXT ${UninstMain} "Uninstalls Haxe and other core files."
  117. !insertmacro MUI_DESCRIPTION_TEXT ${UninstNeko} "Uninstalls Neko."
  118. !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
  119. ;--------------------------------