author | Dan Fuhry <dan@enanocms.org> |
Sat, 21 Aug 2010 18:20:18 -0400 | |
changeset 11 | b62383876fdb |
parent 10 | 014d58335b6d |
permissions | -rwxr-xr-x |
0 | 1 |
Page custom StackSelectCreate StackSelectLeave " - Select stack" |
2 |
||
3 |
Function StackSelectCreate |
|
4 |
; Only show this page if both WAMPStack and WAPPStack are installed. |
|
5 |
StrCmp $wampstack_installed 0 "" +3 |
|
6 |
Call StackSelectLeave |
|
7 |
Return |
|
8 |
StrCmp $wappstack_installed 0 "" +3 |
|
9 |
Call StackSelectLeave |
|
10 |
Return |
|
11 |
StrCmp $XPUI_ABORTED 1 "" +2 |
|
12 |
Abort |
|
13 |
||
14 |
!insertmacro XPUI_INSTALLOPTIONS_EXTRACT_AS "pages\StackSelect.ini" "StackSelect.ini" |
|
15 |
!insertmacro XPUI_HEADER_TEXT "Select server stack" "Choose which BitNami stack installation you want to use to run $(^Name)." |
|
16 |
!insertmacro XPUI_INSTALLOPTIONS_DISPLAY "StackSelect.ini" |
|
17 |
FunctionEnd |
|
18 |
||
19 |
Function StackSelectLeave |
|
5
85800cb04cc5
Moved around some ExperienceUI directives; fixed missing $XPUI_ABORTED check in StackSelectLeave
Dan
parents:
3
diff
changeset
|
20 |
StrCmp $XPUI_ABORTED 1 0 +2 |
85800cb04cc5
Moved around some ExperienceUI directives; fixed missing $XPUI_ABORTED check in StackSelectLeave
Dan
parents:
3
diff
changeset
|
21 |
Return |
85800cb04cc5
Moved around some ExperienceUI directives; fixed missing $XPUI_ABORTED check in StackSelectLeave
Dan
parents:
3
diff
changeset
|
22 |
|
0 | 23 |
; Here is where we make the final decision on which stack will be used. |
24 |
IfFileExists "$PLUGINSDIR\StackSelect.ini" "" OnlyOneStackInstalled |
|
25 |
||
26 |
!macro ConfigCheck |
|
27 |
IfFileExists "$stack_instdir\apps\${PRODUCT_SHORTNAME}\htdocs\config.php" 0 +3 |
|
10
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
28 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 \ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
29 |
"Setup has found that $(^Name) is already installed on this stack. If you continue and you do not want to delete your existing site, \ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
30 |
you must select $\"Upgrade or configure database manually$\" on the next page. Otherwise, the existing installation's configuration \ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
31 |
file and database will be deleted and your existing website will be replaced with a fresh one.$\n\ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
32 |
$\n\ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
33 |
If you are upgrading $(^Name), you can safely click Yes below, and select $\"Upgrade or configure database manually.$\"$\n\ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
34 |
$\n\ |
014d58335b6d
Changed behavior of the entire database selection process. A real "upgrade"/"don't touch the database" option was added, and the old options unconditionally delete the database.
Dan Fuhry <dan@enanocms.org>
parents:
5
diff
changeset
|
35 |
Do you want to continue?" IDYES +2 |
0 | 36 |
Abort |
37 |
!macroend |
|
38 |
||
39 |
; Both stacks are installed; decide based on user selection |
|
40 |
ReadINIStr $0 "$PLUGINSDIR\StackSelect.ini" "Field 1" "State" |
|
41 |
StrCmp $0 1 "" UserSelectedWAPP |
|
42 |
; User selected WAMP |
|
43 |
Call BNSetVarsForWAMP |
|
44 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
45 |
LockWindow on |
0 | 46 |
Return |
47 |
||
48 |
UserSelectedWAPP: |
|
49 |
; User selected WAPP |
|
50 |
Call BNSetVarsForWAPP |
|
51 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
52 |
LockWindow on |
0 | 53 |
Return |
54 |
||
55 |
OnlyOneStackInstalled: |
|
56 |
StrCmp $wampstack_installed 0 +3 |
|
57 |
; MySQL |
|
58 |
Call BNSetVarsForWAMP |
|
59 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
60 |
LockWindow on |
0 | 61 |
Return |
62 |
||
63 |
; PostgreSQL |
|
64 |
Call BNSetVarsForWAPP |
|
65 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
66 |
LockWindow on |
0 | 67 |
Return |
68 |
FunctionEnd |
|
69 |
||
70 |
Function BNSetVarsForWAMP |
|
71 |
StrCpy $stack_type "WAMP" |
|
72 |
StrCpy $stack_instdir "$wampstack_installed" |
|
73 |
StrCpy $db_driver "mysql" |
|
74 |
StrCpy $db_dbmsname "MySQL" |
|
75 |
StrCpy $db_rootuser "root" |
|
76 |
ReadINIStr $db_port "$stack_instdir\properties.ini" "MySQL" "mysql_port" |
|
77 |
||
78 |
StrCpy $stack_portbit "" |
|
79 |
ReadINIStr $0 "$stack_instdir\properties.ini" "Apache" "apache_server_port" |
|
80 |
StrCmp $0 "80" +2 |
|
81 |
StrCpy $stack_portbit ":$0" |
|
82 |
FunctionEnd |
|
83 |
||
84 |
Function BNSetVarsForWAPP |
|
85 |
StrCpy $stack_type "WAPP" |
|
86 |
StrCpy $stack_instdir "$wappstack_installed" |
|
87 |
StrCpy $db_driver "postgresql" |
|
88 |
StrCpy $db_dbmsname "PostgreSQL" |
|
89 |
StrCpy $db_rootuser "postgres" |
|
90 |
; NOTE: WAPPStack doesn't record the port of PostgreSQL - we have to assume the default |
|
91 |
StrCpy $db_port 5432 |
|
92 |
||
93 |
StrCpy $stack_portbit "" |
|
94 |
ReadINIStr $0 "$stack_instdir\properties.ini" "Apache" "apache_server_port" |
|
95 |
StrCmp $0 "80" +2 |
|
96 |
StrCpy $stack_portbit ":$0" |
|
97 |
FunctionEnd |