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 ; Kern Sibbald October 2008
31 ; Remove server installs
32 ; Install into single bacula directory
33 ; (i.e. undo a large part of what Robert Nelson did)
35 ; Eric Bollengier March 2009
36 ; Updated to handle Win64 installation
38 ; Version $Id: winbacula.nsi 7074 2008-05-31 18:43:21Z kerns $
40 ; Command line options:
45 ; netsh firewall add portopening protocol=tcp port=9102 name="Bacula-FD"
48 !define PRODUCT "Bacula Systems"
51 ; Include the Modern UI
55 !include "LogicLib.nsh"
56 !include "FileFunc.nsh"
57 !include "Sections.nsh"
58 !include "StrFunc.nsh"
59 !include "WinMessages.nsh"
64 OutFile "${OUT_DIR}\win${WINVER}baculasystems-${VERSION}.exe"
67 InstallDir "$PROGRAMFILES\bacula"
68 InstallDirRegKey HKLM "Software\Bacula" "InstallLocation"
72 !insertmacro GetParent
83 !define MUI_COMPONENTSPAGE_SMALLDESC
85 !define MUI_HEADERIMAGE
86 !define MUI_BGCOLOR 739AB9
87 !define MUI_HEADERIMAGE_BITMAP "bacula-logo.bmp"
89 !InsertMacro MUI_PAGE_WELCOME
90 !InsertMacro MUI_PAGE_LICENSE "..\..\..\LICENSE"
91 Page custom EnterInstallType
92 !define MUI_PAGE_CUSTOMFUNCTION_SHOW PageComponentsShow
93 !InsertMacro MUI_PAGE_COMPONENTS
94 !define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre
95 !InsertMacro MUI_PAGE_DIRECTORY
96 Page custom EnterConfigPage1 LeaveConfigPage1
97 Page custom EnterConfigPage2 LeaveConfigPage2
98 !Define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveInstallPage
99 !InsertMacro MUI_PAGE_INSTFILES
100 Page custom EnterWriteTemplates
101 !Define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt
102 !InsertMacro MUI_PAGE_FINISH
104 !InsertMacro MUI_UNPAGE_WELCOME
105 !InsertMacro MUI_UNPAGE_CONFIRM
106 !InsertMacro MUI_UNPAGE_INSTFILES
107 !InsertMacro MUI_UNPAGE_FINISH
109 !define MUI_ABORTWARNING
111 !InsertMacro MUI_LANGUAGE "English"
113 !InsertMacro GetParameters
114 !InsertMacro GetOptions
116 DirText "Setup will install Bacula Systems ${VERSION} to the directory specified below. To install in a different folder, click Browse and select another folder."
118 !InsertMacro MUI_RESERVEFILE_INSTALLOPTIONS
134 Var ConfigClientMaxJobs
135 Var ConfigClientPassword
136 Var ConfigClientInstallService
137 Var ConfigClientStartService
139 Var ConfigStorageName
140 Var ConfigStoragePort
141 Var ConfigStorageMaxJobs
142 Var ConfigStoragePassword
143 Var ConfigStorageInstallService
144 Var ConfigStorageStartService
146 Var ConfigDirectorName
147 Var ConfigDirectorPort
148 Var ConfigDirectorMaxJobs
149 Var ConfigDirectorPassword
150 Var ConfigDirectorAddress
151 Var ConfigDirectorMailServer
152 Var ConfigDirectorMailAddress
154 Var ConfigDirectorInstallService
155 Var ConfigDirectorStartService
157 Var ConfigMonitorName
158 Var ConfigMonitorPassword
160 Var LocalDirectorPassword
166 Var PostgreSQLVersion
172 !define UpgradeInstall 1
173 !define MigrateInstall 2
176 Var PreviousComponents
179 ; Bit 0 = File Service
180 ; 1 = Storage Service
181 ; 2 = Director Service
182 ; 3 = Command Console
183 ; 4 = Graphical Console
184 ; 5 = Documentation (PDF)
185 ; 6 = Documentation (HTML)
187 !define ComponentFile 1
188 !define ComponentStorage 2
189 !define ComponentDirector 4
190 !define ComponentTextConsole 8
191 !define ComponentGUIConsole 16
192 !define ComponentPDFDocs 32
193 !define ComponentHTMLDocs 64
195 !define ComponentsRequiringUserConfig 31
196 !define ComponentsFileAndStorage 3
197 !define ComponentsFileAndStorageAndDirector 7
198 !define ComponentsDirectorAndTextGuiConsoles 28
199 !define ComponentsTextAndGuiConsoles 24
208 ; Process Command Line Options
212 StrCpy $CommonFilesDone 0
214 StrCpy $AutomaticInstall 0
215 StrCpy $InstallType ${NewInstall}
216 StrCpy $OldInstallDir ""
217 StrCpy $PreviousComponents 0
218 StrCpy $NewComponents 0
220 StrCpy $MySQLVersion ""
221 StrCpy $PostgreSQLPath ""
222 StrCpy $PostgreSQLVersion ""
223 StrCpy $LocalDirectorPassword ""
228 ${GetOptions} $R0 "/noservice" $R1
233 ${GetOptions} $R0 "/nostart" $R1
240 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
249 Pop $LocalHostAddress
253 ; Configuration Defaults
255 StrCpy $ConfigClientName "$HostName-fd"
256 StrCpy $ConfigClientPort 9102
257 StrCpy $ConfigClientMaxJobs 5
258 ;StrCpy $ConfigClientPassword
259 StrCpy $ConfigClientInstallService "$OptService"
260 StrCpy $ConfigClientStartService "$OptStart"
263 StrCpy $ConfigMonitorName "$HostName-mon"
264 ;StrCpy $ConfigMonitorPassword
267 File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe"
268 File "/oname=$PLUGINSDIR\ssleay32-0.9.8.dll" "${SRC_DIR}\ssleay32-0.9.8.dll"
269 File "/oname=$PLUGINSDIR\cryptoeay32-0.9.8.dll" "${SRC_DIR}\cryptoeay32-0.9.8.dll"
270 ; File "/oname=$PLUGINSDIR\libeay32.dll" "${SRC_DIR}\libeay32.dll"
271 ; File "/oname=$PLUGINSDIR\ssleay32.dll" "${SRC_DIR}\ssleay32.dll"
272 File "/oname=$PLUGINSDIR\sed.exe" "${SRC_DIR}\sed.exe"
274 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini"
275 !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "WriteTemplates.ini"
277 SetPluginUnload alwaysoff
279 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
282 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
285 ${StrTrimNewLines} $ConfigClientPassword $R0
289 SetPluginUnload manual
291 nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33'
294 FileOpen $R1 "$PLUGINSDIR\pw.txt" r
297 ${StrTrimNewLines} $ConfigMonitorPassword $R0
305 Function .onSelChange
306 Call UpdateComponentUI
309 Function InstallCommonFiles
310 ${If} $CommonFilesDone = 0
311 SetOutPath "$INSTDIR"
314 SetOutPath "$INSTDIR"
315 !if "${BUILD_TOOLS}" == "MinGW"
316 File "${SRC_DIR}\mingwm10.dll"
317 File "${SRC_DIR}\pthreadGCE.dll"
318 File "${SRC_DIR}\zlib1.dll"
319 File "${SRC_DIR}\ssleay32.dll"
320 File "${SRC_DIR}\libeay32.dll"
322 !if "${BUILD_TOOLS}" == "MinGW64"
323 File "${SRC_DIR}\pthreadGCE.dll"
324 File "${SRC_DIR}\cryptoeay32-0.9.8.dll"
325 File "${SRC_DIR}\ssleay32-0.9.8.dll"
326 File "${SRC_DIR}\zlib1.dll"
328 File "${SRC_DIR}\bacula.dll"
330 File "/oname=$INSTDIR\openssl.cnf" "${SRC_DIR}\openssl.cnf"
331 File "${SRC_DIR}\openssl.exe"
332 File "${SRC_DIR}\bsleep.exe"
333 File "${SRC_DIR}\bsmtp.exe"
334 File "${SRC_DIR}\expr64.exe"
335 File "${SRC_DIR}\snooze.exe"
337 CreateShortCut "$SMPROGRAMS\Bacula\Documentation\View Readme.lnk" "write.exe" '"$INSTDIR\Readme.txt"'
339 StrCpy $CommonFilesDone 1
343 Section "-Initialize"
345 WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR"
347 Call GetSelectedComponents
349 WriteRegDWORD HKLM Software\Bacula Components $R2
351 ; remove start menu items
352 SetShellVarContext all
354 Delete /REBOOTOK "$SMPROGRAMS\Bacula\Configuration\*"
355 Delete /REBOOTOK "$SMPROGRAMS\Bacula\Documentation\*"
356 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
357 RMDir "$SMPROGRAMS\Bacula\Configuration"
358 RMDir "$SMPROGRAMS\Bacula\Documentation"
359 RMDir "$SMPROGRAMS\Bacula"
360 CreateDirectory "$SMPROGRAMS\Bacula"
361 CreateDirectory "$SMPROGRAMS\Bacula\Configuration"
362 CreateDirectory "$SMPROGRAMS\Bacula\Documentation"
364 CreateDirectory "$INSTDIR"
365 CreateDirectory "$INSTDIR\working"
367 SetOutPath "$INSTDIR"
368 File "..\..\..\LICENSE"
369 Delete /REBOOTOK "$INSTDIR\License.txt"
371 FileOpen $R1 $PLUGINSDIR\config.sed w
372 FileWrite $R1 "s;@VERSION@;${VERSION};g$\r$\n"
373 FileWrite $R1 "s;@DATE@;${__DATE__};g$\r$\n"
374 FileWrite $R1 "s;@DISTNAME@;Windows;g$\r$\n"
376 !If "$BUILD_TOOLS" == "MinGW"
386 FileWrite $R1 "s;@DISTVER@;$R2;g$\r$\n"
388 ${StrRep} $R2 "$INSTDIR\working" "\" "\\\\"
389 FileWrite $R1 's;@working_dir@;$R2;g$\r$\n'
390 ${StrRep} $R2 "$INSTDIR\working" "\" "\\"
391 FileWrite $R1 's;@working_dir_cmd@;$R2;g$\r$\n'
393 ${StrRep} $R2 "$INSTDIR" "\" "\\\\"
394 FileWrite $R1 's;@bin_dir@;$R2;g$\r$\n'
395 ${StrRep} $R2 "$INSTDIR" "\" "\\"
396 FileWrite $R1 's;@bin_dir_cmd@;$R2;g$\r$\n'
398 ${StrRep} $R2 "$INSTDIR\plugins" "\" "\\\\"
399 FileWrite $R1 's;@fdplugins_dir@;$R2;g$\r$\n'
401 ${StrRep} $R2 "$INSTDIR" "\" "/"
402 FileWrite $R1 "s;@BUILD_DIR@;$R2;g$\r$\n"
404 FileWrite $R1 "s;@client_address@;$LocalHostAddress;g$\r$\n"
406 ${If} "$ConfigClientName" != ""
407 FileWrite $R1 "s;@client_name@;$ConfigClientName;g$\r$\n"
409 ${If} "$ConfigClientPort" != ""
410 FileWrite $R1 "s;@client_port@;$ConfigClientPort;g$\r$\n"
412 ${If} "$ConfigClientMaxJobs" != ""
413 FileWrite $R1 "s;@client_maxjobs@;$ConfigClientMaxJobs;g$\r$\n"
415 ${If} "$ConfigClientPassword" != ""
416 FileWrite $R1 "s;@client_password@;$ConfigClientPassword;g$\r$\n"
418 ${If} "$ConfigDirectorName" != ""
419 FileWrite $R1 "s;@director_name@;$ConfigDirectorName;g$\r$\n"
421 ${If} "$ConfigMonitorName" != ""
422 FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;g$\r$\n"
424 ${If} "$ConfigMonitorPassword" != ""
425 FileWrite $R1 "s;@monitor_password@;$ConfigMonitorPassword;g$\r$\n"
431 ${If} ${FileExists} "$OldInstallDir\bin\bacula-fd.exe"
432 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /kill' ; Shutdown any bacula that could be running
434 nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /remove' ; Remove existing service
439 SectionGroup "Client" SecGroupClient
441 Section "File Service" SecFileDaemon
444 SetOutPath "$INSTDIR\plugins"
445 File "${SRC_DIR}\exchange-fd.dll"
447 SetOutPath "$INSTDIR"
449 File "${SRC_DIR}\bacula-fd.exe"
451 File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in"
454 StrCpy $1 bacula-fd.conf
455 Call ConfigEditAndCopy
458 StrCpy $1 "File Service"
459 StrCpy $2 $ConfigClientInstallService
460 StrCpy $3 $ConfigClientStartService
464 CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Client Configuration.lnk" "write.exe" '"$INSTDIR\bacula-fd.conf"'
473 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$INSTDIR" /T /G SYSTEM:F Administrators:F'
474 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$INSTDIR" /T /G SYSTEM:F Administrators:F'
477 ; Write the uninstall keys for Windows & create Start Menu entry
478 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula"
479 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "InstallLocation" "$INSTDIR"
480 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayVersion" "${VERSION}"
481 ${StrTok} $R0 "${VERSION}" "." 0 0
482 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMajor" $R0
483 ${StrTok} $R0 "${VERSION}" "." 1 0
484 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMinor" $R0
485 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoModify" 1
486 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoRepair" 1
487 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLUpdateInfo" "http://www.baculasystems.com"
488 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.baculasystems.com"
489 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "https://www.baculasystems.com/rt/"
490 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"'
491 WriteUninstaller "$INSTDIR\Uninstall.exe"
492 CreateShortCut "$SMPROGRAMS\Bacula\Uninstall Bacula.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
496 ; Extra Page descriptions
498 LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula Systems File Daemon on this system."
499 LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system."
500 LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install graphical console program on this system."
501 LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system."
502 LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system."
504 LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration"
505 LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration."
507 LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)"
508 LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration."
510 LangString TITLE_InstallType ${LANG_ENGLISH} "Installation Type"
511 LangString SUBTITLE_InstallType ${LANG_ENGLISH} "Choose installation type."
513 LangString TITLE_WriteTemplates ${LANG_ENGLISH} "Create Templates"
514 LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create resource templates for inclusion in the Director's configuration file."
516 !InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN
517 !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon)
518 !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole)
519 !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole)
520 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf)
521 !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml)
522 !InsertMacro MUI_FUNCTION_DESCRIPTION_END
526 UninstallText "This will uninstall Bacula. Hit next to continue."
529 ; Shutdown any baculum that could be running
530 nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /kill'
533 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd"
535 ; Remove bacula service
536 nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /remove'
537 nsExec::ExecToLog '"$INSTDIR\plugins\exchange-fd.dll" /remove'
540 ; remove registry keys
541 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula"
542 DeleteRegKey HKLM "Software\Bacula"
544 ; remove start menu items
545 SetShellVarContext all
546 Delete /REBOOTOK "$SMPROGRAMS\Bacula\*"
547 RMDir "$SMPROGRAMS\Bacula"
549 ; remove files and uninstaller (preserving config for now)
550 Delete /REBOOTOK "$INSTDIR\doc\*"
551 Delete /REBOOTOK "$INSTDIR\*"
553 ; Check for existing installation
554 MessageBox MB_YESNO|MB_ICONQUESTION \
555 "Would you like to delete the current configuration files and the working state file?" IDNO NoDel
556 Delete /REBOOTOK "$INSTDIR\*"
557 Delete /REBOOTOK "$INSTDIR\working\*"
558 Delete /REBOOTOK "$INSTDIR\plugins\*"
559 Delete /REBOOTOK "$PLUGINSDIR\bacula-*.conf"
560 Delete /REBOOTOK "$PLUGINSDIR\*console.conf"
561 Delete /REBOOTOK "$PLUGINSDIR\*conf.in"
562 Delete /REBOOTOK "$PLUGINSDIR\openssl.exe"
563 Delete /REBOOTOK "$PLUGINSDIR\libeay32.dll"
564 Delete /REBOOTOK "$PLUGINSDIR\ssleay32.dll"
565 Delete /REBOOTOK "$PLUGINSDIR\sed.exe"
566 Delete /REBOOTOK "$PLUGINSDIR\pw.txt"
567 Delete /REBOOTOK "$PLUGINSDIR\*.sed"
568 Delete /REBOOTOK "$PLUGINSDIR\*.cmd"
569 Delete /REBOOTOK "$PLUGINSDIR\*.sql"
570 RMDir "$INSTDIR\plugins"
571 RMDir "$INSTDIR\working"
575 ; remove directories used
581 ; $0 - Service Name (ie Bacula-FD)
582 ; $1 - Service Description (ie Bacula File Daemon)
583 ; $2 - Install as Service
584 ; $3 - Start Service now
586 Function InstallDaemon
587 Call InstallCommonFiles
589 WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2
592 nsExec::ExecToLog '"$INSTDIR\$0.exe" /install -c "$INSTDIR\$0.conf"'
603 nsExec::ExecToLog 'net start $0'
605 Exec '"$INSTDIR\$0.exe" -c "$INSTDIR\$0.conf"'
609 CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\$0.exe" '-c "$INSTDIR\$0.conf"' "$INSTDIR\$0.exe" 0
613 Function GetComputerName
618 System::Call "kernel32::GetComputerNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2"
620 ${StrCase} $R0 $R0 "L"
627 !define ComputerNameDnsFullyQualified 3
635 System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
638 DetailPrint "GetComputerNameExA failed - LastError = $R2"
654 !define NameUserPrincipal 8
662 System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
665 DetailPrint "GetUserNameExA failed - LastError = $R2"
676 System::Call "advapi32::GetUserNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e"
679 DetailPrint "GetUserNameA failed - LastError = $R2"
691 Function ConfigEditAndCopy
694 ${If} ${FileExists} "$0\$1"
700 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\$1"'
701 CopyFiles "$PLUGINSDIR\$1" "$0\$1$R1"
706 Function GetSelectedComponents
709 ${If} ${SectionIsSelected} ${SecFileDaemon}
710 IntOp $R0 $R0 | ${ComponentFile}
712 ${If} ${SectionIsSelected} ${SecConsole}
713 IntOp $R0 $R0 | ${ComponentTextConsole}
715 ${If} ${SectionIsSelected} ${SecWxConsole}
716 IntOp $R0 $R0 | ${ComponentGUIConsole}
718 ${If} ${SectionIsSelected} ${SecDocPdf}
719 IntOp $R0 $R0 | ${ComponentPDFDocs}
721 ${If} ${SectionIsSelected} ${SecDocHtml}
722 IntOp $R0 $R0 | ${ComponentHTMLDocs}
727 Function PageComponentsShow
729 Call SelectPreviousComponents
730 Call UpdateComponentUI
733 Function PageDirectoryPre
734 ${If} $AutomaticInstall = 1
735 ${OrIf} $InstallType = ${UpgradeInstall}
740 Function LeaveInstallPage
741 Push "$INSTDIR\install.log"
745 Function EnterWriteTemplates
749 Call GetSelectedComponents
752 IntOp $R0 $R0 & ${ComponentDirector}
753 IntOp $R1 $NewComponents & ${ComponentsFileAndStorage}
762 IntOp $R0 $NewComponents & ${ComponentFile}
764 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 0
765 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags DISABLED
766 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State
767 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED
769 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 1
770 DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags
771 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State "C:\$ConfigClientName.conf"
772 WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST
776 !InsertMacro MUI_HEADER_TEXT "$(TITLE_WriteTemplates)" "$(SUBTITLE_WriteTemplates)"
777 !InsertMacro MUI_INSTALLOPTIONS_DISPLAY "WriteTemplates.ini"
779 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 2" State
781 File "/oname=$PLUGINSDIR\client.conf.in" "client.conf.in"
783 nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\client.conf.in"'
784 !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 3" State
786 CopyFiles "$PLUGINSDIR\client.conf.in" "$R0"
795 Function SelectPreviousComponents
796 ${If} $InstallType <> ${NewInstall}
797 IntOp $R1 $PreviousComponents & ${ComponentFile}
799 !InsertMacro SelectSection ${SecFileDaemon}
800 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_RO}
802 !InsertMacro UnselectSection ${SecFileDaemon}
803 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_RO}
805 IntOp $R1 $PreviousComponents & ${ComponentTextConsole}
807 !InsertMacro SelectSection ${SecConsole}
808 !InsertMacro SetSectionFlag ${SecConsole} ${SF_RO}
810 !InsertMacro UnselectSection ${SecConsole}
811 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_RO}
813 IntOp $R1 $PreviousComponents & ${ComponentGUIConsole}
815 !InsertMacro SelectSection ${SecWxConsole}
816 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_RO}
818 !InsertMacro UnselectSection ${SecWxConsole}
819 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_RO}
821 IntOp $R1 $PreviousComponents & ${ComponentPDFDocs}
823 !InsertMacro SelectSection ${SecDocPdf}
824 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_RO}
826 !InsertMacro UnselectSection ${SecDocPdf}
827 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_RO}
829 IntOp $R1 $PreviousComponents & ${ComponentHTMLDocs}
831 !InsertMacro SelectSection ${SecDocHtml}
832 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_RO}
834 !InsertMacro UnselectSection ${SecDocHtml}
835 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_RO}
840 Function UpdateComponentUI
844 Call GetSelectedComponents
847 IntOp $R1 $R0 ^ $PreviousComponents
848 IntOp $NewComponents $R0 & $R1
850 ${If} $InstallType <> ${NewInstall}
851 IntOp $R1 $NewComponents & ${ComponentFile}
853 !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_BOLD}
855 !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_BOLD}
857 IntOp $R1 $NewComponents & ${ComponentTextConsole}
859 !InsertMacro SetSectionFlag ${SecConsole} ${SF_BOLD}
861 !InsertMacro ClearSectionFlag ${SecConsole} ${SF_BOLD}
863 IntOp $R1 $NewComponents & ${ComponentGUIConsole}
865 !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_BOLD}
867 !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_BOLD}
869 IntOp $R1 $NewComponents & ${ComponentPDFDocs}
871 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD}
873 !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_BOLD}
875 IntOp $R1 $NewComponents & ${ComponentHTMLDocs}
877 !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_BOLD}
879 !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_BOLD}
883 GetDlgItem $R0 $HWNDPARENT 1
885 IntOp $R1 $NewComponents & ${ComponentsRequiringUserConfig}
887 SendMessage $R0 ${WM_SETTEXT} 0 "STR:Install"
889 SendMessage $R0 ${WM_SETTEXT} 0 "STR:&Next >"
897 !include "InstallType.nsh"
898 !include "ConfigPage1.nsh"
899 !include "ConfigPage2.nsh"
900 !include "DumpLog.nsh"