]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/win32_installer/ConfigPage2.nsh
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / win32 / win32_installer / ConfigPage2.nsh
1 Function EnterConfigPage2
2   IntOp $R0 $NewComponents & ${ComponentsRequiringUserConfig}
3
4   ${If} $R0 = 0
5     Abort
6   ${EndIf}
7
8   FileOpen $R5 "$PLUGINSDIR\ConfigPage2.ini" w
9
10   StrCpy $R6 1  ; Field Number
11   StrCpy $R7 0  ; Top
12
13   IntOp $R0 $NewComponents & ${ComponentDirector}
14   ${If} $R0 <> 0
15     ${If} $AutomaticInstall = 1
16       IntOp $R8 $R7 + 54
17     ${Else}
18       IntOp $R8 $R7 + 92
19     ${EndIf}
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'
21   ${Else}
22     IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
23     ${If} $R0 <> 0
24       IntOp $R8 $R7 + 54
25     ${Else}
26       IntOp $R8 $R7 + 26
27     ${EndIf}
28     FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Enter Director Information"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n'
29   ${EndIf}
30
31   IntOp $R6 $R6 + 1
32   IntOp $R7 $R7 + 12
33
34   IntOp $R0 $NewComponents & ${ComponentDirector}
35   ${If} $R0 <> 0
36     ${If} "$ConfigDirectorName" == ""
37       StrCpy $ConfigDirectorName "$HostName-dir"
38     ${EndIf}
39     ${If} "$ConfigDirectorPassword" == ""
40       StrCpy $ConfigDirectorPassword "$LocalDirectorPassword"
41     ${EndIf}
42   ${Else}
43     ${If} "$ConfigDirectorName" == "$HostName-dir"
44       StrCpy $ConfigDirectorName ""
45     ${EndIf}
46     ${If} "$ConfigDirectorPassword" == "$LocalDirectorPassword"
47       StrCpy $ConfigDirectorPassword ""
48     ${EndIf}
49   ${EndIf}
50
51   IntOp $R0 $NewComponents & ${ComponentDirector}
52   ${If} $R0 = 0
53   ${OrIf} $AutomaticInstall = 0
54     IntOp $R8 $R7 + 8
55     FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\r$\nBottom=$R8$\r$\n$\r$\n'
56     IntOp $R6 $R6 + 1
57     IntOp $R7 $R7 - 2
58
59     IntOp $R8 $R8 + 2
60     FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=60$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n'
61     IntOp $R6 $R6 + 1
62
63     ${If} $AutomaticInstall = 0
64       IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
65       ${If} $R0 <> 0
66         IntOp $R7 $R7 + 2
67         IntOp $R8 $R8 - 2
68         FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n'
69         IntOp $R6 $R6 + 1
70         IntOp $R7 $R7 - 2
71
72         IntOp $R8 $R8 + 2
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'
74         IntOp $R6 $R6 + 1
75       ${EndIf}
76
77       IntOp $R0 $NewComponents & ${ComponentDirector}
78       ${If} $R0 <> 0
79         IntOp $R7 $R7 + 2
80         IntOp $R8 $R8 - 2
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'
82         IntOp $R6 $R6 + 1
83         IntOp $R7 $R7 - 2
84
85         IntOp $R8 $R8 + 2
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'
87         IntOp $R6 $R6 + 1
88       ${EndIf}
89     ${EndIf}
90
91     IntOp $R7 $R7 + 14
92   ${EndIf}
93
94   IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
95   ${If} $R0 <> 0
96   ${OrIf} $AutomaticInstall = 0
97     IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
98     ${If} $R0 <> 0
99       IntOp $R7 $R7 + 2
100       IntOp $R8 $R7 + 8
101
102       FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\r$\nBottom=$R8$\r$\n$\r$\n'
103
104       IntOp $R6 $R6 + 1
105       IntOp $R7 $R7 - 2
106       IntOp $R8 $R8 + 2
107
108       FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorPassword$\r$\nLeft=60$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
109
110       IntOp $R6 $R6 + 1
111       IntOp $R7 $R7 + 14
112     ${EndIf}
113   ${EndIf}
114
115   IntOp $R0 $NewComponents & ${ComponentDirector}
116   ${If} $R0 <> 0
117     IntOp $R7 $R7 + 2
118     IntOp $R8 $R7 + 8
119
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'
121
122     IntOp $R6 $R6 + 1
123     IntOp $R7 $R7 - 2
124     IntOp $R8 $R8 + 2
125
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'
127     IntOp $R6 $R6 + 1
128     IntOp $R7 $R7 + 16
129     IntOp $R8 $R7 + 8
130
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'
132
133     IntOp $R6 $R6 + 1
134     IntOp $R7 $R7 - 2
135     IntOp $R8 $R8 + 2
136
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'
138     IntOp $R6 $R6 + 1
139     IntOp $R7 $R7 + 16
140     IntOp $R8 $R7 + 8
141
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'
143
144     IntOp $R6 $R6 + 1
145     IntOp $R7 $R7 - 2
146     IntOp $R8 $R8 + 2
147
148     ${If} $ConfigDirectorDB = 0
149       ${If} $MySQLPath != ""
150         StrCpy $ConfigDirectorDB 1
151       ${ElseIf} $PostgreSQLPath != ""
152         StrCpy $ConfigDirectorDB 2
153       ${Else}
154         StrCpy $ConfigDirectorDB 3
155       ${EndIf}
156     ${EndIf}
157
158     ${If} $ConfigDirectorDB = 1
159       StrCpy $R9 1
160     ${Else}
161       StrCpy $R9 0
162     ${EndIf}
163
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'
165
166     IntOp $R6 $R6 + 1
167
168     ${If} $ConfigDirectorDB = 2
169       StrCpy $R9 1
170     ${Else}
171       StrCpy $R9 0
172     ${EndIf}
173
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'
175
176     IntOp $R6 $R6 + 1
177
178     ${If} $ConfigDirectorDB = 3
179       StrCpy $R9 1
180     ${Else}
181       StrCpy $R9 0
182     ${EndIf}
183
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'
185
186     IntOp $R6 $R6 + 1
187     IntOp $R7 $R7 + 12
188
189     ${If} $AutomaticInstall = 0
190       IntOp $R8 $R7 + 10
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'
192       IntOp $R6 $R6 + 1
193
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'
195
196       IntOp $R6 $R6 + 1
197       IntOp $R7 $R7 + 12
198     ${EndIf}
199   ${Else}
200     IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
201     ${If} $R0 <> 0
202       IntOp $R7 $R7 + 2
203       IntOp $R8 $R7 + 8
204
205       FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\r$\nBottom=$R8$\r$\n$\r$\n'
206
207       IntOp $R6 $R6 + 1
208       IntOp $R7 $R7 - 2
209       IntOp $R8 $R8 + 2
210
211       FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorAddress$\r$\nLeft=60$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n'
212       IntOp $R6 $R6 + 1
213       IntOp $R7 $R7 + 14
214       IntOp $R8 $R7 + 8
215     ${EndIf}
216   ${EndIf}
217
218   IntOp $R7 $R7 + 4
219
220   ${If} $AutomaticInstall = 0
221     IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector}
222     ${If} $R0 <> 0
223       IntOp $R8 $R7 + 42
224
225       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'
226       IntOp $R6 $R6 + 1
227       IntOp $R7 $R7 + 12
228
229       IntOp $R8 $R7 + 8
230       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'
231       IntOp $R6 $R6 + 1
232       IntOp $R7 $R7 - 2
233
234       IntOp $R8 $R8 + 2
235       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'
236       IntOp $R6 $R6 + 1
237       IntOp $R7 $R7 + 16
238       IntOp $R8 $R7 + 8
239
240       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'
241
242       IntOp $R6 $R6 + 1
243       IntOp $R7 $R7 - 2
244       IntOp $R8 $R8 + 2
245
246       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'
247
248       IntOp $R6 $R6 + 1
249       IntOp $R7 $R7 + 20
250     ${EndIf}
251   ${EndIf}
252
253   IntOp $R6 $R6 - 1
254   FileWrite $R5 "[Settings]$\r$\nNumFields=$R6$\r$\n"
255
256   FileClose $R5
257
258   IntOp $R0 $NewComponents & ${ComponentsFileAndStorage}
259   ${If} $R0 = 0
260   ${OrIf} $AutomaticInstall = 1
261     !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage1)" "$(SUBTITLE_ConfigPage1)"
262   ${Else}
263     !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage2)" "$(SUBTITLE_ConfigPage2)"
264   ${EndIf}
265
266   !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ConfigPage2.ini"
267   Pop $HDLG ;HWND of dialog
268
269   ; Initialize Controls
270   StrCpy $R6 2  ; Field Number
271
272   IntOp $R0 $NewComponents & ${ComponentDirector}
273   ${If} $R0 = 0
274   ${OrIf} $AutomaticInstall = 0
275     ; Name
276     IntOp $R6 $R6 + 1
277     !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
278     SendMessage $HCTL ${EM_LIMITTEXT} 30 0
279     IntOp $R6 $R6 + 1
280
281     ${If} $AutomaticInstall = 0
282       IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
283       ${If} $R0 <> 0
284         IntOp $R6 $R6 + 1
285         ; Port Number
286         !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
287         SendMessage $HCTL ${EM_LIMITTEXT} 5 0
288         IntOp $R6 $R6 + 1
289       ${EndIf}
290
291       IntOp $R0 $NewComponents & ${ComponentDirector}
292       ${If} $R0 <> 0
293         IntOp $R6 $R6 + 1
294         ; Max Jobs
295         !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
296         SendMessage $HCTL ${EM_LIMITTEXT} 3 0
297
298         IntOp $R6 $R6 + 1
299       ${EndIf}
300     ${EndIf}
301   ${EndIf}
302
303   IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
304   ${If} $R0 <> 0
305   ${OrIf} $AutomaticInstall = 0
306     IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
307     ${If} $R0 <> 0
308       IntOp $R6 $R6 + 2
309     ${EndIf}
310   ${EndIf}
311
312   IntOp $R0 $NewComponents & ${ComponentDirector}
313   ${If} $R0 <> 0
314     IntOp $R6 $R6 + 9
315
316     ${If} $AutomaticInstall = 0
317       IntOp $R6 $R6 + 2
318     ${EndIf}
319   ${Else}
320     IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
321     ${If} $R0 <> 0
322       IntOp $R6 $R6 + 2
323     ${EndIf}
324   ${EndIf}
325
326   ${If} $AutomaticInstall = 0
327     IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector}
328     ${If} $R0 <> 0
329       IntOp $R6 $R6 + 2
330       !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND"
331       SendMessage $HCTL ${EM_LIMITTEXT} 30 0
332       IntOp $R6 $R6 + 2
333     ${EndIf}
334   ${EndIf}
335
336   !insertmacro MUI_INSTALLOPTIONS_SHOW
337
338   ; Process results
339
340   StrCpy $R6 2
341
342   IntOp $R0 $NewComponents & ${ComponentDirector}
343   ${If} $R0 = 0
344   ${OrIf} $AutomaticInstall = 0
345     IntOp $R6 $R6 + 1
346     !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorName "ConfigPage2.ini" "Field $R6" "State"
347     IntOp $R6 $R6 + 1
348
349     ${If} $AutomaticInstall = 0
350       IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
351       ${If} $R0 <> 0
352         IntOp $R6 $R6 + 1
353         !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPort "ConfigPage2.ini" "Field $R6" "State"
354         IntOp $R6 $R6 + 1
355       ${EndIf}
356
357       IntOp $R0 $NewComponents & ${ComponentDirector}
358       ${If} $R0 <> 0
359         IntOp $R6 $R6 + 1
360         !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMaxJobs "ConfigPage2.ini" "Field $R6" "State"
361         IntOp $R6 $R6 + 1
362       ${EndIf}
363     ${EndIf}
364   ${EndIf}
365
366   IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
367   ${If} $R0 <> 0
368   ${OrIf} $AutomaticInstall = 0
369     IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
370     ${If} $R0 <> 0
371       IntOp $R6 $R6 + 1
372       !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPassword "ConfigPage2.ini" "Field $R6" "State"
373       IntOp $R6 $R6 + 1
374     ${EndIf}
375   ${EndIf}
376
377   IntOp $R0 $NewComponents & ${ComponentDirector}
378   ${If} $R0 <> 0
379     IntOp $R6 $R6 + 1
380     !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailServer "ConfigPage2.ini" "Field $R6" "State"
381     IntOp $R6 $R6 + 2
382     !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailAddress "ConfigPage2.ini" "Field $R6" "State"
383     IntOp $R6 $R6 + 2
384     !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State"
385     ${If} $R5 = 1
386       StrCpy $ConfigDirectorDB 1
387     ${Endif}
388     IntOp $R6 $R6 + 1
389     !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State"
390     ${If} $R5 = 1
391       StrCpy $ConfigDirectorDB 2
392     ${Endif}
393     IntOp $R6 $R6 + 1
394     !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State"
395     ${If} $R5 = 1
396       StrCpy $ConfigDirectorDB 3
397     ${Endif}
398     IntOp $R6 $R6 + 1
399
400     ${If} $AutomaticInstall = 0
401       !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorInstallService "ConfigPage2.ini" "Field $R6" "State"
402       IntOp $R6 $R6 + 1
403       !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorStartService "ConfigPage2.ini" "Field $R6" "State"
404       IntOp $R6 $R6 + 1
405     ${EndIf}
406   ${Else}
407     IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles}
408     ${If} $R0 <> 0
409       IntOp $R6 $R6 + 1
410       !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorAddress "ConfigPage2.ini" "Field $R6" "State"
411       IntOp $R6 $R6 + 1
412     ${EndIf}
413   ${EndIf}
414
415   ${If} $AutomaticInstall = 0
416     IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector}
417     ${If} $R0 <> 0
418       IntOp $R6 $R6 + 2
419       !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorName "ConfigPage2.ini" "Field $R6" "State"
420       IntOp $R6 $R6 + 2
421       !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorPassword "ConfigPage2.ini" "Field $R6" "State"
422     ${EndIf}
423   ${EndIf}
424 FunctionEnd
425
426 Function LeaveConfigPage2
427   ${If} $AutomaticInstall = 0
428     StrCpy $R6 4
429
430     IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles}
431     ${If} $R0 <> 0
432       IntOp $R6 $R6 + 1
433       !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State"
434       ${If} $R0 < 1024
435       ${OrIf} $R0 > 65535
436         MessageBox MB_OK "Port must be between 1024 and 65535 inclusive."
437         Abort
438       ${EndIf}
439       IntOp $R6 $R6 + 1
440     ${EndIf}
441
442     IntOp $R0 $NewComponents & ${ComponentDirector}
443     ${If} $R0 <> 0
444       IntOp $R6 $R6 + 1
445       !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State"
446       ${If} $R0 < 1
447       ${OrIf} $R0 > 99
448         MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive."
449         Abort
450       ${EndIf}
451       IntOp $R6 $R6 + 1
452     ${EndIf}
453   ${EndIf}
454 FunctionEnd