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 bwx-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 ; Added server installs and implemented Microsoft install locations
27 ; Added Bacula-SD and Bacula-DIR
28 ; Replaced ParameterGiven with standard GetOptions
30 ; Command line options:
35 ; netsh firewall add portopening protocol=tcp port=9102 name="Bacula-FD"
38 !define PRODUCT "Bacula"
41 ; Include the Modern UI
45 !include "LogicLib.nsh"
46 !include "FileFunc.nsh"
47 !include "Sections.nsh"
48 !include "StrFunc.nsh"
49 !include "WinMessages.nsh"
54 OutFile "${OUT_DIR}\winbacula-${VERSION}.exe"
56 InstallDir "$PROGRAMFILES\Bacula"
57 InstallDirRegKey HKLM "Software\Bacula" "InstallLocation"
63 !insertmacro GetParent
74 !define MUI_COMPONENTSPAGE_SMALLDESC
76 !define MUI_HEADERIMAGE
77 !define MUI_BGCOLOR 739AB9
78 !define MUI_HEADERIMAGE_BITMAP "bacula-logo.bmp"
80 !InsertMacro MUI_PAGE_WELCOME
81 !InsertMacro MUI_PAGE_LICENSE "..\..\..\LICENSE"
82 Page custom EnterInstallType
83 !define MUI_PAGE_CUSTOMFUNCTION_SHOW PageComponentsShow
84 !InsertMacro MUI_PAGE_COMPONENTS
85 !define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre
86 !InsertMacro MUI_PAGE_DIRECTORY
87 Page custom EnterConfigPage1 LeaveConfigPage1
88 Page custom EnterConfigPage2 LeaveConfigPage2
89 !Define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveInstallPage
90 !InsertMacro MUI_PAGE_INSTFILES
91 Page custom EnterWriteTemplates
92 !Define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt
93 !InsertMacro MUI_PAGE_FINISH
95 !InsertMacro MUI_UNPAGE_WELCOME
96 !InsertMacro MUI_UNPAGE_CONFIRM
97 !InsertMacro MUI_UNPAGE_INSTFILES
98 !InsertMacro MUI_UNPAGE_FINISH
100 !define MUI_ABORTWARNING
102 !InsertMacro MUI_LANGUAGE "English"
104 !InsertMacro GetParameters
105 !InsertMacro GetOptions
107 DirText "Setup will install Bacula ${VERSION} to the directory specified below. To install in a different folder, click Browse and select another folder."
109 !InsertMacro MUI_RESERVEFILE_INSTALLOPTIONS
125 Var ConfigClientMaxJobs
126 Var ConfigClientPassword
127 Var ConfigClientInstallService
128 Var ConfigClientStartService
130 Var ConfigStorageName
131 Var ConfigStoragePort
132 Var ConfigStorageMaxJobs
133 Var ConfigStoragePassword
134 Var ConfigStorageInstallService
135 Var ConfigStorageStartService
137 Var ConfigDirectorName
138 Var ConfigDirectorPort
139 Var ConfigDirectorMaxJobs
140 Var ConfigDirectorPassword
141 Var ConfigDirectorAddress
142 Var ConfigDirectorMailServer
143 Var ConfigDirectorMailAddress
145 Var ConfigDirectorInstallService
146 Var ConfigDirectorStartService
148 Var ConfigMonitorName
149 Var ConfigMonitorPassword
151 Var LocalDirectorPassword
157 Var PostgreSQLVersion
162 !define UpgradeInstall 1
163 !define MigrateInstall 2
166 Var PreviousComponents
169 ; Bit 0 = File Service
170 ; 1 = Storage Service
171 ; 2 = Director Service
172 ; 3 = Command Console
174 ; 5 = wxWidgets Console
175 ; 7 = Documentation (PDF)
176 ; 7 = Documentation (HTML)
178 !define ComponentFile 1
179 !define ComponentStorage 2
180 !define ComponentDirector 4
181 !define ComponentTextConsole 8
182 !define ComponentBatConsole 16
183 !define ComponentGUIConsole 32
184 !define ComponentPDFDocs 64
185 !define ComponentHTMLDocs 128
187 !define ComponentsRequiringUserConfig 63
188 !define ComponentsFileAndStorage 3
189 !define ComponentsFileAndStorageAndDirector 7
190 !define ComponentsDirectorAndTextGuiConsoles 60
191 !define ComponentsTextAndGuiConsoles 56
200 ; Process Command Line Options
204 StrCpy $CommonFilesDone 0
206 StrCpy $AutomaticInstall 0
207 StrCpy $InstallType ${NewInstall}
208 StrCpy $OldInstallDir ""
209 StrCpy $PreviousComponents 0
210 StrCpy $NewComponents 0
212 StrCpy $MySQLVersion ""
213 StrCpy $PostgreSQLPath ""
214 StrCpy $PostgreSQLVersion ""
219 ${GetOptions} $R0 "/noservice" $R1
224 ${GetOptions} $R0 "/nostart" $R1
231 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
240 Pop $LocalHostAddress
243 Pop $ConfigDirectorMailAddress
245 Call FindDatabaseApps
247 ; Configuration Defaults
249 StrCpy $ConfigClientName "$HostName-fd"
250 StrCpy $ConfigClientPort 9102
251 StrCpy $ConfigClientMaxJobs 5
252 ;StrCpy $ConfigClientPassword
253 StrCpy $ConfigClientInstallService "$OptService"
254 StrCpy $ConfigClientStartService "$OptStart"
256 StrCpy $ConfigStorageName "$HostName-sd"
257 StrCpy $ConfigStoragePort 9103
258 StrCpy $ConfigStorageMaxJobs 10
259 ;StrCpy $ConfigStoragePassword
260 StrCpy $ConfigStorageInstallService "$OptService"
261 StrCpy $ConfigStorageStartService "$OptStart"
263 ;StrCpy $ConfigDirectorName "$HostName-dir"
264 StrCpy $ConfigDirectorPort 9101
265 StrCpy $ConfigDirectorMaxJobs 1
266 ;StrCpy $ConfigDirectorPassword
267 StrCpy $ConfigDirectorDB 0
268 StrCpy $ConfigDirectorInstallService "$OptService"
269 StrCpy $ConfigDirectorStartService "$OptStart"
271 StrCpy $ConfigMonitorName "$HostName-mon"
272 ;StrCpy $ConfigMonitorPassword
275 File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe"
276 File "/oname=$PLUGINSDIR\libeay32.dll" "${SRC_DIR}\libeay32.dll"
277 File "/oname=$PLUGINSDIR\ssleay32.dll" "${SRC_DIR}\ssleay32.dll"
278 File "/oname=$PLUGINSDIR\sed.exe" "${SRC_DIR}\sed.exe"
280 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini"
281 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "WriteTemplates.ini"
283 SetPluginUnload alwaysoff
285 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
288 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
291 ${StrTrimNewLines} $ConfigClientPassword $R0
295 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
298 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
301 ${StrTrimNewLines} $ConfigStoragePassword $R0
305 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
308 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
311 ${StrTrimNewLines} $LocalDirectorPassword $R0
315 SetPluginUnload manual
317 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
320 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
323 ${StrTrimNewLines} $ConfigMonitorPassword $R0
331 Function .onSelChange
332 Call UpdateComponentUI
335 Function InstallCommonFiles
336 ${If} $CommonFilesDone = 0
337 SetOutPath "$INSTDIR"
340 SetOutPath "$INSTDIR\bin"
341 !if "${BUILD_TOOLS}" == "VC8"
342 File "${SRC_DIR}\msvcm80.dll"
343 File "${SRC_DIR}\msvcp80.dll"
344 File "${SRC_DIR}\msvcr80.dll"
345 File "${SRC_DIR}\Microsoft.VC80.CRT.manifest"
346 File "${SRC_DIR}\pthreadVCE.dll"
348 !if "${BUILD_TOOLS}" == "VC8_DEBUG"
349 File "${SRC_DIR}\msvcm80.dll"
350 File "${SRC_DIR}\msvcp80.dll"
351 File "${SRC_DIR}\msvcr80.dll"
352 File "${SRC_DIR}\Microsoft.VC80.CRT.manifest"
353 File "${SRC_DIR}\msvcm80d.dll"
354 File "${SRC_DIR}\msvcp80d.dll"
355 File "${SRC_DIR}\msvcr80d.dll"
356 File "${SRC_DIR}\Microsoft.VC80.DebugCRT.manifest"
357 File "${SRC_DIR}\pthreadVCE.dll"
359 !if "${BUILD_TOOLS}" == "MinGW"
360 File "${SRC_DIR}\mingwm10.dll"
361 File "${SRC_DIR}\pthreadGCE.dll"
363 File "${SRC_DIR}\libeay32.dll"
364 File "${SRC_DIR}\ssleay32.dll"
365 File "${SRC_DIR}\zlib1.dll"
366 !if "${BUILD_TOOLS}" == "VC8"
367 File "${SRC_DIR}\zlib1.dll.manifest"
369 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
370 File "${SRC_DIR}\zlib1.dll.manifest"
372 File "/oname=$INSTDIR\openssl.cnf" "${SRC_DIR}\openssl.cnf"
373 File "${SRC_DIR}\openssl.exe"
374 File "${SRC_DIR}\bsleep.exe"
375 File "${SRC_DIR}\bsmtp.exe"
376 File "${SRC_DIR}\bacula.dll"
377 File "${SRC_DIR}\expr64.exe"
378 File "${SRC_DIR}\snooze.exe"
380 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\View Readme.lnk" "write.exe" '"$INSTDIR\Readme.txt"'
382 StrCpy $CommonFilesDone 1
386 Section "-Initialize"
387 ${If} $MySQLPath != ""
388 DetailPrint "Found MySQL (version $MySQLVersion)"
390 ${If} $PostgreSQLPath != ""
391 DetailPrint "Found PostgreSQL (version $PostgreSQLVersion)"
394 WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR"
396 Call GetSelectedComponents
398 WriteRegDWORD HKLM Software\Bacula Components $R2
400 WriteRegDWORD HKLM Software\Bacula Database $ConfigDirectorDB
402 ; remove start menu items
403 SetShellVarContext all
405 Delete /REBOOTOK "$SMPROGRAMS\Bacula\Configuration\*"
406 Delete /REBOOTOK "$SMPROGRAMS\Bacula\Documentation\*"
407 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
408 RMDir "$SMPROGRAMS\Bacula\Configuration"
409 RMDir "$SMPROGRAMS\Bacula\Documentation"
410 RMDir "$SMPROGRAMS\Bacula"
411 CreateDirectory "$SMPROGRAMS\Bacula"
412 CreateDirectory "$SMPROGRAMS\Bacula\Configuration"
413 CreateDirectory "$SMPROGRAMS\Bacula\Documentation"
415 CreateDirectory "$INSTDIR"
416 CreateDirectory "$INSTDIR\bin"
417 CreateDirectory "$APPDATA\Bacula"
418 CreateDirectory "$APPDATA\Bacula\Work"
419 CreateDirectory "$APPDATA\Bacula\Spool"
421 SetOutPath "$INSTDIR"
422 File "..\..\..\LICENSE"
423 Delete /REBOOTOK "$INSTDIR\bin\License.txt"
425 FileOpen $R1 $PLUGINSDIR\config.sed w
426 FileWrite $R1 "s;@VERSION@;${VERSION};g$\r$\n"
427 FileWrite $R1 "s;@DATE@;${__DATE__};g$\r$\n"
428 FileWrite $R1 "s;@DISTNAME@;Windows;g$\r$\n"
430 !If "$BUILD_TOOLS" == "MinGW"
440 FileWrite $R1 "s;@DISTVER@;$R2;g$\r$\n"
442 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\"
443 FileWrite $R1 's;@working_dir@;$R2;g$\r$\n'
444 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\"
445 FileWrite $R1 's;@working_dir_cmd@;$R2;g$\r$\n'
447 ${StrRep} $R2 "$INSTDIR\bin" "\" "\\\\"
448 FileWrite $R1 's;@bin_dir@;$R2;g$\r$\n'
449 ${StrRep} $R2 "$INSTDIR\bin" "\" "\\"
450 FileWrite $R1 's;@bin_dir_cmd@;$R2;g$\r$\n'
452 ${StrRep} $R2 "$INSTDIR\bin\fdplugins" "\" "\\\\"
453 FileWrite $R1 's;@fdplugins_dir@;$R2;g$\r$\n'
455 ${StrRep} $R2 "$INSTDIR" "\" "/"
456 FileWrite $R1 "s;@BUILD_DIR@;$R2;g$\r$\n"
458 Call IsDirectorSelected
461 FileWrite $R1 "s;@director_address@;$LocalHostAddress;g$\r$\n"
463 ${If} "$ConfigDirectorAddress" != ""
464 FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;g$\r$\n"
468 FileWrite $R1 "s;@client_address@;$LocalHostAddress;g$\r$\n"
469 FileWrite $R1 "s;@storage_address@;$LocalHostAddress;g$\r$\n"
471 ${If} "$ConfigClientName" != ""
472 FileWrite $R1 "s;@client_name@;$ConfigClientName;g$\r$\n"
474 ${If} "$ConfigClientPort" != ""
475 FileWrite $R1 "s;@client_port@;$ConfigClientPort;g$\r$\n"
477 ${If} "$ConfigClientMaxJobs" != ""
478 FileWrite $R1 "s;@client_maxjobs@;$ConfigClientMaxJobs;g$\r$\n"
480 ${If} "$ConfigClientPassword" != ""
481 FileWrite $R1 "s;@client_password@;$ConfigClientPassword;g$\r$\n"
483 ${If} "$ConfigStorageName" != ""
484 FileWrite $R1 "s;@storage_name@;$ConfigStorageName;g$\r$\n"
486 ${If} "$ConfigStoragePort" != ""
487 FileWrite $R1 "s;@storage_port@;$ConfigStoragePort;g$\r$\n"
489 ${If} "$ConfigStorageMaxJobs" != ""
490 FileWrite $R1 "s;@storage_maxjobs@;$ConfigStorageMaxJobs;g$\r$\n"
492 ${If} "$ConfigStoragePassword" != ""
493 FileWrite $R1 "s;@storage_password@;$ConfigStoragePassword;g$\r$\n"
495 ${If} "$ConfigDirectorName" != ""
496 FileWrite $R1 "s;@director_name@;$ConfigDirectorName;g$\r$\n"
498 ${If} "$ConfigDirectorPort" != ""
499 FileWrite $R1 "s;@director_port@;$ConfigDirectorPort;g$\r$\n"
501 ${If} "$ConfigDirectorMaxJobs" != ""
502 FileWrite $R1 "s;@director_maxjobs@;$ConfigDirectorMaxJobs;g$\r$\n"
504 ${If} "$ConfigDirectorPassword" != ""
505 FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;g$\r$\n"
507 ${If} "$ConfigDirectorMailServer" != ""
508 FileWrite $R1 "s;@smtp_host@;$ConfigDirectorMailServer;g$\r$\n"
510 ${If} "$ConfigDirectorMailAddress" != ""
511 FileWrite $R1 "s;@job_email@;$ConfigDirectorMailAddress;g$\r$\n"
513 ${If} "$ConfigMonitorName" != ""
514 FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;g$\r$\n"
516 ${If} "$ConfigMonitorPassword" != ""
517 FileWrite $R1 "s;@monitor_password@;$ConfigMonitorPassword;g$\r$\n"
520 ${If} $ConfigDirectorDB = 1
521 ${If} $MySQLPath != ""
522 ${StrRep} $R2 "$MySQLPath\bin" "\" "\\"
523 FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n"
525 ${ElseIf} $ConfigDirectorDB = 2
526 ${If} $PostgreSQLPath != ""
527 ${StrRep} $R2 "$PostgreSQLPath\bin" "\" "\\"
528 FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n"
534 ${If} $InstallType = ${MigrateInstall}
535 FileOpen $R1 $PLUGINSDIR\migrate.sed w
536 ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\"
537 FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n'
538 FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n'
542 ${If} ${FileExists} "$OldInstallDir\bin\bacula-fd.exe"
543 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /kill' ; Shutdown any bacula that could be running
545 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /remove' ; Remove existing service
548 ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe"
549 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /kill' ; Shutdown any bacula that could be running
551 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /remove' ; Remove existing service
554 ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe"
555 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /kill' ; Shutdown any bacula that could be running
557 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /remove' ; Remove existing service
562 SectionGroup "Client" SecGroupClient
564 Section "File Service" SecFileDaemon
567 SetOutPath "$INSTDIR\bin\fdplugins"
568 File "${SRC_DIR}\exchange-fd.dll"
570 SetOutPath "$INSTDIR\bin"
572 File "${SRC_DIR}\bacula-fd.exe"
574 ${If} $InstallType = ${MigrateInstall}
575 ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf"
576 CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula"
577 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"'
579 File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in"
581 StrCpy $0 "$APPDATA\Bacula"
582 StrCpy $1 bacula-fd.conf
583 Call ConfigEditAndCopy
587 StrCpy $1 "File Service"
588 StrCpy $2 $ConfigClientInstallService
589 StrCpy $3 $ConfigClientStartService
593 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Client Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-fd.conf"'
598 SectionGroup "Server" SecGroupServer
600 Section "Storage Service" SecStorageDaemon
603 SetOutPath "$INSTDIR\bin"
605 File "${SRC_DIR}\loaderinfo.exe"
606 File "${SRC_DIR}\mt.exe"
607 File "${SRC_DIR}\mtx.exe"
608 File "${SRC_DIR}\scsitape.exe"
609 File "${SRC_DIR}\tapeinfo.exe"
610 File "${SRC_DIR}\bacula-sd.exe"
611 File "${SRC_DIR}\bcopy.exe"
612 File "${SRC_DIR}\bextract.exe"
613 File "${SRC_DIR}\bls.exe"
614 File "${SRC_DIR}\bscan.exe"
615 File "${SRC_DIR}\btape.exe"
616 File "${SRC_DIR}\scsilist.exe"
617 File "${SRC_DIR}\mkisofs.exe"
618 File "${SRC_DIR}\growisofs.exe"
619 File "${SRC_DIR}\dvd-ram-control.exe"
620 File "${SRC_DIR}\dvd+rw-booktype.exe"
621 File "${SRC_DIR}\dvd+rw-format.exe"
622 File "${SRC_DIR}\dvd+rw-mediainfo.exe"
624 File "/oname=$PLUGINSDIR\mtx-changer.cmd" "${SRC_DIR}\mtx-changer.cmd"
626 StrCpy $0 "$INSTDIR\bin"
627 StrCpy $1 mtx-changer.cmd
628 Call ConfigEditAndCopy
630 File "/oname=$PLUGINSDIR\disk-changer.cmd" "${SRC_DIR}\disk-changer.cmd"
632 StrCpy $0 "$INSTDIR\bin"
633 StrCpy $1 disk-changer.cmd
634 Call ConfigEditAndCopy
636 File "/oname=$PLUGINSDIR\dvd-handler.cmd" "${SRC_DIR}\dvd-handler.cmd"
638 StrCpy $0 "$INSTDIR\bin"
639 StrCpy $1 dvd-handler.cmd
640 Call ConfigEditAndCopy
642 File "/oname=$PLUGINSDIR\bacula-sd.conf" "bacula-sd.conf.in"
644 StrCpy $0 "$APPDATA\Bacula"
645 StrCpy $1 bacula-sd.conf
646 Call ConfigEditAndCopy
649 StrCpy $1 "Storage Service"
650 StrCpy $2 $ConfigStorageInstallService
651 StrCpy $3 $ConfigStorageStartService
654 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause"
655 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"'
658 Section "Director Service" SecDirectorDaemon
661 SetOutPath "$INSTDIR\bin"
663 ${If} $ConfigDirectorDB = 1
664 File /oname=bacula_cats.dll "${SRC_DIR}\cats_mysql.dll"
665 File "${SRC_DIR}\libmysql.dll"
666 File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_mysql_database.cmd
667 File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_mysql_database.cmd
668 File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_mysql_tables.cmd
669 File ${SRC_DIR}\make_mysql_tables.sql
670 File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_mysql_tables.cmd
671 File ${SRC_DIR}\drop_mysql_tables.sql
672 File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_mysql_privileges.cmd
673 File ${SRC_DIR}\grant_mysql_privileges.sql
674 File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_mysql_catalog_backup.cmd
675 ${ElseIf} $ConfigDirectorDB = 2
676 File /oname=bacula_cats.dll "${SRC_DIR}\cats_postgresql.dll"
677 File "${SRC_DIR}\libpq.dll"
678 !if "${BUILD_TOOLS}" == "VC8"
679 File "${SRC_DIR}\comerr32.dll"
680 File "${SRC_DIR}\libintl-2.dll"
681 File "${SRC_DIR}\libiconv-2.dll"
682 File "${SRC_DIR}\krb5_32.dll"
684 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
685 File "${SRC_DIR}\comerr32.dll"
686 File "${SRC_DIR}\libintl-2.dll"
687 File "${SRC_DIR}\libiconv-2.dll"
688 File "${SRC_DIR}\krb5_32.dll"
690 File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_postgresql_database.cmd
691 File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_postgresql_database.cmd
692 File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_postgresql_tables.cmd
693 File ${SRC_DIR}\create_postgresql_database.sql
694 File ${SRC_DIR}\make_postgresql_tables.sql
695 File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_postgresql_tables.cmd
696 File ${SRC_DIR}\drop_postgresql_tables.sql
697 File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_postgresql_privileges.cmd
698 File ${SRC_DIR}\grant_postgresql_privileges.sql
699 File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_postgresql_catalog_backup.cmd
700 ${ElseIf} $ConfigDirectorDB = 3
701 File "${SRC_DIR}\sqlite3.exe"
702 !if "${BUILD_TOOLS}" == "VC8"
703 File "${SRC_DIR}\sqlite3.exe.manifest"
705 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
706 File "${SRC_DIR}\sqlite3.exe.manifest"
708 File /oname=bacula_cats.dll "${SRC_DIR}\cats_sqlite3.dll"
709 File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_sqlite3_database.cmd
710 File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_sqlite3_database.cmd
711 File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_sqlite3_tables.cmd
712 File ${SRC_DIR}\make_sqlite3_tables.sql
713 File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_sqlite3_tables.cmd
714 File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_sqlite3_privileges.cmd
715 File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_sqlite3_catalog_backup.cmd
718 File "${SRC_DIR}\bacula-dir.exe"
719 File "${SRC_DIR}\dbcheck.exe"
721 File "/oname=$PLUGINSDIR\delete_catalog_backup.cmd" "${SRC_DIR}\delete_catalog_backup.cmd"
723 StrCpy $0 "$INSTDIR\bin"
725 StrCpy $1 create_database.cmd
726 Call ConfigEditAndCopy
728 StrCpy $1 drop_database.cmd
729 Call ConfigEditAndCopy
731 StrCpy $1 make_tables.cmd
732 Call ConfigEditAndCopy
734 StrCpy $1 drop_tables.cmd
735 Call ConfigEditAndCopy
737 StrCpy $1 grant_privileges.cmd
738 Call ConfigEditAndCopy
740 StrCpy $1 make_catalog_backup.cmd
741 Call ConfigEditAndCopy
743 StrCpy $1 delete_catalog_backup.cmd
744 Call ConfigEditAndCopy
746 File "${SRC_DIR}\query.sql"
748 File "/oname=$PLUGINSDIR\bacula-dir.conf" "bacula-dir.conf.in"
750 StrCpy $0 "$APPDATA\Bacula"
751 StrCpy $1 bacula-dir.conf
752 Call ConfigEditAndCopy
755 StrCpy $1 "Director Service"
756 StrCpy $2 $ConfigDirectorInstallService
757 StrCpy $3 $ConfigDirectorStartService
760 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Director Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-dir.conf"'
765 SectionGroup "Consoles" SecGroupConsoles
767 Section "Command Console" SecConsole
770 SetOutPath "$INSTDIR\bin"
772 File "${SRC_DIR}\bconsole.exe"
773 Call InstallCommonFiles
775 ${If} $InstallType = ${MigrateInstall}
776 ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf"
777 CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula"
779 File "/oname=$PLUGINSDIR\bconsole.conf" "bconsole.conf.in"
780 StrCpy $0 "$APPDATA\Bacula"
781 StrCpy $1 bconsole.conf
782 Call ConfigEditAndCopy
785 CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0
786 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"'
790 Section "Bat Console" SecBatConsole
793 SetOutPath "$INSTDIR\bin"
795 Call InstallCommonFiles
796 File "${SRC_DIR}\QtCore4.dll"
797 File "${SRC_DIR}\QtGui4.dll"
799 File "${SRC_DIR}\bat.exe"
801 ${If} $InstallType = ${MigrateInstall}
802 ${AndIf} ${FileExists} "$OldInstallDir\bin\bat.conf"
803 CopyFiles "$OldInstallDir\bin\bat.conf" "$APPDATA\Bacula"
805 File "/oname=$PLUGINSDIR\bat.conf" "bat.conf.in"
806 StrCpy $0 "$APPDATA\Bacula"
808 Call ConfigEditAndCopy
811 ; Create Start Menu entry
812 CreateShortCut "$SMPROGRAMS\Bacula\Bat.lnk" "$INSTDIR\bin\bat.exe" '-c "$APPDATA\Bacula\bat.conf"' "$INSTDIR\bin\bat.exe" 0
813 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Bat Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bat.conf"'
817 Section "Graphical Console" SecWxConsole
820 SetOutPath "$INSTDIR\bin"
822 Call InstallCommonFiles
823 !if "${BUILD_TOOLS}" == "VC8"
824 File "${SRC_DIR}\wxbase28_vc_bacula.dll"
825 File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll"
827 !If "${BUILD_TOOLS}" == "VC8_DEBUG"
828 File "${SRC_DIR}\wxbase28_vc_bacula.dll"
829 File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll"
831 !if "${BUILD_TOOLS}" == "MinGW"
832 File "${SRC_DIR}\wxbase28_gcc_bacula.dll"
833 File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll"
836 File "${SRC_DIR}\bwx-console.exe"
838 ${If} $InstallType = ${MigrateInstall}
839 ${AndIf} ${FileExists} "$OldInstallDir\bin\bwx-console.conf"
840 CopyFiles "$OldInstallDir\bin\bwx-console.conf" "$APPDATA\Bacula"
842 File "/oname=$PLUGINSDIR\bwx-console.conf" "bwx-console.conf.in"
843 StrCpy $0 "$APPDATA\Bacula"
844 StrCpy $1 bwx-console.conf
845 Call ConfigEditAndCopy
848 ; Create Start Menu entry
849 CreateShortCut "$SMPROGRAMS\Bacula\bwx-console.lnk" "$INSTDIR\bin\bwx-console.exe" '-c "$APPDATA\Bacula\bwx-console.conf"' "$INSTDIR\bin\bwx-console.exe" 0
850 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bwx-console.conf"'
855 SectionGroup "Documentation" SecGroupDocumentation
857 Section "Documentation (Acrobat Format)" SecDocPdf
860 SetOutPath "$INSTDIR\doc"
861 CreateDirectory "$INSTDIR\doc"
863 File "${SRC_DIR}\docs\manuals\en\console\console.pdf"
864 File "${SRC_DIR}\docs\manuals\en\misc\misc.pdf"
865 File "${SRC_DIR}\docs\manuals\en\main\main.pdf"
866 File "${SRC_DIR}\docs\manuals\en\utility\utility.pdf"
867 File "${SRC_DIR}\docs\manuals\en\problems\problems.pdf"
868 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Console.lnk" '"$INSTDIR\doc\console.pdf"'
869 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Main.lnk" '"$INSTDIR\doc\main.pdf"'
870 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Misc.lnk" '"$INSTDIR\doc\misc.pdf"'
871 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Utility.lnk" '"$INSTDIR\doc\utility.pdf"'
872 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Problems.lnk" '"$INSTDIR\doc\problems.pdf"'
875 Section "Documentation (HTML Format)" SecDocHtml
878 SetOutPath "$INSTDIR\doc"
879 CreateDirectory "$INSTDIR\doc"
881 ; File "${SRC_DIR}\manual\bacula\*.html"
882 ; File "${SRC_DIR}\manual\bacula\*.png"
883 ; File "${SRC_DIR}\manual\bacula\*.css"
884 ; CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual (HTML).lnk" '"$INSTDIR\doc\index.html"'
893 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$INSTDIR" /T /G SYSTEM:F Administrators:F'
894 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$APPDATA\Bacula" /T /G SYSTEM:F Administrators:F'
897 ; Write the uninstall keys for Windows & create Start Menu entry
898 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula"
899 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "InstallLocation" "$INSTDIR"
900 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayVersion" "${VERSION}"
901 ${StrTok} $R0 "${VERSION}" "." 0 0
902 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMajor" $R0
903 ${StrTok} $R0 "${VERSION}" "." 1 0
904 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMinor" $R0
905 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoModify" 1
906 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoRepair" 1
907 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLUpdateInfo" "http://sourceforge.net/project/showfiles.php?group_id=50727"
908 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org"
909 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support"
910 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"'
911 WriteUninstaller "$INSTDIR\Uninstall.exe"
912 CreateShortCut "$SMPROGRAMS\Bacula\Uninstall Bacula.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
916 ; Extra Page descriptions
918 LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system."
919 LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system."
920 LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director Daemon on this system."
921 LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system."
922 LangString DESC_SecBatConsole ${LANG_ENGLISH} "Install Bat graphical console program on this system."
923 LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install wxWidgets graphical console program on this system."
924 LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system."
925 LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system."
927 LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration"
928 LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration."
930 LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)"
931 LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration."
933 LangString TITLE_InstallType ${LANG_ENGLISH} "Installation Type"
934 LangString SUBTITLE_InstallType ${LANG_ENGLISH} "Choose installation type."
936 LangString TITLE_WriteTemplates ${LANG_ENGLISH} "Create Templates"
937 LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create resource templates for inclusion in the Director's configuration file."
939 !InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN
940 !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon)
941 !InsertMacro MUI_DESCRIPTION_TEXT ${SecStorageDaemon} $(DESC_SecStorageDaemon)
942 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon)
943 !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole)
944 !InsertMacro MUI_DESCRIPTION_TEXT ${SecBatConsole} $(DESC_SecBatConsole)
945 !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole)
946 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf)
947 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml)
948 !InsertMacro MUI_FUNCTION_DESCRIPTION_END
952 UninstallText "This will uninstall Bacula. Hit next to continue."
955 ; Shutdown any baculum that could be running
956 nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /kill'
957 nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /kill'
958 nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill'
961 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd"
963 ; Remove bacula service
964 nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /remove'
965 nsExec::ExecToLog '"$INSTDIR\bin\exchange-fd.dll" /remove'
968 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd"
970 ; Remove bacula service
971 nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /remove'
974 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir"
976 ; Remove bacula service
977 nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /remove'
980 ; remove registry keys
981 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula"
982 DeleteRegKey HKLM "Software\Bacula"
984 ; remove start menu items
985 SetShellVarContext all
986 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
987 RMDir "$SMPROGRAMS\Bacula"
989 ; remove files and uninstaller (preserving config for now)
990 Delete /REBOOTOK "$INSTDIR\bin\*"
991 Delete /REBOOTOK "$INSTDIR\doc\*"
992 Delete /REBOOTOK "$INSTDIR\*"
994 ; Check for existing installation
995 MessageBox MB_YESNO|MB_ICONQUESTION \
996 "Would you like to delete the current configuration files and the working state file?" IDNO NoDel
997 Delete /REBOOTOK "$APPDATA\Bacula\*"
998 Delete /REBOOTOK "$APPDATA\Bacula\Work\*"
999 Delete /REBOOTOK "$APPDATA\Bacula\Spool\*"
1000 Delete /REBOOTOK "$PLUGINSDIR\bacula-*.conf"
1001 Delete /REBOOTOK "$PLUGINSDIR\*console.conf"
1002 Delete /REBOOTOK "$PLUGINSDIR\*conf.in"
1003 Delete /REBOOTOK "$PLUGINSDIR\openssl.exe"
1004 Delete /REBOOTOK "$PLUGINSDIR\libeay32.dll"
1005 Delete /REBOOTOK "$PLUGINSDIR\ssleay32.dll"
1006 Delete /REBOOTOK "$PLUGINSDIR\sed.exe"
1007 Delete /REBOOTOK "$PLUGINSDIR\pw.txt"
1008 Delete /REBOOTOK "$PLUGINSDIR\*.sed"
1009 Delete /REBOOTOK "$PLUGINSDIR\*.cmd"
1010 Delete /REBOOTOK "$PLUGINSDIR\*.sql"
1011 RMDir "$APPDATA\Bacula\Work"
1012 RMDir "$APPDATA\Bacula\Spool"
1013 RMDir "$APPDATA\Bacula"
1016 ; remove directories used
1017 RMDir "$INSTDIR\bin"
1018 RMDir "$INSTDIR\doc"
1023 ; $0 - Service Name (ie Bacula-FD)
1024 ; $1 - Service Description (ie Bacula File Daemon)
1025 ; $2 - Install as Service
1026 ; $3 - Start Service now
1028 Function InstallDaemon
1029 Call InstallCommonFiles
1031 WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2
1034 nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /install -c "$APPDATA\Bacula\$0.conf"'
1041 ; Start the service?
1045 nsExec::ExecToLog 'net start $0'
1047 Exec '"$INSTDIR\bin\$0.exe" -c "$APPDATA\Bacula\$0.conf"'
1051 CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\bin\$0.exe" '-c "$APPDATA\Bacula\$0.conf"' "$INSTDIR\bin\$0.exe" 0
1055 Function GetComputerName
1060 System::Call "kernel32::GetComputerNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2"
1062 ${StrCase} $R0 $R0 "L"
1069 !define ComputerNameDnsFullyQualified 3
1071 Function GetHostName
1077 System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1080 DetailPrint "GetComputerNameExA failed - LastError = $R2"
1081 Call GetComputerName
1087 Call GetComputerName
1096 !define NameUserPrincipal 8
1098 Function GetUserName
1104 System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1107 DetailPrint "GetUserNameExA failed - LastError = $R2"
1118 System::Call "advapi32::GetUserNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
1121 DetailPrint "GetUserNameA failed - LastError = $R2"
1133 Function ConfigEditAndCopy
1136 ${If} ${FileExists} "$0\$1"
1142 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\$1"'
1143 CopyFiles "$PLUGINSDIR\$1" "$0\$1$R1"
1148 Function FindDatabaseApps
1151 ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Location"
1154 Call RemoveTrailingSlash
1155 StrCpy $MySQLPath $0
1156 ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Version"
1157 StrCpy $MySQLVersion $0
1160 EnumRegKey $R1 HKLM "Software\PostgreSQL\Installations" 0
1162 ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Base Directory"
1163 Call RemoveTrailingSlash
1164 StrCpy $PostgreSQLPath $0
1165 ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Version"
1166 StrCpy $PostgreSQLVersion $0
1172 Function RemoveTrailingSlash
1181 Function IsDirectorSelected
1183 SectionGetFlags ${SecDirectorDaemon} $R0
1184 IntOp $R0 $R0 & ${SF_SELECTED}
1188 Function GetSelectedComponents
1191 ${If} ${SectionIsSelected} ${SecFileDaemon}
1192 IntOp $R0 $R0 | ${ComponentFile}
1194 ${If} ${SectionIsSelected} ${SecStorageDaemon}
1195 IntOp $R0 $R0 | ${ComponentStorage}
1197 ${If} ${SectionIsSelected} ${SecDirectorDaemon}
1198 IntOp $R0 $R0 | ${ComponentDirector}
1200 ${If} ${SectionIsSelected} ${SecConsole}
1201 IntOp $R0 $R0 | ${ComponentTextConsole}
1203 ${If} ${SectionIsSelected} ${SecBatConsole}
1204 IntOp $R0 $R0 | ${ComponentBatConsole}
1206 ${If} ${SectionIsSelected} ${SecWxConsole}
1207 IntOp $R0 $R0 | ${ComponentGUIConsole}
1209 ${If} ${SectionIsSelected} ${SecDocPdf}
1210 IntOp $R0 $R0 | ${ComponentPDFDocs}
1212 ${If} ${SectionIsSelected} ${SecDocHtml}
1213 IntOp $R0 $R0 | ${ComponentHTMLDocs}
1218 Function PageComponentsShow
1220 Call DisableServerSections
1223 Call SelectPreviousComponents
1224 Call UpdateComponentUI
1227 Function PageDirectoryPre
1228 ${If} $AutomaticInstall = 1
1229 ${OrIf} $InstallType = ${UpgradeInstall}
1234 Function LeaveInstallPage
1235 Push "$INSTDIR\install.log"
1239 Function EnterWriteTemplates
1243 Call GetSelectedComponents
1246 IntOp $R0 $R0 & ${ComponentDirector}
1247 IntOp $R1 $NewComponents & ${ComponentsFileAndStorage}
1256 IntOp $R0 $NewComponents & ${ComponentFile}
1258 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 0
1259 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags DISABLED
1260 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State
1261 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
1263 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 1
1264 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags
1265 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State "C:\$ConfigClientName.conf"
1266 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
1269 IntOp $R0 $NewComponents & ${ComponentStorage}
1271 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 0
1272 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags DISABLED
1273 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State
1274 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
1276 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 1
1277 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags
1278 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State "C:\$ConfigStorageName.conf"
1279 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
1282 !InsertMacro MUI_HEADER_TEXT "$(TITLE_WriteTemplates)" "$(SUBTITLE_WriteTemplates)"
1283 !InsertMacro MUI_INSTALLOPTIONS_DISPLAY "WriteTemplates.ini"
1285 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 2" State
1287 File "/oname=$PLUGINSDIR\client.conf.in" "client.conf.in"
1289 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\client.conf.in"'
1290 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 3" State
1292 CopyFiles "$PLUGINSDIR\client.conf.in" "$R0"
1296 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 4" State
1298 File "/oname=$PLUGINSDIR\storage.conf.in" "storage.conf.in"
1300 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\storage.conf.in"'
1301 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 5" State
1303 CopyFiles "$PLUGINSDIR\storage.conf.in" "$R0"
1311 Function SelectPreviousComponents
1312 ${If} $InstallType <> ${NewInstall}
1313 IntOp $R1 $PreviousComponents & ${ComponentFile}
1315 !InsertMacro SelectSection ${SecFileDaemon}
1316 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_RO}
1318 !InsertMacro UnselectSection ${SecFileDaemon}
1319 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_RO}
1321 IntOp $R1 $PreviousComponents & ${ComponentStorage}
1323 !InsertMacro SelectSection ${SecStorageDaemon}
1324 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO}
1326 !InsertMacro UnselectSection ${SecStorageDaemon}
1327 !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_RO}
1329 IntOp $R1 $PreviousComponents & ${ComponentDirector}
1331 !InsertMacro SelectSection ${SecDirectorDaemon}
1332 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO}
1334 !InsertMacro UnselectSection ${SecDirectorDaemon}
1335 !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_RO}
1337 IntOp $R1 $PreviousComponents & ${ComponentTextConsole}
1339 !InsertMacro SelectSection ${SecConsole}
1340 !InsertMacro SetSectionFlag ${SecConsole} ${SF_RO}
1342 !InsertMacro UnselectSection ${SecConsole}
1343 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_RO}
1345 IntOp $R1 $PreviousComponents & ${ComponentBatConsole}
1347 !InsertMacro SelectSection ${SecBatConsole}
1348 !InsertMacro SetSectionFlag ${SecBatConsole} ${SF_RO}
1350 !InsertMacro UnselectSection ${SecBatConsole}
1351 !InsertMacro ClearSectionFlag ${SecBatConsole} ${SF_RO}
1353 IntOp $R1 $PreviousComponents & ${ComponentGUIConsole}
1355 !InsertMacro SelectSection ${SecWxConsole}
1356 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_RO}
1358 !InsertMacro UnselectSection ${SecWxConsole}
1359 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_RO}
1361 IntOp $R1 $PreviousComponents & ${ComponentPDFDocs}
1363 !InsertMacro SelectSection ${SecDocPdf}
1364 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_RO}
1366 !InsertMacro UnselectSection ${SecDocPdf}
1367 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_RO}
1369 IntOp $R1 $PreviousComponents & ${ComponentHTMLDocs}
1371 !InsertMacro SelectSection ${SecDocHtml}
1372 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_RO}
1374 !InsertMacro UnselectSection ${SecDocHtml}
1375 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_RO}
1380 Function DisableServerSections
1381 !InsertMacro UnselectSection ${SecGroupServer}
1382 !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO}
1383 !InsertMacro UnselectSection ${SecStorageDaemon}
1384 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO}
1385 !InsertMacro UnselectSection ${SecDirectorDaemon}
1386 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO}
1389 Function UpdateComponentUI
1393 Call GetSelectedComponents
1396 IntOp $R1 $R0 ^ $PreviousComponents
1397 IntOp $NewComponents $R0 & $R1
1399 ${If} $InstallType <> ${NewInstall}
1400 IntOp $R1 $NewComponents & ${ComponentFile}
1402 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_BOLD}
1404 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_BOLD}
1406 IntOp $R1 $NewComponents & ${ComponentStorage}
1408 !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD}
1410 !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD}
1412 IntOp $R1 $NewComponents & ${ComponentDirector}
1414 !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD}
1416 !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_BOLD}
1418 IntOp $R1 $NewComponents & ${ComponentTextConsole}
1420 !InsertMacro SetSectionFlag ${SecConsole} ${SF_BOLD}
1422 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_BOLD}
1424 IntOp $R1 $NewComponents & ${ComponentBatConsole}
1426 !InsertMacro SetSectionFlag ${SecBatConsole} ${SF_BOLD}
1428 !InsertMacro ClearSectionFlag ${SecBatConsole} ${SF_BOLD}
1430 IntOp $R1 $NewComponents & ${ComponentGUIConsole}
1432 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_BOLD}
1434 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_BOLD}
1436 IntOp $R1 $NewComponents & ${ComponentPDFDocs}
1438 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD}
1440 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_BOLD}
1442 IntOp $R1 $NewComponents & ${ComponentHTMLDocs}
1444 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_BOLD}
1446 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_BOLD}
1450 GetDlgItem $R0 $HWNDPARENT 1
1452 IntOp $R1 $NewComponents & ${ComponentsRequiringUserConfig}
1454 SendMessage $R0 ${WM_SETTEXT} 0 "STR:Install"
1456 SendMessage $R0 ${WM_SETTEXT} 0 "STR:&Next >"
1463 !include "InstallType.nsh"
1464 !include "ConfigPage1.nsh"
1465 !include "ConfigPage2.nsh"
1466 !include "DumpLog.nsh"