From dcc331c085b02dd57a4ff2068e1e65b19fb4a07a Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 3 Mar 2011 15:57:23 +0100 Subject: [PATCH] Add tray monitor to windows installer --- bacula/src/win32/Makefile | 5 +- bacula/src/win32/win32_installer/Makefile | 2 +- .../win32_installer/tray-monitor.conf.in | 30 ++++++++++ .../src/win32/win32_installer/winbacula.nsi | 45 ++++++++++++++ bacula/src/win32/win64_installer/Makefile | 1 + .../win64_installer/tray-monitor.conf.in | 30 ++++++++++ .../src/win32/win64_installer/winbacula.nsi | 58 +++++++++++++++++++ 7 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 bacula/src/win32/win32_installer/tray-monitor.conf.in create mode 100644 bacula/src/win32/win64_installer/tray-monitor.conf.in diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index 3bea6ece63..01809c9e22 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -35,7 +35,10 @@ all: Makefile.inc $(DIRS) $(SPECIAL) $(INSTALLER) clean: $(DIRS) win32_installer win64_installer $(MAKE) -C tools clean - $(ECHO_CMD)-rm -rf release32 release64 + $(ECHO_CMD)-rm -rf release32 release64 ../qt-console/obj32 ../cats/obj32 ../wx-console/obj32 + $(ECHO_CMD)-rm -rf stored/obj32 dird/obj32 cats/obj32 wx-console/obj32 + $(ECHO_CMD)-rm -f ../qt-console/release/bat.exe ../qt-console/debug/bat.exe + $(ECHO_CMD)-rm -f ../qt-console/tray-monitor/release/bacula-tray-monitor.exe ../qt-console/tray-monitor/debug/bacula-tray-monitor.exe bat: (cd ../qt-console; ./make-win32) diff --git a/bacula/src/win32/win32_installer/Makefile b/bacula/src/win32/win32_installer/Makefile index 1004c67b80..e41d5bafbc 100644 --- a/bacula/src/win32/win32_installer/Makefile +++ b/bacula/src/win32/win32_installer/Makefile @@ -31,7 +31,7 @@ ifeq ($(bat),no) BACULA_BINARIES=$(BACULABINARIES) HELP= else - BACULA_BINARIES=$(BACULABINARIES) bat.exe + BACULA_BINARIES=$(BACULABINARIES) bat.exe bacula-tray-monitor.exe HELP=help endif diff --git a/bacula/src/win32/win32_installer/tray-monitor.conf.in b/bacula/src/win32/win32_installer/tray-monitor.conf.in new file mode 100644 index 0000000000..a9812256cf --- /dev/null +++ b/bacula/src/win32/win32_installer/tray-monitor.conf.in @@ -0,0 +1,30 @@ +# +# Bacula Tray Monitor Configuration File +# + +Monitor { + Name = @monitor_name@ + Password = "@mon_password@" # password for the Directors + RefreshInterval = 30 seconds +} + +Client { + Name = @client_name@ + Address = localhost + FDPort = @client_port@ + Password = "@monitor_password@" +} + +#Storage { +# Name = @basename@-sd +# Address = @hostname@ +# SDPort = @sd_port@ +# Password = "@mon_sd_password@" # password for StorageDaemon +#} +# +#Director { +# Name = @basename@-dir +# DIRport = @dir_port@ +# address = @hostname@ +#} +# diff --git a/bacula/src/win32/win32_installer/winbacula.nsi b/bacula/src/win32/win32_installer/winbacula.nsi index 49da832148..941295e223 100644 --- a/bacula/src/win32/win32_installer/winbacula.nsi +++ b/bacula/src/win32/win32_installer/winbacula.nsi @@ -182,6 +182,7 @@ Var NewComponents ; 5 = wxWidgits Console ; 6 = Documentation (PDF) ; 7 = Documentation (HTML) +; 10 = Tray Monitor !define ComponentFile 1 !define ComponentStorage 2 @@ -191,6 +192,7 @@ Var NewComponents !define ComponentGUIConsole 32 !define ComponentPDFDocs 64 !define ComponentHTMLDocs 128 +!define ComponentTrayMonitor 1024 !define ComponentsRequiringUserConfig 63 !define ComponentsFileAndStorage 3 @@ -524,6 +526,30 @@ Section "Bat Console" SecBatConsole SectionEnd +Section "Bacula Tray Monitor" SecTrayMonitor + SectionIn 1 2 3 + + SetOutPath "$INSTDIR" + +!if "${BUILD_BAT}" == "yes" + Call InstallCommonFiles + File "${SRC_DIR}\QtCore4.dll" + File "${SRC_DIR}\QtGui4.dll" + File "${SRC_DIR}\libgcc_s_dw2-1.dll" + + File "${SRC_DIR}\bacula-tray-monitor.exe" + + File "/oname=$PLUGINSDIR\tray-monitor.conf" "tray-monitor.conf.in" + StrCpy $0 "$INSTDIR" + StrCpy $1 tray-monitor.conf + Call ConfigEditAndCopy + + ; Create Start Menu entry + CreateShortCut "$SMPROGRAMS\Bacula\TrayMonitor.lnk" "$INSTDIR\bacula-tray-monitor.exe" '-c "$INSTDIR\tray-monitor.conf"' "$INSTDIR\bacula-tray-monitor.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Tray Monitor Configuration.lnk" "write.exe" '"$INSTDIR\tray-monitor.conf"' +!endif + +SectionEnd ; Deleted because wxconsole is deprecated ;Section "Graphical Console" SecWxConsole @@ -601,6 +627,7 @@ SectionEnd LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system." LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system." LangString DESC_SecBatConsole ${LANG_ENGLISH} "Install Bat graphical console program on this system." +LangString DESC_SecTrayMonitor ${LANG_ENGLISH} "Install Tray Monitor graphical program on this system." LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration" LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration." @@ -618,6 +645,7 @@ LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create a resource template f !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon) !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole) !InsertMacro MUI_DESCRIPTION_TEXT ${SecBatConsole} $(DESC_SecBatConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecTrayMonitor} $(DESC_SecTrayMonitor) !InsertMacro MUI_FUNCTION_DESCRIPTION_END ; Uninstall section @@ -817,6 +845,9 @@ Function GetSelectedComponents ${If} ${SectionIsSelected} ${SecBatConsole} IntOp $R0 $R0 | ${ComponentBatConsole} ${EndIf} + ${If} ${SectionIsSelected} ${SecTrayMonitor} + IntOp $R0 $R0 | ${ComponentTrayMonitor} + ${EndIf} ${If} ${SectionIsSelected} ${SecDocPdf} IntOp $R0 $R0 | ${ComponentPDFDocs} ${EndIf} @@ -915,6 +946,14 @@ Function SelectPreviousComponents !InsertMacro UnselectSection ${SecBatConsole} !InsertMacro ClearSectionFlag ${SecBatConsole} ${SF_RO} ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentTrayMonitor} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecTrayMonitor} + !InsertMacro SetSectionFlag ${SecTrayMonitor} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecTrayMonitor} + !InsertMacro ClearSectionFlag ${SecTrayMonitor} ${SF_RO} + ${EndIf} ${If} $R1 <> 0 !InsertMacro SelectSection ${SecDocPdf} !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_RO} @@ -954,6 +993,12 @@ Function UpdateComponentUI ${Else} !InsertMacro ClearSectionFlag ${SecBatConsole} ${SF_BOLD} ${EndIf} + IntOp $R1 $NewComponents & ${ComponentTrayMonitor} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecTrayMonitor} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecTrayMonitor} ${SF_BOLD} + ${EndIf} IntOp $R1 $NewComponents & ${ComponentPDFDocs} ${If} $R1 <> 0 !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD} diff --git a/bacula/src/win32/win64_installer/Makefile b/bacula/src/win32/win64_installer/Makefile index eddc9a8273..ba8e0caa91 100644 --- a/bacula/src/win32/win64_installer/Makefile +++ b/bacula/src/win32/win64_installer/Makefile @@ -157,6 +157,7 @@ $(foreach file,$(addprefix $(DEPKGS32)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Bi $(INSTALL_EXE): winbacula.nsi $(addprefix release64/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(DEPKGS32_BINARIES) $(SSL_FILES) ) cp -f ../release32/bat.exe release64 + cp -f ../release32/bacula-tray-monitor.exe release64 cp -f ../release32/QtCore4.dll release64 cp -f ../release32/QtGui4.dll release64 cp -f ../win32_installer/release32/libgcc_s_dw2-1.dll release64 diff --git a/bacula/src/win32/win64_installer/tray-monitor.conf.in b/bacula/src/win32/win64_installer/tray-monitor.conf.in new file mode 100644 index 0000000000..a9812256cf --- /dev/null +++ b/bacula/src/win32/win64_installer/tray-monitor.conf.in @@ -0,0 +1,30 @@ +# +# Bacula Tray Monitor Configuration File +# + +Monitor { + Name = @monitor_name@ + Password = "@mon_password@" # password for the Directors + RefreshInterval = 30 seconds +} + +Client { + Name = @client_name@ + Address = localhost + FDPort = @client_port@ + Password = "@monitor_password@" +} + +#Storage { +# Name = @basename@-sd +# Address = @hostname@ +# SDPort = @sd_port@ +# Password = "@mon_sd_password@" # password for StorageDaemon +#} +# +#Director { +# Name = @basename@-dir +# DIRport = @dir_port@ +# address = @hostname@ +#} +# diff --git a/bacula/src/win32/win64_installer/winbacula.nsi b/bacula/src/win32/win64_installer/winbacula.nsi index 59b5a15c93..b9f5772e04 100644 --- a/bacula/src/win32/win64_installer/winbacula.nsi +++ b/bacula/src/win32/win64_installer/winbacula.nsi @@ -189,6 +189,7 @@ Var NewComponents ; 5 = wxWidgits Console ; 6 = Documentation (PDF) ; 7 = Documentation (HTML) +; 10 = Tray Monitor !define ComponentFile 1 !define ComponentStorage 2 @@ -198,6 +199,7 @@ Var NewComponents !define ComponentGUIConsole 32 !define ComponentPDFDocs 64 !define ComponentHTMLDocs 128 +!define ComponentTrayMonitor 1024 !define ComponentsRequiringUserConfig 63 !define ComponentsFileAndStorage 3 @@ -534,6 +536,43 @@ Section "Bat Console" SecBatConsole SetOutPath "$INSTDIR" SectionEnd +Section "Tray Monitor" SecTrayMonitor + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin32" + + Call InstallCommonFiles + File "${SRC_DIR}\QtCore4.dll" + File "${SRC_DIR}\QtGui4.dll" + File "${SRC_DIR}\libgcc_s_dw2-1.dll" + File "${SRC_DIR}\mingwm10.dll" + File "${SRC_DIR}\ssleay32.dll" + File "${SRC_DIR}\libeay32.dll" + File "${SRC_DIR}\bacula-tray-monitor.exe" + File "/oname=$INSTDIR\bin32\bacula.dll" "${SRC_DIR}\bacula32.dll" + File "/oname=$INSTDIR\bin32\pthreadGCE.dll" "${SRC_DIR}\pthreadGCE32.dll" + File "/oname=$INSTDIR\bin32\zlib1.dll" "${SRC_DIR}\zlib132.dll" + + File "/oname=$PLUGINSDIR\tray-monitor.conf" "tray-monitor.conf.in" + StrCpy $0 "$INSTDIR\bin32" + StrCpy $1 tray-monitor.conf + Call ConfigEditAndCopy + + ; Create Start Menu entry + CreateShortCut "$SMPROGRAMS\Bacula\TrayMonitor.lnk" "$INSTDIR\bin32\bacula-tray-monitor.exe" '-c "$INSTDIR\bin32\tray-monitor.conf"' "$INSTDIR\bin32\bacula-tray-monitor.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Tray Monitor Configuration.lnk" "write.exe" '"$INSTDIR\bin32\tray-monitor.conf"' + SetOutPath "$INSTDIR" + +SectionEnd + +; Deleted because wxconsole is deprecated +;Section "Graphical Console" SecWxConsole +; SectionIn 1 2 3 + +; SetOutPath "$INSTDIR" +; +;SectionEnd + SectionGroupEnd @@ -568,6 +607,7 @@ SectionEnd LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system." LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system." LangString DESC_SecBatConsole ${LANG_ENGLISH} "Install Bat graphical console program on this system." +LangString DESC_SecTrayMonitor ${LANG_ENGLISH} "Install Tray Monitor graphical program on this system." LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration" LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration." @@ -585,6 +625,7 @@ LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create a resource template f !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon) !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole) !InsertMacro MUI_DESCRIPTION_TEXT ${SecBatConsole} $(DESC_SecBatConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecTrayMonitor} $(DESC_SecTrayMonitor) !InsertMacro MUI_FUNCTION_DESCRIPTION_END ; Uninstall section @@ -786,6 +827,9 @@ Function GetSelectedComponents ${If} ${SectionIsSelected} ${SecBatConsole} IntOp $R0 $R0 | ${ComponentBatConsole} ${EndIf} + ${If} ${SectionIsSelected} ${SecTrayMonitor} + IntOp $R0 $R0 | ${ComponentTrayMonitor} + ${EndIf} Exch $R0 FunctionEnd @@ -882,6 +926,14 @@ Function SelectPreviousComponents !InsertMacro UnselectSection ${SecBatConsole} !InsertMacro ClearSectionFlag ${SecBatConsole} ${SF_RO} ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentTrayMonitor} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecTrayMonitor} + !InsertMacro SetSectionFlag ${SecTrayMonitor} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecTrayMonitor} + !InsertMacro ClearSectionFlag ${SecTrayMonitor} ${SF_RO} + ${EndIf} ${EndIf} FunctionEnd @@ -914,6 +966,12 @@ Function UpdateComponentUI ${Else} !InsertMacro ClearSectionFlag ${SecBatConsole} ${SF_BOLD} ${EndIf} + IntOp $R1 $NewComponents & ${ComponentTrayMonitor} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecTrayMonitor} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecTrayMonitor} ${SF_BOLD} + ${EndIf} ${EndIf} GetDlgItem $R0 $HWNDPARENT 1 -- 2.39.5