1 Function EnterConfigPage2
2 IntOp $R0 $NewComponents & ${ComponentsRequiringUserConfig}
8 FileOpen $R5 "$PLUGINSDIR\ConfigPage2.ini" w
10 StrCpy $R6 1 ; Field Number
13 IntOp $R0 $NewComponents & ${ComponentDirector}
15 ${If} $AutomaticInstall = 1
20 FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Director"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n'
22 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
28 FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Enter data for Director Allowed to access this Client"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n'
34 IntOp $R0 $NewComponents & ${ComponentDirector}
36 ${If} "$ConfigDirectorName" == ""
37 StrCpy $ConfigDirectorName "$HostName-dir"
39 ${If} "$ConfigDirectorPassword" == ""
40 StrCpy $ConfigDirectorPassword "$LocalDirectorPassword"
43 ${If} "$ConfigDirectorName" == "$HostName-dir"
44 StrCpy $ConfigDirectorName ""
46 ${If} "$ConfigDirectorPassword" == "$LocalDirectorPassword"
47 StrCpy $ConfigDirectorPassword ""
51 IntOp $R0 $NewComponents & ${ComponentDirector}
53 ${OrIf} $AutomaticInstall = 0
55 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n'
60 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n'
63 ${If} $AutomaticInstall = 0
64 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
68 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n'
73 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorPort$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=218$\r$\nBottom=$R8$\r$\n$\r$\n'
77 IntOp $R0 $NewComponents & ${ComponentDirector}
81 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Max Jobs"$\r$\nLeft=238$\r$\nTop=$R7$\r$\nRight=270$\r$\nBottom=$R8$\r$\n$\r$\n'
86 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorMaxJobs$\r$\nLeft=274$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
94 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
96 ${OrIf} $AutomaticInstall = 0
97 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
102 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n'
108 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
115 IntOp $R0 $NewComponents & ${ComponentDirector}
120 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Mail Server"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n'
126 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorMailServer$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
131 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Mail Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n'
137 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorMailAddress$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
142 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Database"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n'
148 ${If} $ConfigDirectorDB = 0
149 ${If} $MySQLPath != ""
150 StrCpy $ConfigDirectorDB 1
151 ${ElseIf} $PostgreSQLPath != ""
152 StrCpy $ConfigDirectorDB 2
154 StrCpy $ConfigDirectorDB 3
158 ${If} $ConfigDirectorDB = 1
164 FileWrite $R5 '[Field $R6]$\r$\nType="RadioButton"$\r$\nState=$R9$\r$\nText="MySQL"$\r$\nFlags="GROUP"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=90$\r$\nBottom=$R8$\r$\n$\r$\n'
168 ${If} $ConfigDirectorDB = 2
174 FileWrite $R5 '[Field $R6]$\r$\nType="RadioButton"$\r$\nState=$R9$\r$\nText="PostgreSQL"$\r$\nFlags="NOTABSTOP"$\r$\nLeft=94$\r$\nTop=$R7$\r$\nRight=146$\r$\nBottom=$R8$\r$\n$\r$\n'
178 ${If} $ConfigDirectorDB = 3
184 FileWrite $R5 '[Field $R6]$\r$\nType="RadioButton"$\r$\nState=$R9$\r$\nText="Sqlite"$\r$\nFlags="NOTABSTOP"$\r$\nLeft=150$\r$\nTop=$R7$\r$\nRight=182$\r$\nBottom=$R8$\r$\n$\r$\n'
189 ${If} $AutomaticInstall = 0
191 FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorInstallService$\r$\nText="Install as service"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=118$\r$\nBottom=$R8$\r$\n$\r$\n'
194 FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorStartService$\r$\nText="Start after install"$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=260$\r$\nBottom=$R8$\r$\n$\r$\n'
200 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
205 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n'
211 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorAddress$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
220 ${If} $AutomaticInstall = 0
221 IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector}
226 FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Monitor"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n'
231 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n'
236 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=150$\r$\nBottom=$R8$\r$\n$\r$\n'
241 FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n'
247 FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
255 FileWrite $R5 "[Settings]$\r$\nNumFields=$R6$\r$\n"
259 IntOp $R0 $NewComponents & ${ComponentsFileAndStorage}
261 ${OrIf} $AutomaticInstall = 1
262 !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage1)" "$(SUBTITLE_ConfigPage1)"
264 !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage2)" "$(SUBTITLE_ConfigPage2)"
267 !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ConfigPage2.ini"
268 Pop $HDLG ;HWND of dialog
270 ; Initialize Controls
271 StrCpy $R6 2 ; Field Number
273 IntOp $R0 $NewComponents & ${ComponentDirector}
275 ${OrIf} $AutomaticInstall = 0
278 !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
279 SendMessage $HCTL ${EM_LIMITTEXT} 30 0
282 ${If} $AutomaticInstall = 0
283 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
287 !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
288 SendMessage $HCTL ${EM_LIMITTEXT} 5 0
292 IntOp $R0 $NewComponents & ${ComponentDirector}
296 !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
297 SendMessage $HCTL ${EM_LIMITTEXT} 3 0
304 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
306 ${OrIf} $AutomaticInstall = 0
307 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
313 IntOp $R0 $NewComponents & ${ComponentDirector}
317 ${If} $AutomaticInstall = 0
321 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
327 ${If} $AutomaticInstall = 0
328 IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector}
331 !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
332 SendMessage $HCTL ${EM_LIMITTEXT} 30 0
337 !insertmacro MUI_INSTALLOPTIONS_SHOW
343 IntOp $R0 $NewComponents & ${ComponentDirector}
345 ${OrIf} $AutomaticInstall = 0
347 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorName "ConfigPage2.ini" "Field $R6" "State"
350 ${If} $AutomaticInstall = 0
351 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
354 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPort "ConfigPage2.ini" "Field $R6" "State"
358 IntOp $R0 $NewComponents & ${ComponentDirector}
361 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMaxJobs "ConfigPage2.ini" "Field $R6" "State"
367 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
369 ${OrIf} $AutomaticInstall = 0
370 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
373 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPassword "ConfigPage2.ini" "Field $R6" "State"
378 IntOp $R0 $NewComponents & ${ComponentDirector}
381 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailServer "ConfigPage2.ini" "Field $R6" "State"
383 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailAddress "ConfigPage2.ini" "Field $R6" "State"
385 !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State"
387 StrCpy $ConfigDirectorDB 1
390 !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State"
392 StrCpy $ConfigDirectorDB 2
395 !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State"
397 StrCpy $ConfigDirectorDB 3
401 ${If} $AutomaticInstall = 0
402 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorInstallService "ConfigPage2.ini" "Field $R6" "State"
404 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorStartService "ConfigPage2.ini" "Field $R6" "State"
408 IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
411 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorAddress "ConfigPage2.ini" "Field $R6" "State"
416 ${If} $AutomaticInstall = 0
417 IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector}
420 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorName "ConfigPage2.ini" "Field $R6" "State"
422 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorPassword "ConfigPage2.ini" "Field $R6" "State"
427 Function LeaveConfigPage2
428 ${If} $AutomaticInstall = 0
431 IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
434 !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State"
437 MessageBox MB_OK "Port must be between 1024 and 65535 inclusive."
443 IntOp $R0 $NewComponents & ${ComponentDirector}
446 !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State"
449 MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive."