enano-bundle.nsi
changeset 0 67e1cc6cd929
child 1 ac5bcb4e5284
equal deleted inserted replaced
-1:000000000000 0:67e1cc6cd929
       
     1 ; Script generated by the HM NIS Edit Script Wizard.
       
     2 
       
     3 ; HM NIS Edit Wizard helper defines
       
     4 !define PRODUCT_NAME "Enano CMS"
       
     5 !define PRODUCT_VERSION "1.1.6"
       
     6 !define PRODUCT_PUBLISHER "Enano CMS Project"
       
     7 !define PRODUCT_WEB_SITE "http://enanocms.org"
       
     8 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
       
     9 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
       
    10 !define PRODUCT_SHORTNAME "enanocms"
       
    11 
       
    12 !ifndef ENANO_ROOT
       
    13 !define ENANO_ROOT "Q:\enano-1.1\repo"
       
    14 !endif
       
    15 
       
    16 SetCompressor /FINAL /SOLID lzma
       
    17 CRCCheck force
       
    18 
       
    19 Var wampstack_installed
       
    20 Var wappstack_installed
       
    21 Var stack_type
       
    22 Var stack_instdir
       
    23 Var stack_portbit
       
    24 Var db_dbmsname
       
    25 Var db_rootuser
       
    26 Var db_rootpass
       
    27 Var db_needroot
       
    28 Var db_driver
       
    29 Var db_port
       
    30 Var db_user
       
    31 Var db_password
       
    32 Var db_name
       
    33 Var enano_user
       
    34 Var enano_password
       
    35 Var admin_email
       
    36 Var site_name
       
    37 Var site_desc
       
    38 Var site_copyright
       
    39 Var url_scheme
       
    40 Var start_with
       
    41 
       
    42 !include "inst-resources\bitnamiutils.nsh"
       
    43 !include "inst-resources\dbal.nsh"
       
    44 !include "inst-resources\mysql.nsh"
       
    45 !include "inst-resources\postgresql.nsh"
       
    46 !include "inst-resources\str_replace.nsh"
       
    47 !include "inst-resources\kickstart.nsh"
       
    48 !include "inst-resources\apacheconfig.nsh"
       
    49 !include "inst-resources\applist.nsh"
       
    50 
       
    51 Function .onInit
       
    52   Call BNSetWAMPInstalledFlag
       
    53   Call BNSetWAPPInstalledFlag
       
    54   
       
    55   ; If neither WAMP nor WAPP is installed, die
       
    56   StrCmp $wampstack_installed 0 "" FoundStack
       
    57   StrCmp $wampstack_installed 0 "" FoundStack
       
    58 
       
    59     MessageBox MB_OK|MB_ICONEXCLAMATION "Setup could not find any BitNami stacks on your server.$\r$\n\
       
    60                                          $\r$\n\
       
    61                                          Please install a BitNami stack and re-run setup. You can download a BitNami stack for free from http://www.bitnami.org."
       
    62     Abort
       
    63 
       
    64   FoundStack:
       
    65 FunctionEnd
       
    66 
       
    67 ; ExperienceUI GUI parameters
       
    68 !define XPUI_BGIMAGE
       
    69 !define XPUI_BGIMAGE_BMP "gfx\enano-bg.bmp"
       
    70 !define XPUI_TEXT_COLOR "F2F2F2"
       
    71 !define XPUI_TEXT_BGCOLOR "202020" ; irrelevant but still
       
    72 !define XPUI_TEXT_LIGHTCOLOR "B4C3EA"
       
    73 !define XPUI_ABORTWARNING
       
    74 !define XPUI_BRANDINGTEXT "NSIS Installer ${NSIS_VERSION}"
       
    75 !define XPUI_BRANDINGTEXT_COLOR_FG "b6d9ff"
       
    76 !define XPUI_BRANDINGTEXT_COLOR_BG "4c5b6b"
       
    77 !define XPUI_FASTERSKINNING
       
    78 
       
    79 ; MUI 1.67 compatible / XPUI 1.11 (2.0pre) compatible ------
       
    80 !ifndef XPUI_SYSDIR
       
    81   !define XPUI_SYSDIR "C:\ExperienceUI\Contrib\ExperienceUI"
       
    82 !endif
       
    83 !include "${XPUI_SYSDIR}\..\..\Include\XPUI.nsh"
       
    84 
       
    85 ; MUI Settings
       
    86 !define MUI_ABORTWARNING
       
    87 !define MUI_ICON "inst-resources\generic-install.ico"
       
    88 !define MUI_UNICON "inst-resources\generic-uninstall.ico"
       
    89 !include "WinMessages.nsh"
       
    90 
       
    91 ; Welcome page
       
    92 !insertmacro XPUI_PAGE_WELCOME2
       
    93 ; License page
       
    94 !insertmacro MUI_PAGE_LICENSE "licenses\GPL.txt"
       
    95 ; Stack selection - automatic unless both stacks are installed
       
    96 !include "pages\StackSelect.nsi"
       
    97 ; Database credentials entry
       
    98 !include "pages\DatabaseConfig.nsi"
       
    99 ; Site config page
       
   100 !include "pages\SiteConfig.nsi"
       
   101 ; User credentials page
       
   102 !include "pages\Login.nsi"
       
   103 ; Components page
       
   104 !insertmacro MUI_PAGE_COMPONENTS
       
   105 ; Instfiles page
       
   106 !insertmacro MUI_PAGE_INSTFILES
       
   107 ; Finish page
       
   108 !define XPUI_FINISHPAGE_RUN
       
   109 !define XPUI_FINISHPAGE_CHECKBOX_RUN "Go to my new $(^Name) website now"
       
   110 !define XPUI_FINISHPAGE_RUN_FUNCTION OpenBitnamiWebsite
       
   111 Function OpenBitnamiWebsite
       
   112   ExecShell open "http://localhost$stack_portbit/${PRODUCT_SHORTNAME}/"
       
   113 FunctionEnd
       
   114 !insertmacro MUI_PAGE_FINISH
       
   115 
       
   116 !insertmacro XPUI_PAGE_ABORT
       
   117 
       
   118 ; Uninstaller pages
       
   119 !insertmacro MUI_UNPAGE_INSTFILES
       
   120 
       
   121 ; Language files
       
   122 !insertmacro MUI_LANGUAGE "English"
       
   123 
       
   124 ; Reserve files
       
   125 !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
       
   126 
       
   127 ; MUI end ------
       
   128 
       
   129 ; File lists
       
   130 !include "inst-resources\core-files.nsh"
       
   131 ; End file lists
       
   132 
       
   133 Name "${PRODUCT_NAME}"
       
   134 Caption "${PRODUCT_NAME} ${PRODUCT_VERSION} Bitnami installer"
       
   135 OutFile "enano-1.1.6-bitnami-setup.exe"
       
   136 InstallDir "$PROGRAMFILES\Enano CMS"
       
   137 ShowInstDetails show
       
   138 ShowUnInstDetails show
       
   139 
       
   140 Section "-pre"
       
   141   StrCpy $INSTDIR "$stack_instdir"
       
   142   IfFileExists "$INSTDIR\apps\${PRODUCT_SHORTNAME}\htdocs\config.php" 0 +2
       
   143     Delete "$INSTDIR\apps\${PRODUCT_SHORTNAME}\htdocs\config.php"
       
   144 SectionEnd
       
   145 
       
   146 Section "-DatabaseSetup"
       
   147   StrCmp $db_needroot 1 +2
       
   148     Return
       
   149     
       
   150   ; Create database
       
   151   ${db_create} $R0 "$db_rootuser" "$db_rootpass" "$db_name" "$db_user" "$db_password"
       
   152   IntCmp $R0 0 DatabaseCreateSuccess
       
   153     !insertmacro XPUI_HEADER_TEXT "Installation failed" "Could not create the database."
       
   154     DetailPrint "Database creation failed."
       
   155     MessageBox MB_OK|MB_ICONEXCLAMATION "Setup failed to create the database for $(^Name).$\r$\n\
       
   156                                          $\r$\n\
       
   157                                          It's possible that your authentication details were rejected or that there \
       
   158                                          is a bug in the installer. Try removing any special characters (especially \
       
   159                                          quote symbols and backslashes) from your password. Make sure to use only \
       
   160                                          letters, numbers, and underscores in the database name and username."
       
   161     Abort
       
   162   DatabaseCreateSuccess:
       
   163 SectionEnd
       
   164 
       
   165 Section "Enano Core" SEC01
       
   166   SectionIn RO
       
   167   !insertmacro Core_Install
       
   168 SectionEnd
       
   169 
       
   170 Section "Enable GMP in PHP" SecGMP
       
   171   ClearErrors
       
   172   WriteINIStr "$stack_instdir\php\php.ini" "GMP" "extension" "php_gmp.dll"
       
   173   IfErrors 0 +2
       
   174     MessageBox MB_OK|MB_ICONEXCLAMATION "GMP was not automatically enabled in PHP. Logins will be several seconds slower."
       
   175 SectionEnd
       
   176 
       
   177 Section "YubiKey auth plugin" SEC02
       
   178 SectionEnd
       
   179 
       
   180 Section "AjIM2" SEC03
       
   181 SectionEnd
       
   182 
       
   183 Section "Admin Alerts" SEC04
       
   184 SectionEnd
       
   185 
       
   186 Section "RSS Feeds" SEC06
       
   187 SectionEnd
       
   188 
       
   189 Section "News Portal" SEC08
       
   190 SectionEnd
       
   191 
       
   192 Section "Code syntax highlighting" SEC11
       
   193 SectionEnd
       
   194 
       
   195 Section "Wiki functionality extensions" SEC12
       
   196 SectionEnd
       
   197 
       
   198 Section -ConfigureApache
       
   199   DetailPrint "Configuring Apache web server"
       
   200   Call write_apache_config
       
   201   DetailPrint "Restarting Apache"
       
   202   nsExec::Exec '"$SYSDIR\net.exe" stop "$stack_typestackApache"'
       
   203   nsExec::Exec '"$SYSDIR\net.exe" start "$stack_typestackApache"'
       
   204 SectionEnd
       
   205 
       
   206 Section -WriteKickStart
       
   207   Call enano_write_kickstart_script
       
   208 SectionEnd
       
   209 
       
   210 Section -DoEnanoDBSetup
       
   211   Call enano_run_kickstart_script
       
   212 SectionEnd
       
   213 
       
   214 Section -InsertApplistEntry
       
   215   Call enano_add_to_applist
       
   216 SectionEnd
       
   217 
       
   218 Section -AdditionalIcons
       
   219   WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
       
   220   CreateDirectory "$SMPROGRAMS\Enano CMS"
       
   221   CreateShortCut "$SMPROGRAMS\Enano CMS\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
       
   222   CreateShortCut "$SMPROGRAMS\Enano CMS\Uninstall.lnk" "$INSTDIR\apps\${PRODUCT_SHORTNAME}\uninst.exe"
       
   223 SectionEnd
       
   224 
       
   225 Section -Post
       
   226   WriteUninstaller "$INSTDIR\uninst.exe"
       
   227   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
       
   228   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
       
   229   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
       
   230   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
       
   231   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
       
   232 SectionEnd
       
   233 
       
   234 ; Section descriptions
       
   235 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
       
   236   !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Core components of Enano CMS, necessary to run Enano"
       
   237   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Adds support for Yubikey authentication"
       
   238   !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "An AJAX chatbox sidebar gadget for Enano"
       
   239   !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Provides a sidebar block that alerts you about unapproved comments, inactive users, and pages with requested deletion."
       
   240   !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "Provides the ability to generate RSS feeds based on the latest page edits and comments. It also has a plugin API so plugins can add their own feeds."
       
   241   !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} "Provides a portal with news and static content combined onto one page."
       
   242   !insertmacro MUI_DESCRIPTION_TEXT ${SEC11} "Parser extension that adds syntax highlighting support using the GeSHi highlighting engine."
       
   243   !insertmacro MUI_DESCRIPTION_TEXT ${SEC12} "Adds several parser extensions that provide MediaWiki-like behavior, including references (footnotes) and Table of Contents support."
       
   244   !insertmacro MUI_DESCRIPTION_TEXT ${SecGMP} "Enables PHP's GMP extension, which speeds up cryptographic operations."
       
   245 !insertmacro MUI_FUNCTION_DESCRIPTION_END
       
   246 
       
   247 
       
   248 Function un.onUninstSuccess
       
   249   HideWindow
       
   250   MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
       
   251 FunctionEnd
       
   252 
       
   253 Function un.onInit
       
   254   MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
       
   255   Abort
       
   256 FunctionEnd
       
   257 
       
   258 Section Uninstall
       
   259   Delete "$INSTDIR\apps\${PRODUCT_SHORTNAME}\${PRODUCT_NAME}.url"
       
   260 
       
   261   !insertmacro Core_Uninstall
       
   262 
       
   263   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
       
   264   SetAutoClose true
       
   265 SectionEnd
       
   266 
       
   267 ; Version Information
       
   268 
       
   269 VIProductVersion "1.1.6.0"
       
   270 VIAddVersionKey /LANG=1033 "ProductName" "Enano CMS"
       
   271 VIAddVersionKey /LANG=1033 "Setup Information" "Enano CMS installer module for Windows Apache stacks"
       
   272 VIAddVersionKey /LANG=1033 "Comments" "This installer contains a beta build of Enano CMS, use with caution!"
       
   273 VIAddVersionKey /LANG=1033 "Publisher Name" "Neal Gompa (King InuYasha), Enano CMS Project"
       
   274 VIAddVersionKey /LANG=1033 "LegalCopyright" "©2009 Enano CMS Project"
       
   275 VIAddVersionKey /LANG=1033 "FileDescription" "Enano - The CMS that focuses on what matters most: content."
       
   276 VIAddVersionKey /LANG=1033 "FileVersion" "${PRODUCT_VERSION}"