author | Dan |
Wed, 27 May 2009 01:15:21 -0400 | |
changeset 1 | ac5bcb4e5284 |
parent 0 | 67e1cc6cd929 |
child 3 | 0cce88c7cf7c |
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" |
|
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 |
|
1
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
215 |
; 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
|
216 |
StrCmp $stack_type "WAPP" 0 +2 |
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
217 |
Return |
ac5bcb4e5284
PostgreSQL: skip applications.html stage (not supported in upstream wappstack)
Dan
parents:
0
diff
changeset
|
218 |
|
0 | 219 |
Call enano_add_to_applist |
220 |
SectionEnd |
|
221 |
||
222 |
Section -AdditionalIcons |
|
223 |
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" |
|
224 |
CreateDirectory "$SMPROGRAMS\Enano CMS" |
|
225 |
CreateShortCut "$SMPROGRAMS\Enano CMS\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" |
|
226 |
CreateShortCut "$SMPROGRAMS\Enano CMS\Uninstall.lnk" "$INSTDIR\apps\${PRODUCT_SHORTNAME}\uninst.exe" |
|
227 |
SectionEnd |
|
228 |
||
229 |
Section -Post |
|
230 |
WriteUninstaller "$INSTDIR\uninst.exe" |
|
231 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" |
|
232 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" |
|
233 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" |
|
234 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" |
|
235 |
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" |
|
236 |
SectionEnd |
|
237 |
||
238 |
; Section descriptions |
|
239 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
|
240 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Core components of Enano CMS, necessary to run Enano" |
|
241 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Adds support for Yubikey authentication" |
|
242 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "An AJAX chatbox sidebar gadget for Enano" |
|
243 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Provides a sidebar block that alerts you about unapproved comments, inactive users, and pages with requested deletion." |
|
244 |
!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." |
|
245 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC08} "Provides a portal with news and static content combined onto one page." |
|
246 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC11} "Parser extension that adds syntax highlighting support using the GeSHi highlighting engine." |
|
247 |
!insertmacro MUI_DESCRIPTION_TEXT ${SEC12} "Adds several parser extensions that provide MediaWiki-like behavior, including references (footnotes) and Table of Contents support." |
|
248 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecGMP} "Enables PHP's GMP extension, which speeds up cryptographic operations." |
|
249 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
|
250 |
||
251 |
||
252 |
Function un.onUninstSuccess |
|
253 |
HideWindow |
|
254 |
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." |
|
255 |
FunctionEnd |
|
256 |
||
257 |
Function un.onInit |
|
258 |
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 |
|
259 |
Abort |
|
260 |
FunctionEnd |
|
261 |
||
262 |
Section Uninstall |
|
263 |
Delete "$INSTDIR\apps\${PRODUCT_SHORTNAME}\${PRODUCT_NAME}.url" |
|
264 |
||
265 |
!insertmacro Core_Uninstall |
|
266 |
||
267 |
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" |
|
268 |
SetAutoClose true |
|
269 |
SectionEnd |
|
270 |
||
271 |
; Version Information |
|
272 |
||
273 |
VIProductVersion "1.1.6.0" |
|
274 |
VIAddVersionKey /LANG=1033 "ProductName" "Enano CMS" |
|
275 |
VIAddVersionKey /LANG=1033 "Setup Information" "Enano CMS installer module for Windows Apache stacks" |
|
276 |
VIAddVersionKey /LANG=1033 "Comments" "This installer contains a beta build of Enano CMS, use with caution!" |
|
277 |
VIAddVersionKey /LANG=1033 "Publisher Name" "Neal Gompa (King InuYasha), Enano CMS Project" |
|
278 |
VIAddVersionKey /LANG=1033 "LegalCopyright" "©2009 Enano CMS Project" |
|
279 |
VIAddVersionKey /LANG=1033 "FileDescription" "Enano - The CMS that focuses on what matters most: content." |
|
280 |
VIAddVersionKey /LANG=1033 "FileVersion" "${PRODUCT_VERSION}" |