3 ; Began as a version written by Michel Meyers (michel@tcnnet.dyndns.org)
5 ; Adapted by Kern Sibbald for native Win32 Bacula
6 ; added a number of elements from Christopher Hull's installer
8 ; D. Scott Barninger Nov 13 2004
9 ; added configuration editing for bconsole.conf and wx-console.conf
10 ; better explanation in dialog boxes for editing config files
11 ; added Start Menu items
12 ; fix uninstall of config files to do all not just bacula-fd.conf
14 ; D. Scott Barninger Dec 05 2004
15 ; added specification of default permissions for bacula-fd.conf
16 ; - thanks to Jamie Ffolliott for pointing me at cacls
17 ; added removal of working-dir files if user selects to remove config
18 ; uninstall is now 100% clean
20 ; D. Scott Barninger Apr 17 2005
21 ; 1.36.3 release docs update
22 ; add pdf manual and menu shortcut
24 ; Robert Nelson May 15 2006
25 ; Pretty much rewritten
27 ; Added Bacula-SD and Bacula-DIR
28 ; Replaced ParameterGiven with standard GetOptions
31 ; Command line options:
33 ; /cygwin - do cygwin install into c:\cygwin\bacula
37 !define PRODUCT "Bacula"
40 ; Include the Modern UI
44 !include "LogicLib.nsh"
45 !include "FileFunc.nsh"
46 !include "Sections.nsh"
47 !include "StrFunc.nsh"
48 !include "WinMessages.nsh"
53 OutFile "${OUT_DIR}\winbacula-${VERSION}.exe"
55 InstallDir "$PROGRAMFILES\Bacula"
56 InstallDirRegKey HKLM "Software\Bacula" "InstallLocation"
62 !insertmacro GetParent
73 !define MUI_COMPONENTSPAGE_SMALLDESC
75 !define MUI_HEADERIMAGE
76 !define MUI_BGCOLOR 739AB9
77 !define MUI_HEADERIMAGE_BITMAP "bacula-logo.bmp"
79 !InsertMacro MUI_PAGE_WELCOME
80 ; !InsertMacro MUI_PAGE_LICENSE "..\..\LICENSE"
81 Page custom EnterInstallType
82 !define MUI_PAGE_CUSTOMFUNCTION_SHOW PageComponentsShow
83 !InsertMacro MUI_PAGE_COMPONENTS
84 !define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre
85 !InsertMacro MUI_PAGE_DIRECTORY
86 Page custom EnterConfigPage1 LeaveConfigPage1
87 Page custom EnterConfigPage2 LeaveConfigPage2
88 !Define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveInstallPage
89 !InsertMacro MUI_PAGE_INSTFILES
90 Page custom EnterWriteTemplates
91 !Define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt
92 !InsertMacro MUI_PAGE_FINISH
94 !InsertMacro MUI_UNPAGE_WELCOME
95 !InsertMacro MUI_UNPAGE_CONFIRM
96 !InsertMacro MUI_UNPAGE_INSTFILES
97 !InsertMacro MUI_UNPAGE_FINISH
99 !define MUI_ABORTWARNING
101 !InsertMacro MUI_LANGUAGE "English"
103 !InsertMacro GetParameters
104 !InsertMacro GetOptions
106 DirText "Setup will install Bacula ${VERSION} to the directory specified below. To install in a different folder, click Browse and select another folder."
108 !InsertMacro MUI_RESERVEFILE_INSTALLOPTIONS
126 Var ConfigClientMaxJobs
127 Var ConfigClientPassword
128 Var ConfigClientInstallService
129 Var ConfigClientStartService
131 Var ConfigStorageName
132 Var ConfigStoragePort
133 Var ConfigStorageMaxJobs
134 Var ConfigStoragePassword
135 Var ConfigStorageInstallService
136 Var ConfigStorageStartService
138 Var ConfigDirectorName
139 Var ConfigDirectorPort
140 Var ConfigDirectorMaxJobs
141 Var ConfigDirectorPassword
142 Var ConfigDirectorAddress
143 Var ConfigDirectorMailServer
144 Var ConfigDirectorMailAddress
146 Var ConfigDirectorInstallService
147 Var ConfigDirectorStartService
149 Var ConfigMonitorName
150 Var ConfigMonitorPassword
152 Var LocalDirectorPassword
158 !define UpgradeInstall 1
159 !define MigrateInstall 2
162 Var PreviousComponents
165 ; Bit 0 = File Service
166 ; 1 = Storage Service
167 ; 2 = Director Service
168 ; 3 = Command Console
169 ; 4 = Graphical Console
170 ; 5 = Documentation (PDF)
171 ; 6 = Documentation (HTML)
173 !define ComponentFile 1
174 !define ComponentStorage 2
175 !define ComponentDirector 4
176 !define ComponentTextConsole 8
177 !define ComponentGUIConsole 16
178 !define ComponentPDFDocs 32
179 !define ComponentHTMLDocs 64
181 !define ComponentsRequiringUserConfig 31
182 !define ComponentsFileAndStorage 3
183 !define ComponentsFileAndStorageAndDirector 7
184 !define ComponentsDirectorAndTextGuiConsoles 28
185 !define ComponentsTextAndGuiConsoles 24
194 ; Process Command Line Options
199 StrCpy $CommonFilesDone 0
200 StrCpy $DatabaseDone 0
202 StrCpy $AutomaticInstall 0
203 StrCpy $InstallType ${NewInstall}
204 StrCpy $OldInstallDir ""
205 StrCpy $PreviousComponents 0
206 StrCpy $NewComponents 0
211 ${GetOptions} $R0 "/cygwin" $R1
216 ${GetOptions} $R0 "/noservice" $R1
221 ${GetOptions} $R0 "/nostart" $R1
229 StrCpy $INSTDIR "C:\cygwin\bacula"
232 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
241 Pop $LocalHostAddress
244 Pop $ConfigDirectorMailAddress
246 ; Configuration Defaults
248 StrCpy $ConfigClientName "$HostName-fd"
249 StrCpy $ConfigClientPort "9102"
250 StrCpy $ConfigClientMaxJobs "2"
251 ;StrCpy $ConfigClientPassword
252 StrCpy $ConfigClientInstallService "$OptService"
253 StrCpy $ConfigClientStartService "$OptStart"
255 StrCpy $ConfigStorageName "$HostName-sd"
256 StrCpy $ConfigStoragePort "9103"
257 StrCpy $ConfigStorageMaxJobs "10"
258 ;StrCpy $ConfigStoragePassword
259 StrCpy $ConfigStorageInstallService "$OptService"
260 StrCpy $ConfigStorageStartService "$OptStart"
262 ;StrCpy $ConfigDirectorName "$HostName-dir"
263 StrCpy $ConfigDirectorPort "9101"
264 StrCpy $ConfigDirectorMaxJobs "1"
265 ;StrCpy $ConfigDirectorPassword
266 StrCpy $ConfigDirectorDB "1"
267 StrCpy $ConfigDirectorInstallService "$OptService"
268 StrCpy $ConfigDirectorStartService "$OptStart"
270 StrCpy $ConfigMonitorName "$HostName-mon"
271 ;StrCpy $ConfigMonitorPassword
274 File "/oname=$PLUGINSDIR\openssl.exe" "${DEPKGS_BIN}\openssl.exe"
275 File "/oname=$PLUGINSDIR\libeay32.dll" "${DEPKGS_BIN}\libeay32.dll"
276 File "/oname=$PLUGINSDIR\ssleay32.dll" "${DEPKGS_BIN}\ssleay32.dll"
277 File "/oname=$PLUGINSDIR\sed.exe" "${DEPKGS_BIN}\sed.exe"
279 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini"
280 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "WriteTemplates.ini"
282 SetPluginUnload alwaysoff
284 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
287 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
290 ${StrTrimNewLines} $ConfigClientPassword $R0
294 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
297 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
300 ${StrTrimNewLines} $ConfigStoragePassword $R0
304 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
307 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
310 ${StrTrimNewLines} $LocalDirectorPassword $R0
314 SetPluginUnload manual
316 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
319 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
322 ${StrTrimNewLines} $ConfigMonitorPassword $R0
330 Function .onSelChange
331 Call UpdateComponentUI
334 Function InstallCommonFiles
335 ${If} $CommonFilesDone = 0
336 SetOutPath "$INSTDIR"
339 SetOutPath "$INSTDIR\bin"
340 !if "${BUILD_TOOLS}" == "VC8"
341 File "${VC_REDIST_DIR}\msvcm80.dll"
342 File "${VC_REDIST_DIR}\msvcp80.dll"
343 File "${VC_REDIST_DIR}\msvcr80.dll"
344 File "${VC_REDIST_DIR}\Microsoft.VC80.CRT.manifest"
345 File "${DEPKGS_BIN}\pthreadVCE.dll"
347 !if "${BUILD_TOOLS}" == "VC8_DEBUG"
348 File "${VC_REDIST_DIR}\msvcm80.dll"
349 File "${VC_REDIST_DIR}\msvcp80.dll"
350 File "${VC_REDIST_DIR}\msvcr80.dll"
351 File "${VC_REDIST_DIR}\Microsoft.VC80.CRT.manifest"
352 File "${VC_REDIST_DIR}\msvcm80d.dll"
353 File "${VC_REDIST_DIR}\msvcp80d.dll"
354 File "${VC_REDIST_DIR}\msvcr80d.dll"
355 File "${VC_REDIST_DIR}\Microsoft.VC80.DebugCRT.manifest"
356 File "${DEPKGS_BIN}\pthreadVCE.dll"
358 !if "${BUILD_TOOLS}" == "MinGW"
359 File "${MINGW_BIN}\..\mingw32\bin\mingwm10.dll"
360 File "${DEPKGS_BIN}\pthreadGCE.dll"
362 File "${DEPKGS_BIN}\libeay32.dll"
363 File "${DEPKGS_BIN}\ssleay32.dll"
364 File "${DEPKGS_BIN}\zlib1.dll"
365 !if "${BUILD_TOOLS}" == "VC8"
366 File "${DEPKGS_BIN}\zlib1.dll.manifest"
367 File "/oname=$INSTDIR\openssl.cnf" "${DEPKGS_BIN}\..\openssl.cnf"
369 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
370 File "${DEPKGS_BIN}\zlib1.dll.manifest"
371 File "/oname=$INSTDIR\openssl.cnf" "${DEPKGS_BIN}\..\openssl.cnf"
373 !if "${BUILD_TOOLS}" == "MinGW"
374 File "/oname=$INSTDIR\openssl.cnf" "${DEPKGS_BIN}\..\ssl\openssl.cnf"
376 File "${DEPKGS_BIN}\openssl.exe"
377 File "${BACULA_BIN}\bsleep.exe"
378 File "${BACULA_BIN}\bsmtp.exe"
379 File "${BACULA_BIN}\bacula.dll"
381 CreateShortCut "$SMPROGRAMS\Bacula\View Readme.lnk" "write.exe" '"$INSTDIR\Readme.txt"'
383 StrCpy $CommonFilesDone 1
387 Function InstallDatabase
388 SetOutPath "$INSTDIR\bin"
390 ${If} $DatabaseDone = 0
391 ${If} $ConfigDirectorDB = 1
392 File /oname=bacula_cats.dll "${BACULA_BIN}\cats_mysql.dll"
393 File "${DEPKGS_BIN}\libmysql.dll"
394 ${ElseIf} $ConfigDirectorDB = 2
395 File /oname=bacula_cats.dll "${BACULA_BIN}\cats_pgsql.dll"
396 File "${DEPKGS_BIN}\libpq.dll"
397 !if "${BUILD_TOOLS}" == "VC8"
398 File "${DEPKGS_BIN}\comerr32.dll"
399 File "${DEPKGS_BIN}\libintl-2.dll"
400 File "${DEPKGS_BIN}\libiconv-2.dll"
401 File "${DEPKGS_BIN}\krb5_32.dll"
403 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
404 File "${DEPKGS_BIN}\comerr32.dll"
405 File "${DEPKGS_BIN}\libintl-2.dll"
406 File "${DEPKGS_BIN}\libiconv-2.dll"
407 File "${DEPKGS_BIN}\krb5_32.dll"
409 ${ElseIf} $ConfigDirectorDB = 4
410 File /oname=bacula_cats.dll "${BACULA_BIN}\cats_bdb.dll"
413 StrCpy $DatabaseDone 1
417 Section "-Initialize"
418 WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR"
420 Call GetSelectedComponents
422 WriteRegDWORD HKLM Software\Bacula Components $R2
424 SetShellVarContext all
425 CreateDirectory "$SMPROGRAMS\Bacula"
427 CreateDirectory "$INSTDIR"
428 CreateDirectory "$INSTDIR\bin"
429 CreateDirectory "$APPDATA\Bacula"
430 CreateDirectory "$APPDATA\Bacula\Work"
431 CreateDirectory "$APPDATA\Bacula\Spool"
433 File "..\..\..\LICENSE"
434 Delete /REBOOTOK "$INSTDIR\bin\License.txt"
436 FileOpen $R1 $PLUGINSDIR\config.sed w
437 FileWrite $R1 "s;@VERSION@;${VERSION};$\r$\n"
438 FileWrite $R1 "s;@DATE@;${__DATE__};$\r$\n"
439 FileWrite $R1 "s;@DISTNAME@;Windows;$\r$\n"
441 !If "$BUILD_TOOLS" == "MinGW"
451 FileWrite $R1 "s;@DISTVER@;$R2;$\r$\n"
453 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\"
454 FileWrite $R1 's;@working_dir@;$R2;$\r$\n'
455 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\"
456 FileWrite $R1 's;@working_dir_cmd@;$R2;$\r$\n'
458 ${StrRep} $R2 "$INSTDIR\bin" "\" "\\\\"
459 FileWrite $R1 's;@bin_dir@;$R2;$\r$\n'
460 ${StrRep} $R2 "$INSTDIR\bin" "\" "\\"
461 FileWrite $R1 's;@bin_dir_cmd@;$R2;$\r$\n'
463 Call IsDirectorSelected
466 FileWrite $R1 "s;@director_address@;$LocalHostAddress;$\r$\n"
468 ${If} "$ConfigDirectorAddress" != ""
469 FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;$\r$\n"
473 FileWrite $R1 "s;@client_address@;$LocalHostAddress;$\r$\n"
474 FileWrite $R1 "s;@storage_address@;$LocalHostAddress;$\r$\n"
476 ${If} "$ConfigClientName" != ""
477 FileWrite $R1 "s;@client_name@;$ConfigClientName;$\r$\n"
479 ${If} "$ConfigClientPort" != ""
480 FileWrite $R1 "s;@client_port@;$ConfigClientPort;$\r$\n"
482 ${If} "$ConfigClientMaxJobs" != ""
483 FileWrite $R1 "s;@client_maxjobs@;$ConfigClientMaxJobs;$\r$\n"
485 ${If} "$ConfigClientPassword" != ""
486 FileWrite $R1 "s;@client_password@;$ConfigClientPassword;$\r$\n"
488 ${If} "$ConfigStorageName" != ""
489 FileWrite $R1 "s;@storage_name@;$ConfigStorageName;$\r$\n"
491 ${If} "$ConfigStoragePort" != ""
492 FileWrite $R1 "s;@storage_port@;$ConfigStoragePort;$\r$\n"
494 ${If} "$ConfigStorageMaxJobs" != ""
495 FileWrite $R1 "s;@storage_maxjobs@;$ConfigStorageMaxJobs;$\r$\n"
497 ${If} "$ConfigStoragePassword" != ""
498 FileWrite $R1 "s;@storage_password@;$ConfigStoragePassword;$\r$\n"
500 ${If} "$ConfigDirectorName" != ""
501 FileWrite $R1 "s;@director_name@;$ConfigDirectorName;$\r$\n"
503 ${If} "$ConfigDirectorPort" != ""
504 FileWrite $R1 "s;@director_port@;$ConfigDirectorPort;$\r$\n"
506 ${If} "$ConfigDirectorMaxJobs" != ""
507 FileWrite $R1 "s;@director_maxjobs@;$ConfigDirectorMaxJobs;$\r$\n"
509 ${If} "$ConfigDirectorPassword" != ""
510 FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;$\r$\n"
512 ${If} "$ConfigDirectorMailServer" != ""
513 FileWrite $R1 "s;@smtp_host@;$ConfigDirectorMailServer;$\r$\n"
515 ${If} "$ConfigDirectorMailAddress" != ""
516 FileWrite $R1 "s;@job_email@;$ConfigDirectorMailAddress;$\r$\n"
518 ${If} "$ConfigMonitorName" != ""
519 FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;$\r$\n"
521 ${If} "$ConfigMonitorPassword" != ""
522 FileWrite $R1 "s;@monitor_password@;$ConfigMonitorPassword;$\r$\n"
527 ${If} $InstallType = ${MigrateInstall}
528 FileOpen $R1 $PLUGINSDIR\migrate.sed w
529 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\"
530 FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n'
531 FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n'
535 ${If} ${FileExists} "$OldInstallDir\bin\bacula-fd.exe"
536 ${If} $InstallType <> ${MigrateInstall}
537 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /silent /kill' ; Shutdown any bacula that could be running
539 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /silent /remove' ; Remove existing service
541 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /kill' ; Shutdown any bacula that could be running
543 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /remove' ; Remove existing service
547 ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe"
548 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /silent /kill' ; Shutdown any bacula that could be running
550 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /silent /remove' ; Remove existing service
553 ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe"
554 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /silent /kill' ; Shutdown any bacula that could be running
556 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /silent /remove' ; Remove existing service
561 SectionGroup "Client" SecGroupClient
563 Section "File Service" SecFileDaemon
566 SetOutPath "$INSTDIR\bin"
568 File "${BACULA_BIN}\bacula-fd.exe"
570 ${If} $InstallType = ${MigrateInstall}
571 ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf"
572 CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula"
573 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"'
575 ${Unless} ${FileExists} "$APPDATA\Bacula\bacula-fd.conf"
576 File "/oname=$PLUGINSDIR\bacula-fd.conf.in" "bacula-fd.conf.in"
578 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-fd.conf.in"'
579 CopyFiles "$PLUGINSDIR\bacula-fd.conf.in" "$APPDATA\Bacula\bacula-fd.conf"
584 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F'
588 StrCpy $1 "File Service"
589 StrCpy $2 $ConfigClientInstallService
590 StrCpy $3 $ConfigClientStartService
594 CreateShortCut "$SMPROGRAMS\Bacula\Edit Client Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-fd.conf"'
599 SectionGroup "Server" SecGroupServer
601 Section "Storage Service" SecStorageDaemon
604 SetOutPath "$INSTDIR\bin"
606 File "${DEPKGS_BIN}\loaderinfo.exe"
607 File "${DEPKGS_BIN}\mt.exe"
608 File "${DEPKGS_BIN}\mtx.exe"
609 File "${DEPKGS_BIN}\scsitape.exe"
610 File "${DEPKGS_BIN}\tapeinfo.exe"
611 File "${BACULA_BIN}\bacula-sd.exe"
612 File "${BACULA_BIN}\bcopy.exe"
613 File "${BACULA_BIN}\bextract.exe"
614 File "${BACULA_BIN}\bls.exe"
615 File "${BACULA_BIN}\bscan.exe"
616 File "${BACULA_BIN}\btape.exe"
617 File "${BACULA_BIN}\scsilist.exe"
619 ${Unless} ${FileExists} "${BACULA_BIN}\mtx-changer.cmd"
620 File "/oname=$PLUGINSDIR\mtx-changer.cmd" "${SCRIPT_DIR}\mtx-changer.cmd"
622 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\mtx-changer.cmd"'
623 CopyFiles "$PLUGINSDIR\mtx-changer.cmd" "$INSTDIR\bin\mtx-changer.cmd"
626 ${Unless} ${FileExists} "$APPDATA\Bacula\bacula-sd.conf"
627 File "/oname=$PLUGINSDIR\bacula-sd.conf.in" "bacula-sd.conf.in"
629 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-sd.conf.in"'
630 CopyFiles "$PLUGINSDIR\bacula-sd.conf.in" "$APPDATA\Bacula\bacula-sd.conf"
634 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F'
638 StrCpy $1 "Storage Service"
639 StrCpy $2 $ConfigStorageInstallService
640 StrCpy $3 $ConfigStorageStartService
643 CreateShortCut "$SMPROGRAMS\Bacula\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause"
644 CreateShortCut "$SMPROGRAMS\Bacula\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"'
647 Section "Director Service" SecDirectorDaemon
650 SetOutPath "$INSTDIR\bin"
653 File "${BACULA_BIN}\bacula-dir.exe"
654 File "${BACULA_BIN}\dbcheck.exe"
656 ${If} $ConfigDirectorDB = 1
657 File /oname=create_database.cmd ${CATS_DIR}\create_mysql_database.cmd
658 File /oname=drop_database.cmd ${CATS_DIR}\drop_mysql_database.cmd
659 File /oname=make_tables.cmd ${CATS_DIR}\make_mysql_tables.cmd
660 File ${CATS_DIR}\make_mysql_tables.sql
661 File /oname=drop_tables.cmd ${CATS_DIR}\drop_mysql_tables.cmd
662 File ${CATS_DIR}\drop_mysql_tables.sql
663 File /oname=update_tables.cmd ${CATS_DIR}\update_mysql_tables.cmd
664 File ${CATS_DIR}\update_mysql_tables.sql
665 File /oname=grant_privileges.cmd ${CATS_DIR}\grant_mysql_privileges.cmd
666 File ${CATS_DIR}\grant_mysql_privileges.sql
667 ${ElseIf} $ConfigDirectorDB = 2
668 File /oname=create_database.cmd ${CATS_DIR}\create_postgresql_database.cmd
669 File /oname=drop_database.cmd ${CATS_DIR}\drop_postgresql_database.cmd
670 File /oname=make_tables.cmd ${CATS_DIR}\make_postgresql_tables.cmd
671 File ${CATS_DIR}\make_postgresql_tables.sql
672 File /oname=drop_tables.cmd ${CATS_DIR}\drop_postgresql_tables.cmd
673 File ${CATS_DIR}\drop_postgresql_tables.sql
674 File /oname=update_tables.cmd ${CATS_DIR}\update_postgresql_tables.cmd
675 File ${CATS_DIR}\update_postgresql_tables.sql
676 File /oname=grant_privileges.cmd ${CATS_DIR}\grant_postgresql_privileges.cmd
677 File ${CATS_DIR}\grant_postgresql_privileges.sql
678 ${ElseIf} $ConfigDirectorDB = 4
679 File /oname=create_database.cmd ${CATS_DIR}\create_bdb_database.cmd
680 File /oname=drop_database.cmd ${CATS_DIR}\drop_bdb_database.cmd
681 File /oname=make_tables.cmd ${CATS_DIR}\make_bdb_tables.cmd
682 File /oname=drop_tables.cmd ${CATS_DIR}\drop_bdb_tables.cmd
683 File /oname=update_tables.cmd ${CATS_DIR}\update_bdb_tables.cmd
684 File /oname=grant_privileges.cmd ${CATS_DIR}\grant_bdb_privileges.cmd
686 File ${CATS_DIR}\make_catalog_backup.cmd
687 File ${CATS_DIR}\delete_catalog_backup.cmd
689 ${Unless} ${FileExists} "$APPDATA\Bacula\bacula-dir.conf"
690 File "/oname=$PLUGINSDIR\bacula-dir.conf.in" "bacula-dir.conf.in"
691 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-dir.conf.in"'
692 CopyFiles "$PLUGINSDIR\bacula-dir.conf.in" "$APPDATA\Bacula\bacula-dir.conf"
696 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F'
700 StrCpy $1 "Director Service"
701 StrCpy $2 $ConfigDirectorInstallService
702 StrCpy $3 $ConfigDirectorStartService
705 CreateShortCut "$SMPROGRAMS\Bacula\Edit Director Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-dir.conf"'
710 SectionGroup "Consoles" SecGroupConsoles
712 Section "Command Console" SecConsole
715 SetOutPath "$INSTDIR\bin"
717 File "${BACULA_BIN}\bconsole.exe"
718 Call InstallCommonFiles
720 ${If} $InstallType = ${MigrateInstall}
721 ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf"
722 CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula"
724 ${Unless} ${FileExists} "$APPDATA\Bacula\bconsole.conf"
725 File "/oname=$PLUGINSDIR\bconsole.conf.in" "bconsole.conf.in"
726 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bconsole.conf.in"'
727 CopyFiles "$PLUGINSDIR\bconsole.conf.in" "$APPDATA\Bacula\bconsole.conf"
732 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F'
735 CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0
736 CreateShortCut "$SMPROGRAMS\Bacula\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"'
740 Section "Graphical Console" SecWxConsole
743 SetOutPath "$INSTDIR\bin"
745 Call InstallCommonFiles
746 !if "${BUILD_TOOLS}" == "VC8"
747 File "${DEPKGS_BIN}\wxbase270_vc_bacula.dll"
748 File "${DEPKGS_BIN}\wxmsw270_core_vc_bacula.dll"
750 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
751 File "${DEPKGS_BIN}\wxbase270_vc_bacula.dll"
752 File "${DEPKGS_BIN}\wxmsw270_core_vc_bacula.dll"
754 !if "${BUILD_TOOLS}" == "MinGW"
755 File "${DEPKGS_BIN}\wxbase26_gcc_bacula.dll"
756 File "${DEPKGS_BIN}\wxmsw26_core_gcc_bacula.dll"
759 File "${BACULA_BIN}\wx-console.exe"
761 ${If} $InstallType = ${MigrateInstall}
762 ${AndIf} ${FileExists} "$OldInstallDir\bin\wx-console.conf"
763 CopyFiles "$OldInstallDir\bin\wx-console.conf" "$APPDATA\Bacula"
765 ${Unless} ${FileExists} "$APPDATA\Bacula\wx-console.conf"
766 File "/oname=$PLUGINSDIR\wx-console.conf.in" "wx-console.conf.in"
767 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\wx-console.conf.in"'
768 CopyFiles "$PLUGINSDIR\wx-console.conf.in" "$APPDATA\Bacula\wx-console.conf"
773 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F'
776 ; Create Start Menu entry
777 CreateShortCut "$SMPROGRAMS\Bacula\wx-console.lnk" "$INSTDIR\bin\wx-console.exe" '-c "$APPDATA\Bacula\wx-console.conf"' "$INSTDIR\bin\wx-console.exe" 0
778 CreateShortCut "$SMPROGRAMS\Bacula\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\wx-console.conf"'
783 SectionGroup "Documentation" SecGroupDocumentation
785 Section "Documentation (Acrobat Format)" SecDocPdf
788 SetOutPath "$INSTDIR\doc"
789 CreateDirectory "$INSTDIR\doc"
791 File "${DOC_DIR}\manual\bacula.pdf"
792 CreateShortCut "$SMPROGRAMS\Bacula\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"'
795 Section "Documentation (HTML Format)" SecDocHtml
798 SetOutPath "$INSTDIR\doc"
799 CreateDirectory "$INSTDIR\doc"
801 File "${DOC_DIR}\manual\bacula\*.html"
802 File "${DOC_DIR}\manual\bacula\*.png"
803 File "${DOC_DIR}\manual\bacula\*.css"
804 CreateShortCut "$SMPROGRAMS\Bacula\Manual (HTML).lnk" '"$INSTDIR\doc\bacula.html"'
809 Section "-Write Uninstaller"
811 ; Write the uninstall keys for Windows & create Start Menu entry
812 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula"
813 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "InstallLocation" "$INSTDIR"
814 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayVersion" "${VERSION}"
815 ${StrTok} $R0 "${VERSION}" "." 0 0
816 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMajor" $R0
817 ${StrTok} $R0 "${VERSION}" "." 1 0
818 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMinor" $R0
819 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoModify" 1
820 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoRepair" 1
821 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLUpdateInfo" "http://sourceforge.net/project/showfiles.php?group_id=50727"
822 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org"
823 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support"
824 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"'
825 WriteUninstaller "$INSTDIR\Uninstall.exe"
826 CreateShortCut "$SMPROGRAMS\Bacula\Uninstall Bacula.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
830 ; Extra Page descriptions
832 LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system."
833 LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system."
834 LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director Daemon on this system."
835 LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system."
836 LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install graphical console program on this system."
837 LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system."
838 LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system."
840 LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration"
841 LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration."
843 LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)"
844 LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration."
846 LangString TITLE_InstallType ${LANG_ENGLISH} "Installation Type"
847 LangString SUBTITLE_InstallType ${LANG_ENGLISH} "Choose installation type."
849 LangString TITLE_WriteTemplates ${LANG_ENGLISH} "Create Templates"
850 LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create resource templates for inclusion in the Director's configuration file."
852 !InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN
853 !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon)
854 !InsertMacro MUI_DESCRIPTION_TEXT ${SecStorageDaemon} $(DESC_SecStorageDaemon)
855 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon)
856 !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole)
857 !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole)
858 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf)
859 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml)
860 !InsertMacro MUI_FUNCTION_DESCRIPTION_END
864 UninstallText "This will uninstall Bacula. Hit next to continue."
867 ; Shutdown any baculum that could be running
868 nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /silent /kill'
869 nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /silent /kill'
870 nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /silent /kill'
873 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd"
875 ; Remove bacula service
876 nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /silent /remove'
879 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd"
881 ; Remove bacula service
882 nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /silent /remove'
885 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir"
887 ; Remove bacula service
888 nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /silent /remove'
891 ; remove registry keys
892 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula"
893 DeleteRegKey HKLM "Software\Bacula"
895 ; remove start menu items
896 SetShellVarContext all
897 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
898 RMDir "$SMPROGRAMS\Bacula"
900 ; remove files and uninstaller (preserving config for now)
901 Delete /REBOOTOK "$INSTDIR\bin\*"
902 Delete /REBOOTOK "$INSTDIR\doc\*"
903 Delete /REBOOTOK "$INSTDIR\*"
905 ; Check for existing installation
906 MessageBox MB_YESNO|MB_ICONQUESTION \
907 "Would you like to delete the current configuration files and the working state file?" IDNO +7
908 Delete /REBOOTOK "$APPDATA\Bacula\*"
909 Delete /REBOOTOK "$APPDATA\Bacula\Work\*"
910 Delete /REBOOTOK "$APPDATA\Bacula\Spool\*"
911 RMDir "$APPDATA\Bacula\Work"
912 RMDir "$APPDATA\Bacula\Spool"
913 RMDir "$APPDATA\Bacula"
915 ; remove directories used
922 ; $0 - Service Name (ie Bacula-FD)
923 ; $1 - Service Description (ie Bacula File Daemon)
924 ; $2 - Install as Service
925 ; $3 - Start Service now
927 Function InstallDaemon
928 Call InstallCommonFiles
930 WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2
933 nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /silent /install -c "$APPDATA\Bacula\$0.conf"'
940 ; Start the service? (default skipped if silent, use /start to force starting)
944 nsExec::ExecToLog 'net start $0'
946 Exec '"$INSTDIR\bin\$0.exe" -c "$APPDATA\Bacula\$0.conf"'
950 CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\bin\$0.exe" '-c "$APPDATA\Bacula\$0.conf"' "$INSTDIR\bin\$0.exe" 0
954 Function GetComputerName
959 System::Call "kernel32::GetComputerNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2"
961 ${StrCase} $R0 $R0 "L"
968 !define ComputerNameDnsFullyQualified 3
976 System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
979 DetailPrint "GetComputerNameExA failed - LastError = $R2"
995 !define NameUserPrincipal 8
1003 System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1006 DetailPrint "GetUserNameExA failed - LastError = $R2"
1017 System::Call "advapi32::GetUserNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1020 DetailPrint "GetUserNameA failed - LastError = $R2"
1032 Function IsDirectorSelected
1034 SectionGetFlags ${SecDirectorDaemon} $R0
1035 IntOp $R0 $R0 & ${SF_SELECTED}
1039 Function GetSelectedComponents
1042 ${If} ${SectionIsSelected} ${SecFileDaemon}
1043 IntOp $R0 $R0 | ${ComponentFile}
1045 ${If} ${SectionIsSelected} ${SecStorageDaemon}
1046 IntOp $R0 $R0 | ${ComponentStorage}
1048 ${If} ${SectionIsSelected} ${SecDirectorDaemon}
1049 IntOp $R0 $R0 | ${ComponentDirector}
1051 ${If} ${SectionIsSelected} ${SecConsole}
1052 IntOp $R0 $R0 | ${ComponentTextConsole}
1054 ${If} ${SectionIsSelected} ${SecWxConsole}
1055 IntOp $R0 $R0 | ${ComponentGUIConsole}
1057 ${If} ${SectionIsSelected} ${SecDocPdf}
1058 IntOp $R0 $R0 | ${ComponentPDFDocs}
1060 ${If} ${SectionIsSelected} ${SecDocHtml}
1061 IntOp $R0 $R0 | ${ComponentHTMLDocs}
1066 Function PageComponentsShow
1068 Call DisableServerSections
1071 Call SelectPreviousComponents
1072 Call UpdateComponentUI
1075 Function PageDirectoryPre
1076 ${If} $AutomaticInstall = 1
1077 ${OrIf} $InstallType = ${UpgradeInstall}
1082 Function LeaveInstallPage
1083 Push "$INSTDIR\install.log"
1087 Function EnterWriteTemplates
1091 Call GetSelectedComponents
1094 IntOp $R0 $R0 & ${ComponentDirector}
1095 IntOp $R1 $NewComponents & ${ComponentsFileAndStorage}
1104 IntOp $R0 $NewComponents & ${ComponentFile}
1106 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 0
1107 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags DISABLED
1108 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State
1109 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
1111 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 1
1112 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags
1113 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State "C:\$ConfigClientName.conf"
1114 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
1117 IntOp $R0 $NewComponents & ${ComponentStorage}
1119 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 0
1120 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags DISABLED
1121 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State
1122 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
1124 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 1
1125 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags
1126 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State "C:\$ConfigStorageName.conf"
1127 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
1130 !InsertMacro MUI_HEADER_TEXT "$(TITLE_WriteTemplates)" "$(SUBTITLE_WriteTemplates)"
1131 !InsertMacro MUI_INSTALLOPTIONS_DISPLAY "WriteTemplates.ini"
1133 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 2" State
1135 File "/oname=$PLUGINSDIR\client.conf.in" "client.conf.in"
1137 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\client.conf.in"'
1138 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 3" State
1140 CopyFiles "$PLUGINSDIR\client.conf.in" "$R0"
1144 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 4" State
1146 File "/oname=$PLUGINSDIR\storage.conf.in" "storage.conf.in"
1148 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\storage.conf.in"'
1149 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 5" State
1151 CopyFiles "$PLUGINSDIR\storage.conf.in" "$R0"
1159 Function SelectPreviousComponents
1160 ${If} $InstallType <> ${NewInstall}
1161 IntOp $R1 $PreviousComponents & ${ComponentFile}
1163 !InsertMacro SelectSection ${SecFileDaemon}
1164 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_RO}
1166 !InsertMacro UnselectSection ${SecFileDaemon}
1167 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_RO}
1169 IntOp $R1 $PreviousComponents & ${ComponentStorage}
1171 !InsertMacro SelectSection ${SecStorageDaemon}
1172 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO}
1174 !InsertMacro UnselectSection ${SecStorageDaemon}
1175 !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_RO}
1177 IntOp $R1 $PreviousComponents & ${ComponentDirector}
1179 !InsertMacro SelectSection ${SecDirectorDaemon}
1180 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO}
1182 !InsertMacro UnselectSection ${SecDirectorDaemon}
1183 !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_RO}
1185 IntOp $R1 $PreviousComponents & ${ComponentTextConsole}
1187 !InsertMacro SelectSection ${SecConsole}
1188 !InsertMacro SetSectionFlag ${SecConsole} ${SF_RO}
1190 !InsertMacro UnselectSection ${SecConsole}
1191 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_RO}
1193 IntOp $R1 $PreviousComponents & ${ComponentGUIConsole}
1195 !InsertMacro SelectSection ${SecWxConsole}
1196 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_RO}
1198 !InsertMacro UnselectSection ${SecWxConsole}
1199 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_RO}
1201 IntOp $R1 $PreviousComponents & ${ComponentPDFDocs}
1203 !InsertMacro SelectSection ${SecDocPdf}
1204 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_RO}
1206 !InsertMacro UnselectSection ${SecDocPdf}
1207 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_RO}
1209 IntOp $R1 $PreviousComponents & ${ComponentHTMLDocs}
1211 !InsertMacro SelectSection ${SecDocHtml}
1212 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_RO}
1214 !InsertMacro UnselectSection ${SecDocHtml}
1215 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_RO}
1220 Function DisableServerSections
1221 !InsertMacro UnselectSection ${SecGroupServer}
1222 !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO}
1223 !InsertMacro UnselectSection ${SecStorageDaemon}
1224 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO}
1225 !InsertMacro UnselectSection ${SecDirectorDaemon}
1226 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO}
1229 Function UpdateComponentUI
1233 Call GetSelectedComponents
1236 IntOp $R1 $R0 ^ $PreviousComponents
1237 IntOp $NewComponents $R0 & $R1
1239 ${If} $InstallType <> ${NewInstall}
1240 IntOp $R1 $NewComponents & ${ComponentFile}
1242 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_BOLD}
1244 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_BOLD}
1246 IntOp $R1 $NewComponents & ${ComponentStorage}
1248 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD}
1250 !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD}
1252 IntOp $R1 $NewComponents & ${ComponentDirector}
1254 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD}
1256 !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_BOLD}
1258 IntOp $R1 $NewComponents & ${ComponentTextConsole}
1260 !InsertMacro SetSectionFlag ${SecConsole} ${SF_BOLD}
1262 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_BOLD}
1264 IntOp $R1 $NewComponents & ${ComponentGUIConsole}
1266 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_BOLD}
1268 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_BOLD}
1270 IntOp $R1 $NewComponents & ${ComponentPDFDocs}
1272 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD}
1274 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_BOLD}
1276 IntOp $R1 $NewComponents & ${ComponentHTMLDocs}
1278 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_BOLD}
1280 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_BOLD}
1284 GetDlgItem $R0 $HWNDPARENT 1
1286 IntOp $R1 $NewComponents & ${ComponentsRequiringUserConfig}
1288 SendMessage $R0 ${WM_SETTEXT} 0 "STR:Install"
1290 SendMessage $R0 ${WM_SETTEXT} 0 "STR:&Next >"
1297 !include "InstallType.nsh"
1298 !include "ConfigPage1.nsh"
1299 !include "ConfigPage2.nsh"
1300 !include "DumpLog.nsh"