author | Dan |
Sat, 11 Jul 2009 10:08:22 -0400 | |
changeset 4 | ea7b100e5de6 |
parent 3 | 0cce88c7cf7c |
child 5 | 85800cb04cc5 |
permissions | -rw-r--r-- |
0 | 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" |
|
3 | 11 |
; !define UNINSTALL_DEBUG |
0 | 12 |
|
13 |
!ifndef ENANO_ROOT |
|
14 |
!define ENANO_ROOT "Q:\enano-1.1\repo" |
|
15 |
!endif |
|
16 |
||
17 |
SetCompressor /FINAL /SOLID lzma |
|
18 |
CRCCheck force |
|
19 |
||
20 |
Var wampstack_installed |
|
21 |
Var wappstack_installed |
|
22 |
Var stack_type |
|
23 |
Var stack_instdir |
|
24 |
Var stack_portbit |
|
25 |
Var db_dbmsname |
|
26 |
Var db_rootuser |
|
27 |
Var db_rootpass |
|
28 |
Var db_needroot |
|
29 |
Var db_driver |
|
30 |
Var db_port |
|
31 |
Var db_user |
|
32 |
Var db_password |
|
33 |
Var db_name |
|
34 |
Var enano_user |
|
35 |
Var enano_password |
|
36 |
Var admin_email |
|
37 |
Var site_name |
|
38 |
Var site_desc |
|
39 |
Var site_copyright |
|
40 |
Var url_scheme |
|
41 |
Var start_with |
|
3 | 42 |
Var skip_install |
0 | 43 |
|
44 |
!include "inst-resources\bitnamiutils.nsh" |
|
45 |
!include "inst-resources\dbal.nsh" |
|
46 |
!include "inst-resources\mysql.nsh" |
|
47 |
!include "inst-resources\postgresql.nsh" |
|
48 |
!include "inst-resources\str_replace.nsh" |
|
49 |
!include "inst-resources\kickstart.nsh" |
|
50 |
!include "inst-resources\apacheconfig.nsh" |
|
51 |
!include "inst-resources\applist.nsh" |
|
52 |
||
53 |
Function .onInit |
|
3 | 54 |
!ifdef UNINSTALL_DEBUG |
55 |
WriteUninstaller "$EXEDIR\uninstall.exe" |
|
56 |
MessageBox MB_OKCANCEL "Uninstaller written. OK to run installer, Cancel to quit" IDOK +2 |
|
57 |
Abort |
|
58 |
!endif |
|
0 | 59 |
Call BNSetWAMPInstalledFlag |
60 |
Call BNSetWAPPInstalledFlag |
|
61 |
||
62 |
; If neither WAMP nor WAPP is installed, die |
|
63 |
StrCmp $wampstack_installed 0 "" FoundStack |
|
64 |
StrCmp $wampstack_installed 0 "" FoundStack |
|
65 |
||
66 |
MessageBox MB_OK|MB_ICONEXCLAMATION "Setup could not find any BitNami stacks on your server.$\r$\n\ |
|
67 |
$\r$\n\ |
|
68 |
Please install a BitNami stack and re-run setup. You can download a BitNami stack for free from http://www.bitnami.org." |
|
69 |
Abort |
|
70 |
||
71 |
FoundStack: |
|
72 |
FunctionEnd |
|
73 |
||
74 |
; ExperienceUI GUI parameters |
|
75 |
!define XPUI_BGIMAGE |
|
76 |
!define XPUI_BGIMAGE_BMP "gfx\enano-bg.bmp" |
|
77 |
!define XPUI_TEXT_COLOR "F2F2F2" |
|
78 |
!define XPUI_TEXT_BGCOLOR "202020" ; irrelevant but still |
|
79 |
!define XPUI_TEXT_LIGHTCOLOR "B4C3EA" |
|
80 |
!define XPUI_ABORTWARNING |
|
81 |
!define XPUI_BRANDINGTEXT "NSIS Installer ${NSIS_VERSION}" |
|
82 |
!define XPUI_BRANDINGTEXT_COLOR_FG "b6d9ff" |
|
83 |
!define XPUI_BRANDINGTEXT_COLOR_BG "4c5b6b" |
|
84 |
!define XPUI_FASTERSKINNING |
|
3 | 85 |
!define XPUI_UNINSTALLER |
0 | 86 |
|
87 |
; MUI 1.67 compatible / XPUI 1.11 (2.0pre) compatible ------ |
|
88 |
!ifndef XPUI_SYSDIR |
|
89 |
!define XPUI_SYSDIR "C:\ExperienceUI\Contrib\ExperienceUI" |
|
90 |
!endif |
|
91 |
!include "${XPUI_SYSDIR}\..\..\Include\XPUI.nsh" |
|
92 |
||
93 |
; MUI Settings |
|
94 |
!define MUI_ABORTWARNING |
|
95 |
!define MUI_ICON "inst-resources\generic-install.ico" |
|
96 |
!define MUI_UNICON "inst-resources\generic-uninstall.ico" |
|
97 |
!include "WinMessages.nsh" |
|
98 |
||
3 | 99 |
; |
100 |
; INSTALL PAGES |
|
101 |
; |
|
102 |
||
0 | 103 |
; Welcome page |
104 |
!insertmacro XPUI_PAGE_WELCOME2 |
|
105 |
; License page |
|
3 | 106 |
!insertmacro XPUI_PAGE_LICENSE "licenses\GPL.txt" |
0 | 107 |
; Stack selection - automatic unless both stacks are installed |
108 |
!include "pages\StackSelect.nsi" |
|
109 |
; Database credentials entry |
|
110 |
!include "pages\DatabaseConfig.nsi" |
|
111 |
; Site config page |
|
112 |
!include "pages\SiteConfig.nsi" |
|
113 |
; User credentials page |
|
114 |
!include "pages\Login.nsi" |
|
115 |
; Components page |
|
3 | 116 |
!insertmacro XPUI_PAGE_COMPONENTS |
0 | 117 |
; Instfiles page |
3 | 118 |
!insertmacro XPUI_PAGE_INSTFILES |
0 | 119 |
; Finish page |
120 |
!define XPUI_FINISHPAGE_RUN |
|
121 |
!define XPUI_FINISHPAGE_CHECKBOX_RUN "Go to my new $(^Name) website now" |
|
122 |
!define XPUI_FINISHPAGE_RUN_FUNCTION OpenBitnamiWebsite |
|
123 |
Function OpenBitnamiWebsite |
|
124 |
ExecShell open "http://localhost$stack_portbit/${PRODUCT_SHORTNAME}/" |
|
125 |
FunctionEnd |
|
126 |
!insertmacro MUI_PAGE_FINISH |
|
127 |
||
128 |
!insertmacro XPUI_PAGE_ABORT |
|
129 |
||
3 | 130 |
; |
131 |
; UNINSTALL PAGES |
|
132 |
; |
|
133 |
||
134 |
!insertmacro XPUI_PAGEMODE_UNINST |
|
135 |
!insertmacro XPUI_PAGE_WELCOME2 |
|
136 |
!insertmacro XPUI_PAGE_INSTFILES |
|
137 |
!insertmacro XPUI_PAGE_FINISH |
|
0 | 138 |
|
139 |
; Language files |
|
140 |
!insertmacro MUI_LANGUAGE "English" |
|
141 |
||
142 |
; Reserve files |
|
143 |
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS |
|
144 |
||
145 |
; MUI end ------ |
|
146 |
||
147 |
; File lists |
|
148 |
!include "inst-resources\core-files.nsh" |
|
149 |
; End file lists |
|
150 |
||
151 |
Name "${PRODUCT_NAME}" |
|
152 |
Caption "${PRODUCT_NAME} ${PRODUCT_VERSION} Bitnami installer" |
|
153 |
OutFile "enano-1.1.6-bitnami-setup.exe" |
|
154 |
InstallDir "$PROGRAMFILES\Enano CMS" |
|
155 |
ShowInstDetails show |
|
156 |
ShowUnInstDetails show |
|
157 |
||
158 |
Section "-pre" |
|
159 |
StrCpy $INSTDIR "$stack_instdir" |
|
3 | 160 |
StrCpy $skip_install 0 |
161 |
||
162 |
StrCmp $db_needroot 0 0 SkipManualCheck |
|
163 |
; If we were given our own DB credentials and there's already a config, the installation needs to be skipped |
|
164 |
IfFileExists "$INSTDIR\apps\${PRODUCT_SHORTNAME}\htdocs\config.php" 0 SkipManualCheck |
|
165 |
StrCpy $skip_install 1 |
|
166 |
Return |
|
167 |
||
168 |
SkipManualCheck: |
|
169 |
||
0 | 170 |
IfFileExists "$INSTDIR\apps\${PRODUCT_SHORTNAME}\htdocs\config.php" 0 +2 |
171 |
Delete "$INSTDIR\apps\${PRODUCT_SHORTNAME}\htdocs\config.php" |
|
172 |
SectionEnd |
|
173 |
||
174 |
Section "-DatabaseSetup" |
|
175 |
StrCmp $db_needroot 1 +2 |
|
176 |
Return |
|
177 |
||
178 |
; Create database |
|
179 |
${db_create} $R0 "$db_rootuser" "$db_rootpass" "$db_name" "$db_user" "$db_password" |
|
180 |
IntCmp $R0 0 DatabaseCreateSuccess |
|
181 |
!insertmacro XPUI_HEADER_TEXT "Installation failed" "Could not create the database." |
|
182 |
DetailPrint "Database creation failed." |
|
183 |
MessageBox MB_OK|MB_ICONEXCLAMATION "Setup failed to create the database for $(^Name).$\r$\n\ |
|
184 |
$\r$\n\ |
|
185 |
It's possible that your authentication details were rejected or that there \ |
|
186 |
is a bug in the installer. Try removing any special characters (especially \ |
|
187 |
quote symbols and backslashes) from your password. Make sure to use only \ |
|
188 |
letters, numbers, and underscores in the database name and username." |
|
189 |
Abort |
|
190 |
DatabaseCreateSuccess: |
|
191 |
SectionEnd |
|
192 |
||
193 |
Section "Enano Core" SEC01 |
|
194 |
SectionIn RO |
|
3 | 195 |
WriteUninstaller "$INSTDIR\apps\${PRODUCT_SHORTNAME}\uninstall.exe" |
0 | 196 |
!insertmacro Core_Install |
197 |
SectionEnd |
|
198 |
||
199 |
Section "Enable GMP in PHP" SecGMP |
|
200 |
ClearErrors |
|
3 | 201 |
IfFileExists "$stack_instdir\php\ext\php_gmp.dll" +3 |
202 |
||
203 |
; No GMP |
|
204 |
MessageBox MB_OK|MB_ICONEXCLAMATION "The stack you selected does not contain the GMP extension, so it cannot be enabled. Logins will be several seconds slower. Please consider upgrading your stack." |
|
205 |
Return |
|
206 |
||
0 | 207 |
WriteINIStr "$stack_instdir\php\php.ini" "GMP" "extension" "php_gmp.dll" |
208 |
IfErrors 0 +2 |
|
209 |
MessageBox MB_OK|MB_ICONEXCLAMATION "GMP was not automatically enabled in PHP. Logins will be several seconds slower." |
|
210 |
SectionEnd |
|
211 |
||
212 |
Section "YubiKey auth plugin" SEC02 |
|
213 |
SectionEnd |
|
214 |
||
215 |
Section "AjIM2" SEC03 |
|
216 |
SectionEnd |
|
217 |
||
218 |
Section "Admin Alerts" SEC04 |
|
219 |
SectionEnd |
|
220 |
||
221 |
Section "RSS Feeds" SEC06 |
|
222 |
SectionEnd |
|
223 |
||
224 |
Section "News Portal" SEC08 |
|
225 |
SectionEnd |
|
226 |
||
227 |
Section "Code syntax highlighting" SEC11 |
|
228 |
SectionEnd |
|
229 |
||
230 |
Section "Wiki functionality extensions" SEC12 |
|
231 |
SectionEnd |
|
232 |
||
233 |
Section -ConfigureApache |
|
234 |
DetailPrint "Configuring Apache web server" |
|
235 |
Call write_apache_config |
|
236 |
DetailPrint "Restarting Apache" |
|
237 |
nsExec::Exec '"$SYSDIR\net.exe" stop "$stack_typestackApache"' |
|
238 |
nsExec::Exec '"$SYSDIR\net.exe" start "$stack_typestackApache"' |
|
3 | 239 |
StrCmp $skip_install 1 0 +2 |
240 |
Return |
|
241 |
||
0 | 242 |
Call enano_write_kickstart_script |
243 |
Call enano_run_kickstart_script |
|
3 | 244 |
|
245 |
SetOutPath "$INSTDIR\apps\${PRODUCT_SHORTNAME}\scripts" |
|
246 |
File "inst-resources\selfdestruct.php" |
|
0 | 247 |
SectionEnd |
248 |
||
249 |
Section -InsertApplistEntry |
|
1
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
250 |
; Skip if this is WAPPStack, it doesn't have an applications.html. (!) |
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
251 |
StrCmp $stack_type "WAPP" 0 +2 |
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
252 |
Return |
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
253 |
|
0 | 254 |
Call enano_add_to_applist |
255 |
SectionEnd |
|
256 |
||
257 |
Section -AdditionalIcons |
|
258 |
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" |
|
259 |
CreateDirectory "$SMPROGRAMS\Enano CMS" |
|
260 |
CreateShortCut "$SMPROGRAMS\Enano CMS\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" |
|
3 | 261 |
CreateShortCut "$SMPROGRAMS\Enano CMS\Uninstall.lnk" "$INSTDIR\apps\${PRODUCT_SHORTNAME}\uninstall.exe" |
0 | 262 |
SectionEnd |
263 |
||
264 |
Section -Post |
|
265 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" |
|
3 | 266 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\apps\${PRODUCT_SHORTNAME}\uninstall.exe" |
0 | 267 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" |
268 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" |
|
269 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" |
|
270 |
SectionEnd |
|
271 |
||
272 |
; Section descriptions |
|
273 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
|
274 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Core components of Enano CMS, necessary to run Enano" |
|
275 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Adds support for Yubikey authentication" |
|
276 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "An AJAX chatbox sidebar gadget for Enano" |
|
277 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Provides a sidebar block that alerts you about unapproved comments, inactive users, and pages with requested deletion." |
|
278 |
!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." |
|
279 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC08} "Provides a portal with news and static content combined onto one page." |
|
280 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC11} "Parser extension that adds syntax highlighting support using the GeSHi highlighting engine." |
|
281 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC12} "Adds several parser extensions that provide MediaWiki-like behavior, including references (footnotes) and Table of Contents support." |
|
282 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecGMP} "Enables PHP's GMP extension, which speeds up cryptographic operations." |
|
283 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
|
284 |
||
285 |
||
286 |
Function un.onInit |
|
3 | 287 |
|
288 |
StrCpy $stack_instdir "$INSTDIR\..\.." |
|
289 |
; this is probably a bad way to determine the stack type |
|
290 |
ClearErrors |
|
291 |
StrCpy $stack_type "wamp" |
|
292 |
ReadINIStr $0 "$stack_instdir\properties.ini" "MySQL" "mysql_port" |
|
293 |
IfErrors 0 +2 |
|
294 |
StrCpy $stack_type "wapp" |
|
295 |
||
0 | 296 |
FunctionEnd |
297 |
||
298 |
Section Uninstall |
|
3 | 299 |
|
300 |
; Confirm uninstall |
|
301 |
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you really sure you want to uninstall ${PRODUCT_NAME}?$\r$\n\ |
|
302 |
$\r$\n\ |
|
303 |
Removing ${PRODUCT_NAME} will delete everything that it installed, including your database. If you do not want to \ |
|
304 |
lose data, cancel this uninstaller and back up your database before uninstalling.$\r$\n\ |
|
305 |
$\r$\n\ |
|
306 |
The ${PRODUCT_NAME} uninstaller also deletes any uploaded files, plugins and themes that you may have installed." IDYES +2 |
|
307 |
Abort |
|
308 |
||
0 | 309 |
Delete "$INSTDIR\apps\${PRODUCT_SHORTNAME}\${PRODUCT_NAME}.url" |
310 |
||
3 | 311 |
; Remove from Apache config |
312 |
DetailPrint "Removing ${PRODUCT_NAME} from Apache configuration" |
|
313 |
Call un.disable_in_apache_config |
|
314 |
||
315 |
; Remove from applications.html |
|
316 |
; SON OF A BITCH. BitNami, please, PLEASE make applications.html a PHP script that includes all files in a directory. |
|
317 |
DetailPrint "Removing ${PRODUCT_NAME} from applications.html" |
|
318 |
Call un.disable_in_applications_html |
|
319 |
||
320 |
; Restart Apache |
|
321 |
DetailPrint "Restarting Apache" |
|
322 |
nsExec::Exec '"$SYSDIR\net.exe" stop "$stack_typestackApache"' |
|
323 |
nsExec::Exec '"$SYSDIR\net.exe" start "$stack_typestackApache"' |
|
324 |
||
325 |
DetailPrint "Uninstalling database" |
|
326 |
nsExec::ExecToLog '"$stack_instdir\php\php.exe" "$INSTDIR\scripts\selfdestruct.php"' |
|
327 |
||
328 |
DetailPrint "Deleting files..." |
|
329 |
SetDetailsPrint listonly |
|
0 | 330 |
!insertmacro Core_Uninstall |
3 | 331 |
SetDetailsPrint both |
0 | 332 |
|
333 |
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" |
|
334 |
SetAutoClose true |
|
335 |
SectionEnd |
|
336 |
||
337 |
; Version Information |
|
338 |
||
339 |
VIProductVersion "1.1.6.0" |
|
340 |
VIAddVersionKey /LANG=1033 "ProductName" "Enano CMS" |
|
341 |
VIAddVersionKey /LANG=1033 "Setup Information" "Enano CMS installer module for Windows Apache stacks" |
|
342 |
VIAddVersionKey /LANG=1033 "Comments" "This installer contains a beta build of Enano CMS, use with caution!" |
|
343 |
VIAddVersionKey /LANG=1033 "Publisher Name" "Neal Gompa (King InuYasha), Enano CMS Project" |
|
344 |
VIAddVersionKey /LANG=1033 "LegalCopyright" "©2009 Enano CMS Project" |
|
345 |
VIAddVersionKey /LANG=1033 "FileDescription" "Enano - The CMS that focuses on what matters most: content." |
|
346 |
VIAddVersionKey /LANG=1033 "FileVersion" "${PRODUCT_VERSION}" |