author | Dan |
Sat, 11 Jul 2009 10:07:32 -0400 | |
changeset 3 | 0cce88c7cf7c |
parent 2 | 0c0d5dadfca3 |
child 5 | 85800cb04cc5 |
permissions | -rw-r--r-- |
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 |
|
20 |
; Here is where we make the final decision on which stack will be used. |
|
21 |
IfFileExists "$PLUGINSDIR\StackSelect.ini" "" OnlyOneStackInstalled |
|
22 |
||
23 |
!macro ConfigCheck |
|
24 |
IfFileExists "$stack_instdir\apps\${PRODUCT_SHORTNAME}\htdocs\config.php" 0 +3 |
|
3 | 25 |
MessageBox MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2 "Setup has found that $(^Name) is already installed on this stack. If you continue and you do not want to delete your existing site, you must provide the database information of the current installation on the next page. Otherwise, the existing installation's configuration file will be deleted and your existing website will be replaced with a fresh one.$\n$\nIf you are upgrading $(^Name), you can safely click Yes below, and enter the database information found in $stack_instdir\apps\${PRODUCT_SHORTNAME}\config.php on the next page.$\n$\nDo you want to continue?" IDYES +2 |
0 | 26 |
Abort |
27 |
!macroend |
|
28 |
||
29 |
; Both stacks are installed; decide based on user selection |
|
30 |
ReadINIStr $0 "$PLUGINSDIR\StackSelect.ini" "Field 1" "State" |
|
31 |
StrCmp $0 1 "" UserSelectedWAPP |
|
32 |
; User selected WAMP |
|
33 |
Call BNSetVarsForWAMP |
|
34 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
35 |
LockWindow on |
0 | 36 |
Return |
37 |
||
38 |
UserSelectedWAPP: |
|
39 |
; User selected WAPP |
|
40 |
Call BNSetVarsForWAPP |
|
41 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
42 |
LockWindow on |
0 | 43 |
Return |
44 |
||
45 |
OnlyOneStackInstalled: |
|
46 |
StrCmp $wampstack_installed 0 +3 |
|
47 |
; MySQL |
|
48 |
Call BNSetVarsForWAMP |
|
49 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
50 |
LockWindow on |
0 | 51 |
Return |
52 |
||
53 |
; PostgreSQL |
|
54 |
Call BNSetVarsForWAPP |
|
55 |
!insertmacro ConfigCheck |
|
2
0c0d5dadfca3
Added LockWindow calls to all custom page exit paths to smooth transitions
Dan
parents:
0
diff
changeset
|
56 |
LockWindow on |
0 | 57 |
Return |
58 |
FunctionEnd |
|
59 |
||
60 |
Function BNSetVarsForWAMP |
|
61 |
StrCpy $stack_type "WAMP" |
|
62 |
StrCpy $stack_instdir "$wampstack_installed" |
|
63 |
StrCpy $db_driver "mysql" |
|
64 |
StrCpy $db_dbmsname "MySQL" |
|
65 |
StrCpy $db_rootuser "root" |
|
66 |
ReadINIStr $db_port "$stack_instdir\properties.ini" "MySQL" "mysql_port" |
|
67 |
||
68 |
StrCpy $stack_portbit "" |
|
69 |
ReadINIStr $0 "$stack_instdir\properties.ini" "Apache" "apache_server_port" |
|
70 |
StrCmp $0 "80" +2 |
|
71 |
StrCpy $stack_portbit ":$0" |
|
72 |
FunctionEnd |
|
73 |
||
74 |
Function BNSetVarsForWAPP |
|
75 |
StrCpy $stack_type "WAPP" |
|
76 |
StrCpy $stack_instdir "$wappstack_installed" |
|
77 |
StrCpy $db_driver "postgresql" |
|
78 |
StrCpy $db_dbmsname "PostgreSQL" |
|
79 |
StrCpy $db_rootuser "postgres" |
|
80 |
; NOTE: WAPPStack doesn't record the port of PostgreSQL - we have to assume the default |
|
81 |
StrCpy $db_port 5432 |
|
82 |
||
83 |
StrCpy $stack_portbit "" |
|
84 |
ReadINIStr $0 "$stack_instdir\properties.ini" "Apache" "apache_server_port" |
|
85 |
StrCmp $0 "80" +2 |
|
86 |
StrCpy $stack_portbit ":$0" |
|
87 |
FunctionEnd |