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:
36 !define PRODUCT "Bacula"
39 ; Include the Modern UI
43 !include "LogicLib.nsh"
44 !include "FileFunc.nsh"
45 !include "Sections.nsh"
46 !include "StrFunc.nsh"
47 !include "WinMessages.nsh"
52 OutFile "${OUT_DIR}\winbacula-${VERSION}.exe"
54 InstallDir "$PROGRAMFILES\Bacula"
55 InstallDirRegKey HKLM "Software\Bacula" "InstallLocation"
61 !insertmacro GetParent
72 !define MUI_COMPONENTSPAGE_SMALLDESC
74 !define MUI_HEADERIMAGE
75 !define MUI_BGCOLOR 739AB9
76 !define MUI_HEADERIMAGE_BITMAP "bacula-logo.bmp"
78 !InsertMacro MUI_PAGE_WELCOME
79 ; !InsertMacro MUI_PAGE_LICENSE "..\..\LICENSE"
80 Page custom EnterInstallType
81 !define MUI_PAGE_CUSTOMFUNCTION_SHOW PageComponentsShow
82 !InsertMacro MUI_PAGE_COMPONENTS
83 !define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre
84 !InsertMacro MUI_PAGE_DIRECTORY
85 Page custom EnterConfigPage1 LeaveConfigPage1
86 Page custom EnterConfigPage2 LeaveConfigPage2
87 !Define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveInstallPage
88 !InsertMacro MUI_PAGE_INSTFILES
89 Page custom EnterWriteTemplates
90 !Define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt
91 !InsertMacro MUI_PAGE_FINISH
93 !InsertMacro MUI_UNPAGE_WELCOME
94 !InsertMacro MUI_UNPAGE_CONFIRM
95 !InsertMacro MUI_UNPAGE_INSTFILES
96 !InsertMacro MUI_UNPAGE_FINISH
98 !define MUI_ABORTWARNING
100 !InsertMacro MUI_LANGUAGE "English"
102 !InsertMacro GetParameters
103 !InsertMacro GetOptions
105 DirText "Setup will install Bacula ${VERSION} to the directory specified below. To install in a different folder, click Browse and select another folder."
107 !InsertMacro MUI_RESERVEFILE_INSTALLOPTIONS
123 Var ConfigClientMaxJobs
124 Var ConfigClientPassword
125 Var ConfigClientInstallService
126 Var ConfigClientStartService
128 Var ConfigStorageName
129 Var ConfigStoragePort
130 Var ConfigStorageMaxJobs
131 Var ConfigStoragePassword
132 Var ConfigStorageInstallService
133 Var ConfigStorageStartService
135 Var ConfigDirectorName
136 Var ConfigDirectorPort
137 Var ConfigDirectorMaxJobs
138 Var ConfigDirectorPassword
139 Var ConfigDirectorAddress
140 Var ConfigDirectorMailServer
141 Var ConfigDirectorMailAddress
143 Var ConfigDirectorInstallService
144 Var ConfigDirectorStartService
146 Var ConfigMonitorName
147 Var ConfigMonitorPassword
149 Var LocalDirectorPassword
155 Var PostgreSQLVersion
160 !define UpgradeInstall 1
161 !define MigrateInstall 2
164 Var PreviousComponents
167 ; Bit 0 = File Service
168 ; 1 = Storage Service
169 ; 2 = Director Service
170 ; 3 = Command Console
171 ; 4 = Graphical Console
172 ; 5 = Documentation (PDF)
173 ; 6 = Documentation (HTML)
175 !define ComponentFile 1
176 !define ComponentStorage 2
177 !define ComponentDirector 4
178 !define ComponentTextConsole 8
179 !define ComponentGUIConsole 16
180 !define ComponentPDFDocs 32
181 !define ComponentHTMLDocs 64
183 !define ComponentsRequiringUserConfig 31
184 !define ComponentsFileAndStorage 3
185 !define ComponentsFileAndStorageAndDirector 7
186 !define ComponentsDirectorAndTextGuiConsoles 28
187 !define ComponentsTextAndGuiConsoles 24
196 ; Process Command Line Options
200 StrCpy $CommonFilesDone 0
202 StrCpy $AutomaticInstall 0
203 StrCpy $InstallType ${NewInstall}
204 StrCpy $OldInstallDir ""
205 StrCpy $PreviousComponents 0
206 StrCpy $NewComponents 0
208 StrCpy $MySQLVersion ""
209 StrCpy $PostgreSQLPath ""
210 StrCpy $PostgreSQLVersion ""
215 ${GetOptions} $R0 "/noservice" $R1
220 ${GetOptions} $R0 "/nostart" $R1
227 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
236 Pop $LocalHostAddress
239 Pop $ConfigDirectorMailAddress
241 Call FindDatabaseApps
243 ; Configuration Defaults
245 StrCpy $ConfigClientName "$HostName-fd"
246 StrCpy $ConfigClientPort 9102
247 StrCpy $ConfigClientMaxJobs 2
248 ;StrCpy $ConfigClientPassword
249 StrCpy $ConfigClientInstallService "$OptService"
250 StrCpy $ConfigClientStartService "$OptStart"
252 StrCpy $ConfigStorageName "$HostName-sd"
253 StrCpy $ConfigStoragePort 9103
254 StrCpy $ConfigStorageMaxJobs 10
255 ;StrCpy $ConfigStoragePassword
256 StrCpy $ConfigStorageInstallService "$OptService"
257 StrCpy $ConfigStorageStartService "$OptStart"
259 ;StrCpy $ConfigDirectorName "$HostName-dir"
260 StrCpy $ConfigDirectorPort 9101
261 StrCpy $ConfigDirectorMaxJobs 1
262 ;StrCpy $ConfigDirectorPassword
263 StrCpy $ConfigDirectorDB 0
264 StrCpy $ConfigDirectorInstallService "$OptService"
265 StrCpy $ConfigDirectorStartService "$OptStart"
267 StrCpy $ConfigMonitorName "$HostName-mon"
268 ;StrCpy $ConfigMonitorPassword
271 File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe"
272 File "/oname=$PLUGINSDIR\libeay32.dll" "${SRC_DIR}\libeay32.dll"
273 File "/oname=$PLUGINSDIR\ssleay32.dll" "${SRC_DIR}\ssleay32.dll"
274 File "/oname=$PLUGINSDIR\sed.exe" "${SRC_DIR}\sed.exe"
276 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini"
277 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "WriteTemplates.ini"
279 SetPluginUnload alwaysoff
281 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
284 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
287 ${StrTrimNewLines} $ConfigClientPassword $R0
291 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
294 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
297 ${StrTrimNewLines} $ConfigStoragePassword $R0
301 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
304 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
307 ${StrTrimNewLines} $LocalDirectorPassword $R0
311 SetPluginUnload manual
313 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
316 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
319 ${StrTrimNewLines} $ConfigMonitorPassword $R0
327 Function .onSelChange
328 Call UpdateComponentUI
331 Function InstallCommonFiles
332 ${If} $CommonFilesDone = 0
333 SetOutPath "$INSTDIR"
336 SetOutPath "$INSTDIR\bin"
337 !if "${BUILD_TOOLS}" == "VC8"
338 File "${SRC_DIR}\msvcm80.dll"
339 File "${SRC_DIR}\msvcp80.dll"
340 File "${SRC_DIR}\msvcr80.dll"
341 File "${SRC_DIR}\Microsoft.VC80.CRT.manifest"
342 File "${SRC_DIR}\pthreadVCE.dll"
344 !if "${BUILD_TOOLS}" == "VC8_DEBUG"
345 File "${SRC_DIR}\msvcm80.dll"
346 File "${SRC_DIR}\msvcp80.dll"
347 File "${SRC_DIR}\msvcr80.dll"
348 File "${SRC_DIR}\Microsoft.VC80.CRT.manifest"
349 File "${SRC_DIR}\msvcm80d.dll"
350 File "${SRC_DIR}\msvcp80d.dll"
351 File "${SRC_DIR}\msvcr80d.dll"
352 File "${SRC_DIR}\Microsoft.VC80.DebugCRT.manifest"
353 File "${SRC_DIR}\pthreadVCE.dll"
355 !if "${BUILD_TOOLS}" == "MinGW"
356 File "${SRC_DIR}\mingwm10.dll"
357 File "${SRC_DIR}\pthreadGCE.dll"
359 File "${SRC_DIR}\libeay32.dll"
360 File "${SRC_DIR}\ssleay32.dll"
361 File "${SRC_DIR}\zlib1.dll"
362 !if "${BUILD_TOOLS}" == "VC8"
363 File "${SRC_DIR}\zlib1.dll.manifest"
365 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
366 File "${SRC_DIR}\zlib1.dll.manifest"
368 File "/oname=$INSTDIR\openssl.cnf" "${SRC_DIR}\openssl.cnf"
369 File "${SRC_DIR}\openssl.exe"
370 File "${SRC_DIR}\bsleep.exe"
371 File "${SRC_DIR}\bsmtp.exe"
372 File "${SRC_DIR}\bacula.dll"
373 File "${SRC_DIR}\expr64.exe"
374 File "${SRC_DIR}\snooze.exe"
376 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\View Readme.lnk" "write.exe" '"$INSTDIR\Readme.txt"'
378 StrCpy $CommonFilesDone 1
382 Section "-Initialize"
383 ${If} $MySQLPath != ""
384 DetailPrint "Found MySQL (version $MySQLVersion)"
386 ${If} $PostgreSQLPath != ""
387 DetailPrint "Found PostgreSQL (version $PostgreSQLVersion)"
390 WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR"
392 Call GetSelectedComponents
394 WriteRegDWORD HKLM Software\Bacula Components $R2
396 WriteRegDWORD HKLM Software\Bacula Database $ConfigDirectorDB
398 ; remove start menu items
399 SetShellVarContext all
401 Delete /REBOOTOK "$SMPROGRAMS\Bacula\Configuration\*"
402 Delete /REBOOTOK "$SMPROGRAMS\Bacula\Documentation\*"
403 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
404 RMDir "$SMPROGRAMS\Bacula\Configuration"
405 RMDir "$SMPROGRAMS\Bacula\Documentation"
406 RMDir "$SMPROGRAMS\Bacula"
407 CreateDirectory "$SMPROGRAMS\Bacula"
408 CreateDirectory "$SMPROGRAMS\Bacula\Configuration"
409 CreateDirectory "$SMPROGRAMS\Bacula\Documentation"
411 CreateDirectory "$INSTDIR"
412 CreateDirectory "$INSTDIR\bin"
413 CreateDirectory "$APPDATA\Bacula"
414 CreateDirectory "$APPDATA\Bacula\Work"
415 CreateDirectory "$APPDATA\Bacula\Spool"
417 File "..\..\..\LICENSE"
418 Delete /REBOOTOK "$INSTDIR\bin\License.txt"
420 FileOpen $R1 $PLUGINSDIR\config.sed w
421 FileWrite $R1 "s;@VERSION@;${VERSION};$\r$\n"
422 FileWrite $R1 "s;@DATE@;${__DATE__};$\r$\n"
423 FileWrite $R1 "s;@DISTNAME@;Windows;$\r$\n"
425 !If "$BUILD_TOOLS" == "MinGW"
435 FileWrite $R1 "s;@DISTVER@;$R2;$\r$\n"
437 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\"
438 FileWrite $R1 's;@working_dir@;$R2;$\r$\n'
439 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\"
440 FileWrite $R1 's;@working_dir_cmd@;$R2;$\r$\n'
442 ${StrRep} $R2 "$INSTDIR\bin" "\" "\\\\"
443 FileWrite $R1 's;@bin_dir@;$R2;$\r$\n'
444 ${StrRep} $R2 "$INSTDIR\bin" "\" "\\"
445 FileWrite $R1 's;@bin_dir_cmd@;$R2;$\r$\n'
447 ${StrRep} $R2 "$INSTDIR" "\" "/"
448 FileWrite $R1 "s;@BUILD_DIR@;$R2;$\r$\n"
450 Call IsDirectorSelected
453 FileWrite $R1 "s;@director_address@;$LocalHostAddress;$\r$\n"
455 ${If} "$ConfigDirectorAddress" != ""
456 FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;$\r$\n"
460 FileWrite $R1 "s;@client_address@;$LocalHostAddress;$\r$\n"
461 FileWrite $R1 "s;@storage_address@;$LocalHostAddress;$\r$\n"
463 ${If} "$ConfigClientName" != ""
464 FileWrite $R1 "s;@client_name@;$ConfigClientName;$\r$\n"
466 ${If} "$ConfigClientPort" != ""
467 FileWrite $R1 "s;@client_port@;$ConfigClientPort;$\r$\n"
469 ${If} "$ConfigClientMaxJobs" != ""
470 FileWrite $R1 "s;@client_maxjobs@;$ConfigClientMaxJobs;$\r$\n"
472 ${If} "$ConfigClientPassword" != ""
473 FileWrite $R1 "s;@client_password@;$ConfigClientPassword;$\r$\n"
475 ${If} "$ConfigStorageName" != ""
476 FileWrite $R1 "s;@storage_name@;$ConfigStorageName;$\r$\n"
478 ${If} "$ConfigStoragePort" != ""
479 FileWrite $R1 "s;@storage_port@;$ConfigStoragePort;$\r$\n"
481 ${If} "$ConfigStorageMaxJobs" != ""
482 FileWrite $R1 "s;@storage_maxjobs@;$ConfigStorageMaxJobs;$\r$\n"
484 ${If} "$ConfigStoragePassword" != ""
485 FileWrite $R1 "s;@storage_password@;$ConfigStoragePassword;$\r$\n"
487 ${If} "$ConfigDirectorName" != ""
488 FileWrite $R1 "s;@director_name@;$ConfigDirectorName;$\r$\n"
490 ${If} "$ConfigDirectorPort" != ""
491 FileWrite $R1 "s;@director_port@;$ConfigDirectorPort;$\r$\n"
493 ${If} "$ConfigDirectorMaxJobs" != ""
494 FileWrite $R1 "s;@director_maxjobs@;$ConfigDirectorMaxJobs;$\r$\n"
496 ${If} "$ConfigDirectorPassword" != ""
497 FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;$\r$\n"
499 ${If} "$ConfigDirectorMailServer" != ""
500 FileWrite $R1 "s;@smtp_host@;$ConfigDirectorMailServer;$\r$\n"
502 ${If} "$ConfigDirectorMailAddress" != ""
503 FileWrite $R1 "s;@job_email@;$ConfigDirectorMailAddress;$\r$\n"
505 ${If} "$ConfigMonitorName" != ""
506 FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;$\r$\n"
508 ${If} "$ConfigMonitorPassword" != ""
509 FileWrite $R1 "s;@monitor_password@;$ConfigMonitorPassword;$\r$\n"
512 ${If} $ConfigDirectorDB = 1
513 ${If} $MySQLPath != ""
514 ${StrRep} $R2 "$MySQLPath\bin" "\" "\\"
515 FileWrite $R1 "s;@SQL_BINDIR@;$R2;$\r$\n"
517 ${ElseIf} $ConfigDirectorDB = 2
518 ${If} $PostgreSQLPath != ""
519 ${StrRep} $R2 "$PostgreSQLPath\bin" "\" "\\"
520 FileWrite $R1 "s;@SQL_BINDIR@;$R2;$\r$\n"
526 ${If} $InstallType = ${MigrateInstall}
527 FileOpen $R1 $PLUGINSDIR\migrate.sed w
528 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\"
529 FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n'
530 FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n'
534 ${If} ${FileExists} "$OldInstallDir\bin\bacula-fd.exe"
535 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /kill' ; Shutdown any bacula that could be running
537 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /remove' ; Remove existing service
540 ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe"
541 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /kill' ; Shutdown any bacula that could be running
543 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /remove' ; Remove existing service
546 ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe"
547 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /kill' ; Shutdown any bacula that could be running
549 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /remove' ; Remove existing service
554 SectionGroup "Client" SecGroupClient
556 Section "File Service" SecFileDaemon
559 SetOutPath "$INSTDIR\bin"
561 File "${SRC_DIR}\bacula-fd.exe"
563 ${If} $InstallType = ${MigrateInstall}
564 ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf"
565 CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula"
566 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"'
568 File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in"
570 StrCpy $0 "$APPDATA\Bacula"
571 StrCpy $1 bacula-fd.conf
572 Call ConfigEditAndCopy
576 StrCpy $1 "File Service"
577 StrCpy $2 $ConfigClientInstallService
578 StrCpy $3 $ConfigClientStartService
582 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Client Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-fd.conf"'
587 SectionGroup "Server" SecGroupServer
589 Section "Storage Service" SecStorageDaemon
592 SetOutPath "$INSTDIR\bin"
594 File "${SRC_DIR}\loaderinfo.exe"
595 File "${SRC_DIR}\mt.exe"
596 File "${SRC_DIR}\mtx.exe"
597 File "${SRC_DIR}\scsitape.exe"
598 File "${SRC_DIR}\tapeinfo.exe"
599 File "${SRC_DIR}\bacula-sd.exe"
600 File "${SRC_DIR}\bcopy.exe"
601 File "${SRC_DIR}\bextract.exe"
602 File "${SRC_DIR}\bls.exe"
603 File "${SRC_DIR}\bscan.exe"
604 File "${SRC_DIR}\btape.exe"
605 File "${SRC_DIR}\scsilist.exe"
606 File "${SRC_DIR}\mkisofs.exe"
607 File "${SRC_DIR}\growisofs.exe"
608 File "${SRC_DIR}\dvd-ram-control.exe"
609 File "${SRC_DIR}\dvd+rw-booktype.exe"
610 File "${SRC_DIR}\dvd+rw-format.exe"
611 File "${SRC_DIR}\dvd+rw-mediainfo.exe"
613 File "/oname=$PLUGINSDIR\mtx-changer.cmd" "${SRC_DIR}\mtx-changer.cmd"
615 StrCpy $0 "$INSTDIR\bin"
616 StrCpy $1 mtx-changer.cmd
617 Call ConfigEditAndCopy
619 File "/oname=$PLUGINSDIR\disk-changer.cmd" "${SRC_DIR}\disk-changer.cmd"
621 StrCpy $0 "$INSTDIR\bin"
622 StrCpy $1 disk-changer.cmd
623 Call ConfigEditAndCopy
625 File "/oname=$PLUGINSDIR\dvd-handler.cmd" "${SRC_DIR}\dvd-handler.cmd"
627 StrCpy $0 "$INSTDIR\bin"
628 StrCpy $1 dvd-handler.cmd
629 Call ConfigEditAndCopy
631 File "/oname=$PLUGINSDIR\bacula-sd.conf" "bacula-sd.conf.in"
633 StrCpy $0 "$APPDATA\Bacula"
634 StrCpy $1 bacula-sd.conf
635 Call ConfigEditAndCopy
638 StrCpy $1 "Storage Service"
639 StrCpy $2 $ConfigStorageInstallService
640 StrCpy $3 $ConfigStorageStartService
643 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause"
644 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"'
647 Section "Director Service" SecDirectorDaemon
650 SetOutPath "$INSTDIR\bin"
652 ${If} $ConfigDirectorDB = 1
653 File /oname=bacula_cats.dll "${SRC_DIR}\cats_mysql.dll"
654 File "${SRC_DIR}\libmysql.dll"
655 File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_mysql_database.cmd
656 File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_mysql_database.cmd
657 File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_mysql_tables.cmd
658 File ${SRC_DIR}\make_mysql_tables.sql
659 File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_mysql_tables.cmd
660 File ${SRC_DIR}\drop_mysql_tables.sql
661 File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_mysql_privileges.cmd
662 File ${SRC_DIR}\grant_mysql_privileges.sql
663 File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_mysql_catalog_backup.cmd
664 ${ElseIf} $ConfigDirectorDB = 2
665 File /oname=bacula_cats.dll "${SRC_DIR}\cats_postgresql.dll"
666 File "${SRC_DIR}\libpq.dll"
667 !if "${BUILD_TOOLS}" == "VC8"
668 File "${SRC_DIR}\comerr32.dll"
669 File "${SRC_DIR}\libintl-2.dll"
670 File "${SRC_DIR}\libiconv-2.dll"
671 File "${SRC_DIR}\krb5_32.dll"
673 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
674 File "${SRC_DIR}\comerr32.dll"
675 File "${SRC_DIR}\libintl-2.dll"
676 File "${SRC_DIR}\libiconv-2.dll"
677 File "${SRC_DIR}\krb5_32.dll"
679 File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_postgresql_database.cmd
680 File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_postgresql_database.cmd
681 File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_postgresql_tables.cmd
682 File ${SRC_DIR}\make_postgresql_tables.sql
683 File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_postgresql_tables.cmd
684 File ${SRC_DIR}\drop_postgresql_tables.sql
685 File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_postgresql_privileges.cmd
686 File ${SRC_DIR}\grant_postgresql_privileges.sql
687 File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_postgresql_catalog_backup.cmd
688 ${ElseIf} $ConfigDirectorDB = 3
689 File "${SRC_DIR}\sqlite3.exe"
690 !if "${BUILD_TOOLS}" == "VC8"
691 File "${SRC_DIR}\sqlite3.exe.manifest"
693 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
694 File "${SRC_DIR}\sqlite3.exe.manifest"
696 File /oname=bacula_cats.dll "${SRC_DIR}\cats_sqlite3.dll"
697 File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_sqlite3_database.cmd
698 File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_sqlite3_database.cmd
699 File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_sqlite3_tables.cmd
700 File ${SRC_DIR}\make_sqlite3_tables.sql
701 File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_sqlite3_tables.cmd
702 File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_sqlite3_privileges.cmd
703 File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_sqlite3_catalog_backup.cmd
706 File "${SRC_DIR}\bacula-dir.exe"
707 File "${SRC_DIR}\dbcheck.exe"
709 File "/oname=$PLUGINSDIR\delete_catalog_backup.cmd" "${SRC_DIR}\delete_catalog_backup.cmd"
711 StrCpy $0 "$INSTDIR\bin"
713 StrCpy $1 create_database.cmd
714 Call ConfigEditAndCopy
716 StrCpy $1 drop_database.cmd
717 Call ConfigEditAndCopy
719 StrCpy $1 make_tables.cmd
720 Call ConfigEditAndCopy
722 StrCpy $1 drop_tables.cmd
723 Call ConfigEditAndCopy
725 StrCpy $1 grant_privileges.cmd
726 Call ConfigEditAndCopy
728 StrCpy $1 make_catalog_backup.cmd
729 Call ConfigEditAndCopy
731 StrCpy $1 delete_catalog_backup.cmd
732 Call ConfigEditAndCopy
734 File "${SRC_DIR}\query.sql"
736 File "/oname=$PLUGINSDIR\bacula-dir.conf" "bacula-dir.conf.in"
738 StrCpy $0 "$APPDATA\Bacula"
739 StrCpy $1 bacula-dir.conf
740 Call ConfigEditAndCopy
743 StrCpy $1 "Director Service"
744 StrCpy $2 $ConfigDirectorInstallService
745 StrCpy $3 $ConfigDirectorStartService
748 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Director Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-dir.conf"'
753 SectionGroup "Consoles" SecGroupConsoles
755 Section "Command Console" SecConsole
758 SetOutPath "$INSTDIR\bin"
760 File "${SRC_DIR}\bconsole.exe"
761 Call InstallCommonFiles
763 ${If} $InstallType = ${MigrateInstall}
764 ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf"
765 CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula"
767 File "/oname=$PLUGINSDIR\bconsole.conf" "bconsole.conf.in"
768 StrCpy $0 "$APPDATA\Bacula"
769 StrCpy $1 bconsole.conf
770 Call ConfigEditAndCopy
773 CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0
774 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"'
778 Section "Graphical Console" SecWxConsole
781 SetOutPath "$INSTDIR\bin"
783 Call InstallCommonFiles
784 !if "${BUILD_TOOLS}" == "VC8"
785 File "${SRC_DIR}\wxbase270_vc_bacula.dll"
786 File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll"
788 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
789 File "${SRC_DIR}\wxbase270_vc_bacula.dll"
790 File "${SRC_DIR}\wxmsw270_core_vc_bacula.dll"
792 !if "${BUILD_TOOLS}" == "MinGW"
793 File "${SRC_DIR}\wxbase270_gcc_bacula.dll"
794 File "${SRC_DIR}\wxmsw270_core_gcc_bacula.dll"
797 File "${SRC_DIR}\wx-console.exe"
799 ${If} $InstallType = ${MigrateInstall}
800 ${AndIf} ${FileExists} "$OldInstallDir\bin\wx-console.conf"
801 CopyFiles "$OldInstallDir\bin\wx-console.conf" "$APPDATA\Bacula"
803 File "/oname=$PLUGINSDIR\wx-console.conf" "wx-console.conf.in"
804 StrCpy $0 "$APPDATA\Bacula"
805 StrCpy $1 wx-console.conf
806 Call ConfigEditAndCopy
809 ; Create Start Menu entry
810 CreateShortCut "$SMPROGRAMS\Bacula\wx-console.lnk" "$INSTDIR\bin\wx-console.exe" '-c "$APPDATA\Bacula\wx-console.conf"' "$INSTDIR\bin\wx-console.exe" 0
811 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\wx-console.conf"'
816 SectionGroup "Documentation" SecGroupDocumentation
818 Section "Documentation (Acrobat Format)" SecDocPdf
821 SetOutPath "$INSTDIR\doc"
822 CreateDirectory "$INSTDIR\doc"
824 File "${SRC_DIR}\manual\bacula.pdf"
825 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"'
828 Section "Documentation (HTML Format)" SecDocHtml
831 SetOutPath "$INSTDIR\doc"
832 CreateDirectory "$INSTDIR\doc"
834 File "${SRC_DIR}\manual\bacula\*.html"
835 File "${SRC_DIR}\manual\bacula\*.png"
836 File "${SRC_DIR}\manual\bacula\*.css"
837 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual (HTML).lnk" '"$INSTDIR\doc\bacula.html"'
846 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$INSTDIR" /T /G SYSTEM:F Administrators:F'
847 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$APPDATA\Bacula" /T /G SYSTEM:F Administrators:F'
850 ; Write the uninstall keys for Windows & create Start Menu entry
851 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula"
852 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "InstallLocation" "$INSTDIR"
853 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayVersion" "${VERSION}"
854 ${StrTok} $R0 "${VERSION}" "." 0 0
855 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMajor" $R0
856 ${StrTok} $R0 "${VERSION}" "." 1 0
857 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMinor" $R0
858 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoModify" 1
859 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoRepair" 1
860 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLUpdateInfo" "http://sourceforge.net/project/showfiles.php?group_id=50727"
861 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org"
862 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support"
863 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"'
864 WriteUninstaller "$INSTDIR\Uninstall.exe"
865 CreateShortCut "$SMPROGRAMS\Bacula\Uninstall Bacula.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
869 ; Extra Page descriptions
871 LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system."
872 LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system."
873 LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director Daemon on this system."
874 LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system."
875 LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install graphical console program on this system."
876 LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system."
877 LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system."
879 LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration"
880 LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration."
882 LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)"
883 LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration."
885 LangString TITLE_InstallType ${LANG_ENGLISH} "Installation Type"
886 LangString SUBTITLE_InstallType ${LANG_ENGLISH} "Choose installation type."
888 LangString TITLE_WriteTemplates ${LANG_ENGLISH} "Create Templates"
889 LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create resource templates for inclusion in the Director's configuration file."
891 !InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN
892 !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon)
893 !InsertMacro MUI_DESCRIPTION_TEXT ${SecStorageDaemon} $(DESC_SecStorageDaemon)
894 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon)
895 !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole)
896 !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole)
897 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf)
898 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml)
899 !InsertMacro MUI_FUNCTION_DESCRIPTION_END
903 UninstallText "This will uninstall Bacula. Hit next to continue."
906 ; Shutdown any baculum that could be running
907 nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /kill'
908 nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /kill'
909 nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill'
912 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd"
914 ; Remove bacula service
915 nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /remove'
918 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd"
920 ; Remove bacula service
921 nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /remove'
924 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir"
926 ; Remove bacula service
927 nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /remove'
930 ; remove registry keys
931 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula"
932 DeleteRegKey HKLM "Software\Bacula"
934 ; remove start menu items
935 SetShellVarContext all
936 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
937 RMDir "$SMPROGRAMS\Bacula"
939 ; remove files and uninstaller (preserving config for now)
940 Delete /REBOOTOK "$INSTDIR\bin\*"
941 Delete /REBOOTOK "$INSTDIR\doc\*"
942 Delete /REBOOTOK "$INSTDIR\*"
944 ; Check for existing installation
945 MessageBox MB_YESNO|MB_ICONQUESTION \
946 "Would you like to delete the current configuration files and the working state file?" IDNO +7
947 Delete /REBOOTOK "$APPDATA\Bacula\*"
948 Delete /REBOOTOK "$APPDATA\Bacula\Work\*"
949 Delete /REBOOTOK "$APPDATA\Bacula\Spool\*"
950 RMDir "$APPDATA\Bacula\Work"
951 RMDir "$APPDATA\Bacula\Spool"
952 RMDir "$APPDATA\Bacula"
954 ; remove directories used
961 ; $0 - Service Name (ie Bacula-FD)
962 ; $1 - Service Description (ie Bacula File Daemon)
963 ; $2 - Install as Service
964 ; $3 - Start Service now
966 Function InstallDaemon
967 Call InstallCommonFiles
969 WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2
972 nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /install -c "$APPDATA\Bacula\$0.conf"'
983 nsExec::ExecToLog 'net start $0'
985 Exec '"$INSTDIR\bin\$0.exe" -c "$APPDATA\Bacula\$0.conf"'
989 CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\bin\$0.exe" '-c "$APPDATA\Bacula\$0.conf"' "$INSTDIR\bin\$0.exe" 0
993 Function GetComputerName
998 System::Call "kernel32::GetComputerNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2"
1000 ${StrCase} $R0 $R0 "L"
1007 !define ComputerNameDnsFullyQualified 3
1009 Function GetHostName
1015 System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1018 DetailPrint "GetComputerNameExA failed - LastError = $R2"
1019 Call GetComputerName
1025 Call GetComputerName
1034 !define NameUserPrincipal 8
1036 Function GetUserName
1042 System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1045 DetailPrint "GetUserNameExA failed - LastError = $R2"
1056 System::Call "advapi32::GetUserNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1059 DetailPrint "GetUserNameA failed - LastError = $R2"
1071 Function ConfigEditAndCopy
1074 ${If} ${FileExists} "$0\$1"
1080 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\$1"'
1081 CopyFiles "$PLUGINSDIR\$1" "$0\$1$R1"
1086 Function FindDatabaseApps
1089 ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Location"
1092 Call RemoveTrailingSlash
1093 StrCpy $MySQLPath $0
1094 ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Version"
1095 StrCpy $MySQLVersion $0
1098 EnumRegKey $R1 HKLM "Software\PostgreSQL\Installations" 0
1100 ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Base Directory"
1101 Call RemoveTrailingSlash
1102 StrCpy $PostgreSQLPath $0
1103 ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Version"
1104 StrCpy $PostgreSQLVersion $0
1110 Function RemoveTrailingSlash
1119 Function IsDirectorSelected
1121 SectionGetFlags ${SecDirectorDaemon} $R0
1122 IntOp $R0 $R0 & ${SF_SELECTED}
1126 Function GetSelectedComponents
1129 ${If} ${SectionIsSelected} ${SecFileDaemon}
1130 IntOp $R0 $R0 | ${ComponentFile}
1132 ${If} ${SectionIsSelected} ${SecStorageDaemon}
1133 IntOp $R0 $R0 | ${ComponentStorage}
1135 ${If} ${SectionIsSelected} ${SecDirectorDaemon}
1136 IntOp $R0 $R0 | ${ComponentDirector}
1138 ${If} ${SectionIsSelected} ${SecConsole}
1139 IntOp $R0 $R0 | ${ComponentTextConsole}
1141 ${If} ${SectionIsSelected} ${SecWxConsole}
1142 IntOp $R0 $R0 | ${ComponentGUIConsole}
1144 ${If} ${SectionIsSelected} ${SecDocPdf}
1145 IntOp $R0 $R0 | ${ComponentPDFDocs}
1147 ${If} ${SectionIsSelected} ${SecDocHtml}
1148 IntOp $R0 $R0 | ${ComponentHTMLDocs}
1153 Function PageComponentsShow
1155 Call DisableServerSections
1158 Call SelectPreviousComponents
1159 Call UpdateComponentUI
1162 Function PageDirectoryPre
1163 ${If} $AutomaticInstall = 1
1164 ${OrIf} $InstallType = ${UpgradeInstall}
1169 Function LeaveInstallPage
1170 Push "$INSTDIR\install.log"
1174 Function EnterWriteTemplates
1178 Call GetSelectedComponents
1181 IntOp $R0 $R0 & ${ComponentDirector}
1182 IntOp $R1 $NewComponents & ${ComponentsFileAndStorage}
1191 IntOp $R0 $NewComponents & ${ComponentFile}
1193 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 0
1194 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags DISABLED
1195 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State
1196 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
1198 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 1
1199 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags
1200 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State "C:\$ConfigClientName.conf"
1201 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
1204 IntOp $R0 $NewComponents & ${ComponentStorage}
1206 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 0
1207 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags DISABLED
1208 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State
1209 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
1211 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 1
1212 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags
1213 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State "C:\$ConfigStorageName.conf"
1214 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
1217 !InsertMacro MUI_HEADER_TEXT "$(TITLE_WriteTemplates)" "$(SUBTITLE_WriteTemplates)"
1218 !InsertMacro MUI_INSTALLOPTIONS_DISPLAY "WriteTemplates.ini"
1220 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 2" State
1222 File "/oname=$PLUGINSDIR\client.conf.in" "client.conf.in"
1224 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\client.conf.in"'
1225 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 3" State
1227 CopyFiles "$PLUGINSDIR\client.conf.in" "$R0"
1231 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 4" State
1233 File "/oname=$PLUGINSDIR\storage.conf.in" "storage.conf.in"
1235 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\storage.conf.in"'
1236 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 5" State
1238 CopyFiles "$PLUGINSDIR\storage.conf.in" "$R0"
1246 Function SelectPreviousComponents
1247 ${If} $InstallType <> ${NewInstall}
1248 IntOp $R1 $PreviousComponents & ${ComponentFile}
1250 !InsertMacro SelectSection ${SecFileDaemon}
1251 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_RO}
1253 !InsertMacro UnselectSection ${SecFileDaemon}
1254 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_RO}
1256 IntOp $R1 $PreviousComponents & ${ComponentStorage}
1258 !InsertMacro SelectSection ${SecStorageDaemon}
1259 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO}
1261 !InsertMacro UnselectSection ${SecStorageDaemon}
1262 !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_RO}
1264 IntOp $R1 $PreviousComponents & ${ComponentDirector}
1266 !InsertMacro SelectSection ${SecDirectorDaemon}
1267 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO}
1269 !InsertMacro UnselectSection ${SecDirectorDaemon}
1270 !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_RO}
1272 IntOp $R1 $PreviousComponents & ${ComponentTextConsole}
1274 !InsertMacro SelectSection ${SecConsole}
1275 !InsertMacro SetSectionFlag ${SecConsole} ${SF_RO}
1277 !InsertMacro UnselectSection ${SecConsole}
1278 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_RO}
1280 IntOp $R1 $PreviousComponents & ${ComponentGUIConsole}
1282 !InsertMacro SelectSection ${SecWxConsole}
1283 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_RO}
1285 !InsertMacro UnselectSection ${SecWxConsole}
1286 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_RO}
1288 IntOp $R1 $PreviousComponents & ${ComponentPDFDocs}
1290 !InsertMacro SelectSection ${SecDocPdf}
1291 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_RO}
1293 !InsertMacro UnselectSection ${SecDocPdf}
1294 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_RO}
1296 IntOp $R1 $PreviousComponents & ${ComponentHTMLDocs}
1298 !InsertMacro SelectSection ${SecDocHtml}
1299 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_RO}
1301 !InsertMacro UnselectSection ${SecDocHtml}
1302 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_RO}
1307 Function DisableServerSections
1308 !InsertMacro UnselectSection ${SecGroupServer}
1309 !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO}
1310 !InsertMacro UnselectSection ${SecStorageDaemon}
1311 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO}
1312 !InsertMacro UnselectSection ${SecDirectorDaemon}
1313 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO}
1316 Function UpdateComponentUI
1320 Call GetSelectedComponents
1323 IntOp $R1 $R0 ^ $PreviousComponents
1324 IntOp $NewComponents $R0 & $R1
1326 ${If} $InstallType <> ${NewInstall}
1327 IntOp $R1 $NewComponents & ${ComponentFile}
1329 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_BOLD}
1331 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_BOLD}
1333 IntOp $R1 $NewComponents & ${ComponentStorage}
1335 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD}
1337 !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD}
1339 IntOp $R1 $NewComponents & ${ComponentDirector}
1341 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD}
1343 !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_BOLD}
1345 IntOp $R1 $NewComponents & ${ComponentTextConsole}
1347 !InsertMacro SetSectionFlag ${SecConsole} ${SF_BOLD}
1349 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_BOLD}
1351 IntOp $R1 $NewComponents & ${ComponentGUIConsole}
1353 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_BOLD}
1355 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_BOLD}
1357 IntOp $R1 $NewComponents & ${ComponentPDFDocs}
1359 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD}
1361 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_BOLD}
1363 IntOp $R1 $NewComponents & ${ComponentHTMLDocs}
1365 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_BOLD}
1367 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_BOLD}
1371 GetDlgItem $R0 $HWNDPARENT 1
1373 IntOp $R1 $NewComponents & ${ComponentsRequiringUserConfig}
1375 SendMessage $R0 ${WM_SETTEXT} 0 "STR:Install"
1377 SendMessage $R0 ${WM_SETTEXT} 0 "STR:&Next >"
1384 !include "InstallType.nsh"
1385 !include "ConfigPage1.nsh"
1386 !include "ConfigPage2.nsh"
1387 !include "DumpLog.nsh"