From 0608f740663c613900e9717d2d259bb5b4368335 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 3 Apr 2009 09:16:48 +0000 Subject: [PATCH] Implement more automatic build of Win64 client. Note, there are still lots of warning messages, but it seems to build a correct binary. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8681 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/findlib/attribs.c | 6 +- bacula/src/findlib/enable_priv.c | 6 +- bacula/src/win32/Makefile | 48 +- bacula/src/win32/compat/print.cpp | 2 +- bacula/src/win32/lib/bacula32.def | 4 +- bacula/src/win32/lib/bacula64.def | 6 +- bacula/src/win32/libwin32/protos.h | 4 +- bacula/src/win32/libwin32/service.cpp | 6 +- bacula/src/win32/makewin64 | 2 + bacula/src/win32/tools/Makefile | 5 +- .../ConfigPage1.nsh | 0 .../ConfigPage2.nsh | 0 .../DumpLog.nsh | 0 .../InstallType.ini | 0 .../InstallType.nsh | 0 .../{installer => win32_installer}/Makefile | 0 .../{installer => win32_installer}/Readme.txt | 0 .../{installer => win32_installer}/Start.bat | 0 .../{installer => win32_installer}/Stop.bat | 0 .../WriteTemplates.ini | 0 .../bacula-dir.conf.in | 0 .../bacula-fd.conf.in | 0 .../bacula-logo.bmp | Bin .../bacula-sd.conf.in | 0 .../bconsole.conf.in | 0 .../build-installer.cmd | 0 .../bwx-console.conf.in | 0 .../client.conf.in | 0 .../installer.vcproj | 0 .../storage.conf.in | 0 .../winbacula.nsi | 0 .../src/win32/win64_installer/ConfigPage1.nsh | 294 ++++++ .../src/win32/win64_installer/ConfigPage2.nsh | 454 +++++++++ bacula/src/win32/win64_installer/DumpLog.nsh | 46 + .../src/win32/win64_installer/InstallType.ini | 51 + .../src/win32/win64_installer/InstallType.nsh | 98 ++ bacula/src/win32/win64_installer/Makefile | 160 ++++ bacula/src/win32/win64_installer/Readme.txt | 48 + bacula/src/win32/win64_installer/Start.bat | 5 + bacula/src/win32/win64_installer/Stop.bat | 5 + .../win32/win64_installer/WriteTemplates.ini | 48 + .../win32/win64_installer/bacula-dir.conf.in | 384 ++++++++ .../win32/win64_installer/bacula-fd.conf.in | 44 + .../src/win32/win64_installer/bacula-logo.bmp | Bin 0 -> 52254 bytes .../win32/win64_installer/bacula-sd.conf.in | 115 +++ .../win32/win64_installer/bconsole.conf.in | 10 + .../win32/win64_installer/bwx-console.conf.in | 10 + .../src/win32/win64_installer/client.conf.in | 11 + .../win32/win64_installer/installer.vcproj | 154 +++ .../src/win32/win64_installer/storage.conf.in | 10 + .../src/win32/win64_installer/winbacula.nsi | 900 ++++++++++++++++++ bacula/technotes | 7 +- 52 files changed, 2912 insertions(+), 31 deletions(-) create mode 100755 bacula/src/win32/makewin64 rename bacula/src/win32/{installer => win32_installer}/ConfigPage1.nsh (100%) rename bacula/src/win32/{installer => win32_installer}/ConfigPage2.nsh (100%) rename bacula/src/win32/{installer => win32_installer}/DumpLog.nsh (100%) rename bacula/src/win32/{installer => win32_installer}/InstallType.ini (100%) rename bacula/src/win32/{installer => win32_installer}/InstallType.nsh (100%) rename bacula/src/win32/{installer => win32_installer}/Makefile (100%) rename bacula/src/win32/{installer => win32_installer}/Readme.txt (100%) rename bacula/src/win32/{installer => win32_installer}/Start.bat (100%) rename bacula/src/win32/{installer => win32_installer}/Stop.bat (100%) rename bacula/src/win32/{installer => win32_installer}/WriteTemplates.ini (100%) rename bacula/src/win32/{installer => win32_installer}/bacula-dir.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/bacula-fd.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/bacula-logo.bmp (100%) rename bacula/src/win32/{installer => win32_installer}/bacula-sd.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/bconsole.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/build-installer.cmd (100%) rename bacula/src/win32/{installer => win32_installer}/bwx-console.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/client.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/installer.vcproj (100%) rename bacula/src/win32/{installer => win32_installer}/storage.conf.in (100%) rename bacula/src/win32/{installer => win32_installer}/winbacula.nsi (100%) create mode 100644 bacula/src/win32/win64_installer/ConfigPage1.nsh create mode 100644 bacula/src/win32/win64_installer/ConfigPage2.nsh create mode 100644 bacula/src/win32/win64_installer/DumpLog.nsh create mode 100644 bacula/src/win32/win64_installer/InstallType.ini create mode 100644 bacula/src/win32/win64_installer/InstallType.nsh create mode 100644 bacula/src/win32/win64_installer/Makefile create mode 100755 bacula/src/win32/win64_installer/Readme.txt create mode 100644 bacula/src/win32/win64_installer/Start.bat create mode 100644 bacula/src/win32/win64_installer/Stop.bat create mode 100644 bacula/src/win32/win64_installer/WriteTemplates.ini create mode 100644 bacula/src/win32/win64_installer/bacula-dir.conf.in create mode 100644 bacula/src/win32/win64_installer/bacula-fd.conf.in create mode 100644 bacula/src/win32/win64_installer/bacula-logo.bmp create mode 100644 bacula/src/win32/win64_installer/bacula-sd.conf.in create mode 100644 bacula/src/win32/win64_installer/bconsole.conf.in create mode 100644 bacula/src/win32/win64_installer/bwx-console.conf.in create mode 100644 bacula/src/win32/win64_installer/client.conf.in create mode 100644 bacula/src/win32/win64_installer/installer.vcproj create mode 100644 bacula/src/win32/win64_installer/storage.conf.in create mode 100644 bacula/src/win32/win64_installer/winbacula.nsi diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index 341ec2206c..6160706369 100644 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -48,7 +48,7 @@ static bool uid_set = false; /* Forward referenced subroutines */ static bool set_win32_attributes(JCR *jcr, ATTR *attr, BFILE *ofd); void unix_name_to_win32(POOLMEM **win32_name, char *name); -void win_error(JCR *jcr, char *prefix, POOLMEM *ofile); +void win_error(JCR *jcr, const char *prefix, POOLMEM *ofile); HANDLE bget_handle(BFILE *bfd); #endif /* HAVE_WIN32 */ @@ -720,7 +720,7 @@ static bool set_win32_attributes(JCR *jcr, ATTR *attr, BFILE *ofd) return true; } -void win_error(JCR *jcr, char *prefix, POOLMEM *win32_ofile) +void win_error(JCR *jcr, const char *prefix, POOLMEM *win32_ofile) { DWORD lerror = GetLastError(); LPTSTR msg; @@ -738,7 +738,7 @@ void win_error(JCR *jcr, char *prefix, POOLMEM *win32_ofile) LocalFree(msg); } -void win_error(JCR *jcr, char *prefix, DWORD lerror) +void win_error(JCR *jcr, const char *prefix, DWORD lerror) { LPTSTR msg; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER| diff --git a/bacula/src/findlib/enable_priv.c b/bacula/src/findlib/enable_priv.c index 9f13730e4b..b13a9ea951 100644 --- a/bacula/src/findlib/enable_priv.c +++ b/bacula/src/findlib/enable_priv.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2003-2008 Free Software Foundation Europe e.V. + Copyright (C) 2003-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -63,10 +63,10 @@ int enable_backup_privileges(JCR *jcr, int ignore_errors) #if defined(HAVE_WIN32) -void win_error(JCR *jcr, char *prefix, DWORD lerror); +void win_error(JCR *jcr, const char *prefix, DWORD lerror); static int -enable_priv(JCR *jcr, HANDLE hToken, char *name, int ignore_errors) +enable_priv(JCR *jcr, HANDLE hToken, const char *name, int ignore_errors) { TOKEN_PRIVILEGES tkp; DWORD lerror; diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index c0049f9bae..abf998b2bb 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -1,10 +1,14 @@ ECHO_CMD=@ ifeq ($(WIN64),yes) - DIRS= lib \ - filed \ - filed/plugins \ - scripts + DIRS= lib \ + filed \ + filed/plugins \ + scripts + + INSTALLER=win64_installer + + SPECIAL=bsmtp else DIRS= lib \ cats \ @@ -16,14 +20,17 @@ else wx-console \ tools \ scripts -endif -.PHONY: $(DIRS) clean all Makefile.inc installer newinstaller + INSTALLER=win32_installer newinstaller -all: Makefile.inc $(DIRS) installer newinstaller + SPECIAL= +endif + +.PHONY: $(DIRS) clean all Makefile.inc win32_installer newinstaller win64_installer bsmtp +all: Makefile.inc $(DIRS) $(SPECIAL) $(INSTALLER) -clean: $(DIRS) installer newinstaller +clean: $(DIRS) win32_installer newinstaller win64_installer $(ECHO_CMD)-rm -rf release newinstaller: @@ -35,7 +42,16 @@ newinstaller: fi ; \ fi -installer: +win32_installer: + @if test -f Makefile.inc; then \ + if $(MAKE) -C $@ $(MAKECMDGOALS); then \ + echo "\n===== Make of $@ succeeded =====\n\n" ; \ + else \ + echo "\n!!!!! Make of $@ failed !!!!!\n\n" ; \ + fi ; \ + fi + +win64_installer: @if test -f Makefile.inc; then \ if $(MAKE) -C $@ $(MAKECMDGOALS); then \ echo "\n===== Make of $@ succeeded =====\n\n" ; \ @@ -44,6 +60,7 @@ installer: fi ; \ fi + $(DIRS): @if test -f Makefile.inc; then \ if $(MAKE) -C $@ $(MAKECMDGOALS); then \ @@ -53,16 +70,25 @@ $(DIRS): fi ; \ fi +bsmtp: + @if test -f Makefile.inc; then \ + if $(MAKE) -C tools bsmtp $(MAKECMDGOALS); then \ + echo "\n===== Make of tools/bsmtp succeeded =====\n\n" ; \ + else \ + echo "\n!!!!! Make of tools/bsmtp failed !!!!!\n\n" ; \ + fi ; \ + fi + Makefile.inc: @echo Creating $@ $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \ - if test "$(WIN64)" = yes -a -e ../../../cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc; then \ + if test "$(WIN64)" = yes -a -e $${TOPDIR}/cross-tools/mingw-w64/bin/x86_64-pc-mingw32-gcc; then \ BINDIR=$${TOPDIR}/cross-tools/mingw-w64/bin; \ INCDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/include; \ DLLDIR=$${TOPDIR}/cross-tools/mingw-w64/x86_64-pc-mingw32/bin; \ DEPKGSDIR=depkgs-mingw-w64; \ DEPKGSDIR32=depkgs-mingw32; \ - elif test -e ../../../cross-tools/mingw32/bin/mingw32-gcc; then \ + elif test -e $${TOPDIR}/cross-tools/mingw32/bin/mingw32-gcc; then \ BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \ INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \ DLLDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/bin; \ diff --git a/bacula/src/win32/compat/print.cpp b/bacula/src/win32/compat/print.cpp index d648fa14d1..4fa0053947 100644 --- a/bacula/src/win32/compat/print.cpp +++ b/bacula/src/win32/compat/print.cpp @@ -408,7 +408,7 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen, int cnt = 0; if (value == NULL) - value = ""; + value = (char *)""; for (strln = 0; value[strln]; ++strln); /* strlen */ padlen = min - strln; diff --git a/bacula/src/win32/lib/bacula32.def b/bacula/src/win32/lib/bacula32.def index 6048d58506..15e0c2820f 100644 --- a/bacula/src/win32/lib/bacula32.def +++ b/bacula/src/win32/lib/bacula32.def @@ -95,8 +95,8 @@ _Z4plugImEvRT_y _Z4plugIsEvRT_y _Z4plugItEvRT_y _Z4plugIyEvRT_y -_Z9win_errorP3JCRPcS1_ -_Z9win_errorP3JCRPcm +_Z9win_errorP3JCRPKcm +_Z9win_errorP3JCRPKcPc ; bfile.o _Z11bget_handleP5BFILE diff --git a/bacula/src/win32/lib/bacula64.def b/bacula/src/win32/lib/bacula64.def index ff4efdeb54..f0718bbfe6 100644 --- a/bacula/src/win32/lib/bacula64.def +++ b/bacula/src/win32/lib/bacula64.def @@ -68,7 +68,7 @@ utime ; plugins.o _Z10new_pluginv -_Z12load_pluginsPvS_PKcS1_ +_Z12load_pluginsPvS_PKcS1_PFbP6PluginE _Z14unload_pluginsv _Z19dbg_plugin_add_hookPFvP6PluginP6_iobufE @@ -89,8 +89,8 @@ _Z13decode_LinkFIPcP4stat _Z14set_attributesP3JCRP4ATTRP5BFILE _Z16encode_attribsExP3JCRPcP6FF_PKT _Z18select_data_streamP6FF_PKT -_Z9win_errorP3JCRPcS1_ -_Z9win_errorP3JCRPcm +_Z9win_errorP3JCRPKcm +_Z9win_errorP3JCRPKcPc ; bfile.o _Z11bget_handleP5BFILE diff --git a/bacula/src/win32/libwin32/protos.h b/bacula/src/win32/libwin32/protos.h index 0c913d8847..ad1b9d567b 100644 --- a/bacula/src/win32/libwin32/protos.h +++ b/bacula/src/win32/libwin32/protos.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2008 Free Software Foundation Europe e.V. + Copyright (C) 2007-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -34,7 +34,7 @@ #define log_error_message(msg) LogErrorMsg((msg), __FILE__, __LINE__) extern int BaculaAppMain(); -extern void LogErrorMsg(char *msg, char *fname, int lineno); +extern void LogErrorMsg(const char *msg, const char *fname, int lineno); extern int BaculaMain(int argc, char *argv[]); extern BOOL ReportStatus(DWORD state, DWORD exitcode, DWORD waithint); diff --git a/bacula/src/win32/libwin32/service.cpp b/bacula/src/win32/libwin32/service.cpp index 9de056276c..cc29860023 100644 --- a/bacula/src/win32/libwin32/service.cpp +++ b/bacula/src/win32/libwin32/service.cpp @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2008 Free Software Foundation Europe e.V. + Copyright (C) 2007-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -471,11 +471,11 @@ BOOL ReportStatus(DWORD state, DWORD exitcode, DWORD waithint) } /* Log an error message */ -void LogErrorMsg(char *message, char *fname, int lineno) +void LogErrorMsg(const char *message, const char *fname, int lineno) { char msgbuf[500]; HANDLE eventHandler; - char *strings[3]; + const char *strings[3]; LPTSTR msg; service_error = GetLastError(); diff --git a/bacula/src/win32/makewin64 b/bacula/src/win32/makewin64 new file mode 100755 index 0000000000..cacae3a17c --- /dev/null +++ b/bacula/src/win32/makewin64 @@ -0,0 +1,2 @@ +#!/bin/sh +make WIN64=yes diff --git a/bacula/src/win32/tools/Makefile b/bacula/src/win32/tools/Makefile index ec9e9aab13..84fabca276 100644 --- a/bacula/src/win32/tools/Makefile +++ b/bacula/src/win32/tools/Makefile @@ -48,7 +48,7 @@ ALL_OBJS = \ # Targets -.PHONY: all clean +.PHONY: all clean bsmtp all: \ $(BINDIR)/bsmtp.exe $(BINDIR)/dbcheck.exe $(BINDIR)/scsilist.exe \ @@ -56,6 +56,9 @@ all: \ $(BINDIR)/testfind.exe $(BINDIR)/testls.exe \ $(BINDIR)/bregex.exe $(BINDIR)/bwild.exe +bsmtp: \ + $(BINDIR)/bsmtp.exe + clean: @echo "Cleaning `pwd`" $(call clean_obj,$(ALL_OBJS)) diff --git a/bacula/src/win32/installer/ConfigPage1.nsh b/bacula/src/win32/win32_installer/ConfigPage1.nsh similarity index 100% rename from bacula/src/win32/installer/ConfigPage1.nsh rename to bacula/src/win32/win32_installer/ConfigPage1.nsh diff --git a/bacula/src/win32/installer/ConfigPage2.nsh b/bacula/src/win32/win32_installer/ConfigPage2.nsh similarity index 100% rename from bacula/src/win32/installer/ConfigPage2.nsh rename to bacula/src/win32/win32_installer/ConfigPage2.nsh diff --git a/bacula/src/win32/installer/DumpLog.nsh b/bacula/src/win32/win32_installer/DumpLog.nsh similarity index 100% rename from bacula/src/win32/installer/DumpLog.nsh rename to bacula/src/win32/win32_installer/DumpLog.nsh diff --git a/bacula/src/win32/installer/InstallType.ini b/bacula/src/win32/win32_installer/InstallType.ini similarity index 100% rename from bacula/src/win32/installer/InstallType.ini rename to bacula/src/win32/win32_installer/InstallType.ini diff --git a/bacula/src/win32/installer/InstallType.nsh b/bacula/src/win32/win32_installer/InstallType.nsh similarity index 100% rename from bacula/src/win32/installer/InstallType.nsh rename to bacula/src/win32/win32_installer/InstallType.nsh diff --git a/bacula/src/win32/installer/Makefile b/bacula/src/win32/win32_installer/Makefile similarity index 100% rename from bacula/src/win32/installer/Makefile rename to bacula/src/win32/win32_installer/Makefile diff --git a/bacula/src/win32/installer/Readme.txt b/bacula/src/win32/win32_installer/Readme.txt similarity index 100% rename from bacula/src/win32/installer/Readme.txt rename to bacula/src/win32/win32_installer/Readme.txt diff --git a/bacula/src/win32/installer/Start.bat b/bacula/src/win32/win32_installer/Start.bat similarity index 100% rename from bacula/src/win32/installer/Start.bat rename to bacula/src/win32/win32_installer/Start.bat diff --git a/bacula/src/win32/installer/Stop.bat b/bacula/src/win32/win32_installer/Stop.bat similarity index 100% rename from bacula/src/win32/installer/Stop.bat rename to bacula/src/win32/win32_installer/Stop.bat diff --git a/bacula/src/win32/installer/WriteTemplates.ini b/bacula/src/win32/win32_installer/WriteTemplates.ini similarity index 100% rename from bacula/src/win32/installer/WriteTemplates.ini rename to bacula/src/win32/win32_installer/WriteTemplates.ini diff --git a/bacula/src/win32/installer/bacula-dir.conf.in b/bacula/src/win32/win32_installer/bacula-dir.conf.in similarity index 100% rename from bacula/src/win32/installer/bacula-dir.conf.in rename to bacula/src/win32/win32_installer/bacula-dir.conf.in diff --git a/bacula/src/win32/installer/bacula-fd.conf.in b/bacula/src/win32/win32_installer/bacula-fd.conf.in similarity index 100% rename from bacula/src/win32/installer/bacula-fd.conf.in rename to bacula/src/win32/win32_installer/bacula-fd.conf.in diff --git a/bacula/src/win32/installer/bacula-logo.bmp b/bacula/src/win32/win32_installer/bacula-logo.bmp similarity index 100% rename from bacula/src/win32/installer/bacula-logo.bmp rename to bacula/src/win32/win32_installer/bacula-logo.bmp diff --git a/bacula/src/win32/installer/bacula-sd.conf.in b/bacula/src/win32/win32_installer/bacula-sd.conf.in similarity index 100% rename from bacula/src/win32/installer/bacula-sd.conf.in rename to bacula/src/win32/win32_installer/bacula-sd.conf.in diff --git a/bacula/src/win32/installer/bconsole.conf.in b/bacula/src/win32/win32_installer/bconsole.conf.in similarity index 100% rename from bacula/src/win32/installer/bconsole.conf.in rename to bacula/src/win32/win32_installer/bconsole.conf.in diff --git a/bacula/src/win32/installer/build-installer.cmd b/bacula/src/win32/win32_installer/build-installer.cmd similarity index 100% rename from bacula/src/win32/installer/build-installer.cmd rename to bacula/src/win32/win32_installer/build-installer.cmd diff --git a/bacula/src/win32/installer/bwx-console.conf.in b/bacula/src/win32/win32_installer/bwx-console.conf.in similarity index 100% rename from bacula/src/win32/installer/bwx-console.conf.in rename to bacula/src/win32/win32_installer/bwx-console.conf.in diff --git a/bacula/src/win32/installer/client.conf.in b/bacula/src/win32/win32_installer/client.conf.in similarity index 100% rename from bacula/src/win32/installer/client.conf.in rename to bacula/src/win32/win32_installer/client.conf.in diff --git a/bacula/src/win32/installer/installer.vcproj b/bacula/src/win32/win32_installer/installer.vcproj similarity index 100% rename from bacula/src/win32/installer/installer.vcproj rename to bacula/src/win32/win32_installer/installer.vcproj diff --git a/bacula/src/win32/installer/storage.conf.in b/bacula/src/win32/win32_installer/storage.conf.in similarity index 100% rename from bacula/src/win32/installer/storage.conf.in rename to bacula/src/win32/win32_installer/storage.conf.in diff --git a/bacula/src/win32/installer/winbacula.nsi b/bacula/src/win32/win32_installer/winbacula.nsi similarity index 100% rename from bacula/src/win32/installer/winbacula.nsi rename to bacula/src/win32/win32_installer/winbacula.nsi diff --git a/bacula/src/win32/win64_installer/ConfigPage1.nsh b/bacula/src/win32/win64_installer/ConfigPage1.nsh new file mode 100644 index 0000000000..71965a2a38 --- /dev/null +++ b/bacula/src/win32/win64_installer/ConfigPage1.nsh @@ -0,0 +1,294 @@ +Function EnterConfigPage1 + ${If} $AutomaticInstall = 1 + Abort + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentsFileAndStorage} + + ${If} $R0 = 0 + Abort + ${EndIf} + + FileOpen $R5 "$PLUGINSDIR\ConfigPage1.ini" w + + StrCpy $R6 1 ; Field Number + StrCpy $R7 0 ; Top + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 + IntOp $R8 $R7 + 52 + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Client"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigClientName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 2 + + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigClientPort$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=218$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 2 + + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Max Jobs"$\r$\nLeft=238$\r$\nTop=$R7$\r$\nRight=270$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigClientMaxJobs$\r$\nLeft=274$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigClientPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 + + IntOp $R8 $R7 + 10 + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigClientInstallService$\r$\nText="Install as service"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=118$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigClientStartService$\r$\nText="Start after install"$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=260$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + ${Endif} + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 + IntOp $R8 $R7 + 52 + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Storage"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigStorageName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 2 + + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigStoragePort$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=218$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 2 + + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Max Jobs"$\r$\nLeft=238$\r$\nTop=$R7$\r$\nRight=270$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigStorageMaxJobs$\r$\nLeft=274$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigStoragePassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 + + IntOp $R8 $R7 + 10 + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigStorageInstallService$\r$\nText="Install as service"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=118$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigStorageStartService$\r$\nText="Start after install"$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=260$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + ${Endif} + + IntOp $R6 $R6 - 1 + + FileWrite $R5 "[Settings]$\r$\nNumFields=$R6$\r$\n" + + FileClose $R5 + + !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage1)" "$(SUBTITLE_ConfigPage1)" + !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ConfigPage1.ini" + Pop $HDLG ;HWND of dialog + + ; Initialize Controls + + StrCpy $R6 1 ; Field Number + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + + ; Client Name + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage1.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 30 0 + + IntOp $R6 $R6 + 2 + + ; Client Port Number + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage1.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 5 0 + + IntOp $R6 $R6 + 2 + + ; Max Jobs + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage1.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 3 0 + + IntOp $R6 $R6 + 5 + ${Endif} + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + + ; Storage Name + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage1.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 30 0 + + IntOp $R6 $R6 + 2 + + ; Storage Port Number + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage1.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 5 0 + + IntOp $R6 $R6 + 2 + + ; Max Jobs + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage1.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 3 0 + + IntOp $R6 $R6 + 5 + ${Endif} + + !insertmacro MUI_INSTALLOPTIONS_SHOW + + ; Process results + + StrCpy $R6 3 + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientName "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientPort "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientMaxJobs "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientPassword "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 1 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientInstallService "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 1 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientStartService "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 3 + ${Endif} + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStorageName "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStoragePort "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStorageMaxJobs "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStoragePassword "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 1 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStorageInstallService "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 1 + + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStorageStartService "ConfigPage1.ini" "Field $R6" "State" + + IntOp $R6 $R6 + 3 + ${Endif} +FunctionEnd + +Function LeaveConfigPage1 + StrCpy $R6 5 + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage1.ini" "Field $R6" "State" + ${If} $R0 < 1024 + ${OrIf} $R0 > 65535 + MessageBox MB_OK "Port must be between 1024 and 65535 inclusive." + Abort + ${EndIf} + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage1.ini" "Field $R6" "State" + ${If} $R0 < 1 + ${OrIf} $R0 > 99 + MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive." + Abort + ${EndIf} + + IntOp $R6 $R6 + 9 + ${Endif} + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage1.ini" "Field $R6" "State" + ${If} $R0 < 1024 + ${OrIf} $R0 > 65535 + MessageBox MB_OK "Port must be between 1024 and 65535 inclusive." + Abort + ${EndIf} + + IntOp $R6 $R6 + 2 + + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage1.ini" "Field $R6" "State" + ${If} $R0 < 1 + ${OrIf} $R0 > 99 + MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive." + Abort + ${EndIf} + + IntOp $R6 $R6 + 9 + ${Endif} +FunctionEnd diff --git a/bacula/src/win32/win64_installer/ConfigPage2.nsh b/bacula/src/win32/win64_installer/ConfigPage2.nsh new file mode 100644 index 0000000000..321d7b98cc --- /dev/null +++ b/bacula/src/win32/win64_installer/ConfigPage2.nsh @@ -0,0 +1,454 @@ +Function EnterConfigPage2 + IntOp $R0 $NewComponents & ${ComponentsRequiringUserConfig} + + ${If} $R0 = 0 + Abort + ${EndIf} + + FileOpen $R5 "$PLUGINSDIR\ConfigPage2.ini" w + + StrCpy $R6 1 ; Field Number + StrCpy $R7 0 ; Top + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + ${If} $AutomaticInstall = 1 + IntOp $R8 $R7 + 54 + ${Else} + IntOp $R8 $R7 + 92 + ${EndIf} + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Director"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R8 $R7 + 54 + ${Else} + IntOp $R8 $R7 + 26 + ${EndIf} + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Remote Director"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + ${EndIf} + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + ${If} "$ConfigDirectorName" == "" + StrCpy $ConfigDirectorName "$HostName-dir" + ${EndIf} + ${If} "$ConfigDirectorPassword" == "" + StrCpy $ConfigDirectorPassword "$LocalDirectorPassword" + ${EndIf} + ${Else} + ${If} "$ConfigDirectorName" == "$HostName-dir" + StrCpy $ConfigDirectorName "" + ${EndIf} + ${If} "$ConfigDirectorPassword" == "$LocalDirectorPassword" + StrCpy $ConfigDirectorPassword "" + ${EndIf} + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorPort$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=218$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Max Jobs"$\r$\nLeft=238$\r$\nTop=$R7$\r$\nRight=270$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorMaxJobs$\r$\nLeft=274$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} + + IntOp $R7 $R7 + 14 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R7 + 8 + + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 + + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 + ${EndIf} + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R7 + 8 + + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Mail Server"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 + + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorMailServer$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + IntOp $R8 $R7 + 8 + + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Mail Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 + + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorMailAddress$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + IntOp $R8 $R7 + 8 + + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Database"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 + + ${If} $ConfigDirectorDB = 0 + ${If} $MySQLPath != "" + StrCpy $ConfigDirectorDB 1 + ${ElseIf} $PostgreSQLPath != "" + StrCpy $ConfigDirectorDB 2 + ${Else} + StrCpy $ConfigDirectorDB 3 + ${EndIf} + ${EndIf} + + ${If} $ConfigDirectorDB = 1 + StrCpy $R9 1 + ${Else} + StrCpy $R9 0 + ${EndIf} + + FileWrite $R5 '[Field $R6]$\r$\nType="RadioButton"$\r$\nState=$R9$\r$\nText="MySQL"$\r$\nFlags="GROUP"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=90$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + + ${If} $ConfigDirectorDB = 2 + StrCpy $R9 1 + ${Else} + StrCpy $R9 0 + ${EndIf} + + FileWrite $R5 '[Field $R6]$\r$\nType="RadioButton"$\r$\nState=$R9$\r$\nText="PostgreSQL"$\r$\nFlags="NOTABSTOP"$\r$\nLeft=94$\r$\nTop=$R7$\r$\nRight=146$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + + ${If} $ConfigDirectorDB = 3 + StrCpy $R9 1 + ${Else} + StrCpy $R9 0 + ${EndIf} + + FileWrite $R5 '[Field $R6]$\r$\nType="RadioButton"$\r$\nState=$R9$\r$\nText="Sqlite"$\r$\nFlags="NOTABSTOP"$\r$\nLeft=150$\r$\nTop=$R7$\r$\nRight=182$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + + ${If} $AutomaticInstall = 0 + IntOp $R8 $R7 + 10 + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorInstallService$\r$\nText="Install as service"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=118$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorStartService$\r$\nText="Start after install"$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=260$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + ${EndIf} + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R7 + 8 + + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 + + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorAddress$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 + IntOp $R8 $R7 + 8 + ${EndIf} + ${EndIf} + + IntOp $R7 $R7 + 4 + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector} + ${If} $R0 <> 0 + IntOp $R8 $R7 + 42 + + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Monitor"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=150$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + IntOp $R8 $R7 + 8 + + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 + + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 20 + ${EndIf} + ${EndIf} + + IntOp $R6 $R6 - 1 + FileWrite $R5 "[Settings]$\r$\nNumFields=$R6$\r$\n" + + FileClose $R5 + + IntOp $R0 $NewComponents & ${ComponentsFileAndStorage} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 1 + !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage1)" "$(SUBTITLE_ConfigPage1)" + ${Else} + !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage2)" "$(SUBTITLE_ConfigPage2)" + ${EndIf} + + !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ConfigPage2.ini" + Pop $HDLG ;HWND of dialog + + ; Initialize Controls + StrCpy $R6 2 ; Field Number + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 0 + ; Name + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 30 0 + IntOp $R6 $R6 + 1 + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + ; Port Number + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 5 0 + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + ; Max Jobs + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 3 0 + + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + ${EndIf} + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 9 + + ${If} $AutomaticInstall = 0 + IntOp $R6 $R6 + 2 + ${EndIf} + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + ${EndIf} + ${EndIf} + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 30 0 + IntOp $R6 $R6 + 2 + ${EndIf} + ${EndIf} + + !insertmacro MUI_INSTALLOPTIONS_SHOW + + ; Process results + + StrCpy $R6 2 + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorName "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPort "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMaxJobs "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPassword "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailServer "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailAddress "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R5 = 1 + StrCpy $ConfigDirectorDB 1 + ${Endif} + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R5 = 1 + StrCpy $ConfigDirectorDB 2 + ${Endif} + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $R5 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R5 = 1 + StrCpy $ConfigDirectorDB 3 + ${Endif} + IntOp $R6 $R6 + 1 + + ${If} $AutomaticInstall = 0 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorInstallService "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorStartService "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorAddress "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorName "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorPassword "ConfigPage2.ini" "Field $R6" "State" + ${EndIf} + ${EndIf} +FunctionEnd + +Function LeaveConfigPage2 + ${If} $AutomaticInstall = 0 + StrCpy $R6 4 + + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R0 < 1024 + ${OrIf} $R0 > 65535 + MessageBox MB_OK "Port must be between 1024 and 65535 inclusive." + Abort + ${EndIf} + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R0 < 1 + ${OrIf} $R0 > 99 + MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive." + Abort + ${EndIf} + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} +FunctionEnd diff --git a/bacula/src/win32/win64_installer/DumpLog.nsh b/bacula/src/win32/win64_installer/DumpLog.nsh new file mode 100644 index 0000000000..c450044a80 --- /dev/null +++ b/bacula/src/win32/win64_installer/DumpLog.nsh @@ -0,0 +1,46 @@ +!define LVM_GETITEMCOUNT 0x1004 +!define LVM_GETITEMTEXT 0x102D + +Function DumpLog + Exch $5 + Push $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $6 + + FindWindow $0 "#32770" "" $HWNDPARENT + GetDlgItem $0 $0 1016 + StrCmp $0 0 error + FileOpen $5 $5 "w" + StrCmp $5 0 error + SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6 + System::Alloc ${NSIS_MAX_STRLEN} + Pop $3 + StrCpy $2 0 + System::Call "*(i, i, i, i, i, i, i, i, i) i \ + (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1" + loop: StrCmp $2 $6 done + System::Call "User32::SendMessageA(i, i, i, i) i \ + ($0, ${LVM_GETITEMTEXT}, $2, r1)" + System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)" + FileWrite $5 "$4$\r$\n" + IntOp $2 $2 + 1 + Goto loop + done: + FileClose $5 + System::Free $1 + System::Free $3 + Goto exit + error: + MessageBox MB_OK error + exit: + Pop $6 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 + Exch $5 +FunctionEnd diff --git a/bacula/src/win32/win64_installer/InstallType.ini b/bacula/src/win32/win64_installer/InstallType.ini new file mode 100644 index 0000000000..62c88cf6da --- /dev/null +++ b/bacula/src/win32/win64_installer/InstallType.ini @@ -0,0 +1,51 @@ +[Settings] +NumFields=6 + +[Field 1] +Type=Label +Text=This is a new installation. Please choose the installation type. +Left=0 +Right=300 +Top=0 +Bottom=28 + +[Field 2] +Type=GroupBox +Text=Installation Type +Left=0 +Right=300 +Top=32 +Bottom=136 + +[Field 3] +Type=RadioButton +Text=Automatic +State=1 +Left=6 +Right=52 +Top=44 +Bottom=54 + +[Field 4] +Type=RadioButton +Text=Custom +Left=6 +Right=44 +Top=90 +Bottom=100 + +[Field 5] +Type=Label +Text=The software will be installed in the default directory "Program Files\\Bacula". The configuration files will be generated using defaults applicable to most installations. +Left=17 +Right=295 +Top=58 +Bottom=86 + +[Field 6] +Type=Label +Text=You may choose the installation directory. The configuration defaults will be displayed and you will be given the chance to make changes before the configuration files are written. +Left=17 +Right=295 +Top=104 +Bottom=132 diff --git a/bacula/src/win32/win64_installer/InstallType.nsh b/bacula/src/win32/win64_installer/InstallType.nsh new file mode 100644 index 0000000000..0a0f902532 --- /dev/null +++ b/bacula/src/win32/win64_installer/InstallType.nsh @@ -0,0 +1,98 @@ +Function EnterInstallType + Push $R0 + Push $R1 + Push $R2 + + ; Check if this is an upgrade by looking for an uninstaller configured + ; in the registry. + ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" + + ${If} "$R0" != "" + ; Check registry for new installer + ReadRegStr $R1 HKLM "Software\Bacula" "InstallLocation" + ${If} "$R1" != "" + ; New Installer + StrCpy $OldInstallDir $R1 + StrCpy $InstallType ${UpgradeInstall} + + SetShellVarContext all + + StrCpy $R1 "$APPDATA\Bacula" + StrCpy $R2 "$INSTDIR\Doc" + + ReadRegDWORD $PreviousComponents HKLM "Software\Bacula" "Components" + + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "A previous installation has been found in $OldInstallDir. Please choose the installation type for any additional components you select." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The configuration files for additional components will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "The configuration defaults for additional components will be displayed and you will be given the chance to make changes before the configuration files are written." + + ReadRegDWORD $ConfigDirectorDB HKLM Software\Bacula Database + + ${If} $ConfigDirectorDB = 0 + IntOp $R0 $PreviousComponents & ${ComponentDirector} + ${If} $R0 <> 0 + StrCpy $ConfigDirectorDB 1 + ${EndIf} + ${EndIf} + ${Else} + ; Processing Upgrade - Get Install Directory + ${StrRep} $R0 $R0 '"' '' + ${GetParent} $R0 $OldInstallDir + + ; Old Installer + StrCpy $InstallType ${MigrateInstall} + StrCpy $R1 "$OldInstallDir\bin" + StrCpy $R2 "$OldInstallDir\Doc" + + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "An old installation has been found in $OldInstallDir. The Configuration will be migrated. Please choose the installation type for any additional components you select." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"$PROGRAMFILES\Bacula$\". The configuration files for additional components will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You may choose the installation directory. The configuration defaults will be displayed and you will be given the chance to make changes before the configuration files are written." + ${EndIf} + ${Else} + ; New Install + StrCpy $InstallType ${NewInstall} + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The software will be installed in the default directory $\"$PROGRAMFILES\Bacula$\". The configuration files will be generated using defaults applicable to most installations." + ${EndIf} + + ${If} $InstallType <> ${NewInstall} + ${AndIf} $PreviousComponents = 0 + ${If} ${FileExists} "$R1\bacula-fd.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentFile} + ${EndIf} + ${If} ${FileExists} "$R1\bconsole.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentTextConsole} + ${EndIf} + ${If} ${FileExists} "$R1\wx-console.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentGUIConsole} + ${EndIf} + ${If} ${FileExists} "$R2\bacula.pdf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentPDFDocs} + ${EndIf} + ${If} ${FileExists} "$R2\bacula\bacula.html" + IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} + ${EndIf} + ${If} ${FileExists} "$R2\bacula.html" + IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} + ${EndIf} + ${EndIf} + + !InsertMacro MUI_HEADER_TEXT "$(TITLE_InstallType)" "$(SUBTITLE_InstallType)" + !InsertMacro MUI_INSTALLOPTIONS_INITDIALOG "InstallType.ini" + Pop $HDLG ;HWND of dialog + + !insertmacro MUI_INSTALLOPTIONS_SHOW + + ; Process Results + + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "InstallType.ini" "Field 3" "State" + + ${If} $R0 = 1 + StrCpy $AutomaticInstall 1 + ${Else} + StrCpy $AutomaticInstall 0 + ${EndIf} + + Pop $R2 + Pop $R1 + Pop $R0 +FunctionEnd diff --git a/bacula/src/win32/win64_installer/Makefile b/bacula/src/win32/win64_installer/Makefile new file mode 100644 index 0000000000..89a8fad7bf --- /dev/null +++ b/bacula/src/win32/win64_installer/Makefile @@ -0,0 +1,160 @@ +# +# Makefile for win32 bacula executables +# Using MinGW cross-compiler on GNU/Linux +# +# Written by Eric Bollengier, March 2009 +# based on work by Robert Nelson +# + +include ../Makefile.inc + +VERSION := $(shell sed -ne 's/.*[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h) + +DEFINES := \ + -DVERSION=$(VERSION) \ + -DOUT_DIR=..\\release \ + -DSRC_DIR=release \ + -DWINVER=64 \ + -DBUILD_TOOLS=MinGW64 \ + +INSTALL_EXE := $(BUILDDIR)/release/winbacula-$(VERSION).exe + +BACULA_BINARIES := \ + bacula.dll \ + exchange-fd.dll \ + bsleep.exe \ + bsmtp.exe \ + bacula-fd.exe + +DEPKGS32_BINARIES := \ + sed.exe \ + expr64.exe \ + snooze.exe + +DEPKGS_BINARIES := \ + openssl.exe \ + cryptoeay32-0.9.8.dll \ + ssleay32-0.9.8.dll \ + pthreadGCE.dll \ + zlib1.dll + +NONGCC_BINARIES := \ + libmysql.dll + +NONGCC_LIBRARIES := \ + libpq.dll + +MINGW_BINARIES := \ + mingwm10.dll + +SCRIPT_FILES := \ + mtx-changer.cmd \ + disk-changer.cmd \ + dvd-handler.cmd + +CAT_FILES := \ + create_mysql_database.cmd \ + drop_mysql_database.cmd \ + make_mysql_tables.cmd \ + make_mysql_tables.sql \ + drop_mysql_tables.cmd \ + drop_mysql_tables.sql \ + grant_mysql_privileges.cmd \ + grant_mysql_privileges.sql \ + make_mysql_catalog_backup.cmd \ + create_postgresql_database.cmd \ + create_postgresql_database.sql \ + drop_postgresql_database.cmd \ + make_postgresql_tables.cmd \ + make_postgresql_tables.sql \ + drop_postgresql_tables.cmd \ + drop_postgresql_tables.sql \ + grant_postgresql_privileges.cmd \ + grant_postgresql_privileges.sql \ + make_postgresql_catalog_backup.cmd \ + create_sqlite3_database.cmd \ + drop_sqlite3_database.cmd \ + make_sqlite3_tables.cmd \ + make_sqlite3_tables.sql \ + drop_sqlite3_tables.cmd \ + grant_sqlite3_privileges.cmd \ + make_sqlite3_catalog_backup.cmd \ + delete_catalog_backup.cmd + +DIRD_FILES := \ + query.sql + +SSL_FILES := \ + openssl.cnf + +DOC_FILES := \ + manual/bacula.pdf \ + manual/bacula/*.html \ + manual/bacula/*.png \ + manual/bacula/*.css + +########################################################################## + +# Targets + +.PHONY: all clean installer + +all: $(INSTALL_EXE) + +installer: $(INSTALL_EXE) + +clean: + @echo "Cleaning `pwd`" + $(CMD_ECHO)-rm -f $(INSTALL_EXE) + $(CMD_ECHO)-rm -rf release + +# +# Rules +# + +define Convert_Binary +release/$$(notdir $(1)): $(1) + $$(call checkdir,$$@) + $(ECHO_CMD)cp -f $$^ $$@ ; \ + $(STAB2CV) $$@ +endef + +define Copy_Binary +release/$$(notdir $(1)): $(1) + $$(call checkdir,$$@) + $(ECHO_CMD)cp -f $$^ $$@ +endef + +define Copy_Docs +release/$(1): $(DOCDIR)/$(1) + $$(call checkdir,$$@) + $(ECHO_CMD)cp -f $$^ $$(dir $$@) +endef + +$(foreach file,$(addprefix $(DEPKGS32)/bin/, $(DEPKGS32_BINARIES)),$(eval $(call Convert_Binary,$(file)))) + +$(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Convert_Binary,$(file)))) + +#$(foreach file,$(addprefix $(DEPKGS)/bin/, $(NONGCC_BINARIES)),$(eval $(call Copy_Binary,$(file)))) + +#$(foreach file,$(addprefix $(DEPKGS)/lib/, $(NONGCC_LIBRARIES)),$(eval $(call Copy_Binary,$(file)))) + +$(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Convert_Binary,$(file)))) + +#$(foreach file,$(addprefix $(MINGW_DLLDIR)/, $(MINGW_BINARIES)),$(eval $(call Copy_Binary,$(file)))) + +$(foreach file,$(addprefix $(DEPKGS32)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Binary,$(file)))) + +#$(foreach file,$(addprefix ../scripts/, $(SCRIPT_FILES)),$(eval $(call Copy_Binary,$(file)))) + +#$(foreach file,$(addprefix ../cats/, $(CAT_FILES)),$(eval $(call Copy_Binary,$(file)))) + +#$(foreach file,$(addprefix ../../dird/, $(DIRD_FILES)),$(eval $(call Copy_Binary,$(file)))) + +#$(foreach file,$(DOC_FILES),$(eval $(call Copy_Docs,$(file)))) + +$(INSTALL_EXE): winbacula.nsi $(addprefix release/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(DEPKGS32_BINARIES) $(SSL_FILES) ) + NSISDIR=$(NSIS_DIR) \ + $(NSIS_DIR)/makensis -V3 $(DEFINES) winbacula.nsi + +include $(BUILDDIR)/Makefile.rules diff --git a/bacula/src/win32/win64_installer/Readme.txt b/bacula/src/win32/win64_installer/Readme.txt new file mode 100755 index 0000000000..b8a52d8f07 --- /dev/null +++ b/bacula/src/win32/win64_installer/Readme.txt @@ -0,0 +1,48 @@ +Bacula - Windows Version Disclaimer +=================================== + +Please note, only the Win64 Client (File daemon) is supported, and +contrary to the Win32 Client, the other components (Director, Storage daemon, +their utilities) are not provided because they have not been ported. +Note: the Win64 Client can only be installed on 64 bit Windows Operating +systems. + +Bacula - Windows Version Notes +============================== + +These notes highlight how the Windows version of Bacula differs from the +other versions. It also provides any notes additional to the documentation. + +For detailed documentation on using, configuring and troubleshooting Bacula, +please consult the installed documentation or the online documentation at +http://www.bacula.org/?page=documentation. + + +Start Menu Items +---------------- +A number of menu items have been created in the Start menu under All Programs +in the Bacula submenu. They may be selected to edit the configuration files, +view the documentation or run one of the console or utility programs. The +choices available will vary depending on the options you chose to install. + + +File Locations +-------------- +Everything is installed in the directory +"C:\Program Files\Bacula" unless a different directory was selected during +installation. Note: due to a bug in the NSIS installer we are using, on +64 bit machines appears to install Bacula in "C:\Program Files (x86)\Bacula". + +Code Page Problems +------------------- +Please note that Bacula expects the contents of the configuration files to be +written in UTF-8 format. Some translations of "Application Data" have accented +characters, and apparently the installer writes this translated data in the +standard Windows code page coding. This occurs for the Working Directory, and +when it happens the daemon will not start since Bacula cannot find the directory. +The workaround is to manually edit the appropriate conf file and ensure that it +is written out in UTF-8 format. + +The conf files can be edited with any UTF-8 compatible editor, or on most +modern Windows machines, you can edit them with notepad, then choose UTF-8 +output encoding before saving them. diff --git a/bacula/src/win32/win64_installer/Start.bat b/bacula/src/win32/win64_installer/Start.bat new file mode 100644 index 0000000000..0b61f7ec1d --- /dev/null +++ b/bacula/src/win32/win64_installer/Start.bat @@ -0,0 +1,5 @@ +rem +rem Bacula start file for Win95/98/Me +rem +cd c:\bacula\bin +c:\bacula\bin\bacula-fd.exe /service -c c:\bacula\bin\bacula-fd.conf diff --git a/bacula/src/win32/win64_installer/Stop.bat b/bacula/src/win32/win64_installer/Stop.bat new file mode 100644 index 0000000000..3b1d0e5b91 --- /dev/null +++ b/bacula/src/win32/win64_installer/Stop.bat @@ -0,0 +1,5 @@ +rem +rem Bacula stop file for Win95/98/Me +rem +cd c:\bacula\bin +c:\bacula\bin\bacula-fd.exe /kill diff --git a/bacula/src/win32/win64_installer/WriteTemplates.ini b/bacula/src/win32/win64_installer/WriteTemplates.ini new file mode 100644 index 0000000000..c3c0aad8c6 --- /dev/null +++ b/bacula/src/win32/win64_installer/WriteTemplates.ini @@ -0,0 +1,48 @@ +[Settings] +NumFields=5 +CancelEnabled=0 +BackEnabled=0 + +[Field 1] +Type="Label" +Text="Templates of the Client and Storage resources can be generated that are customized with the information about this system. These templates can then be copied to the Director computer and included in the Director's configuration file." +Left=7 +Right=293 +Top=6 +Bottom=32 + +[Field 2] +Type="CheckBox" +Text="Client" +Left=6 +Right=40 +Top=38 +Bottom=48 + +[Field 3] +Type="FileRequest" +State="Client.conf" +Flags= +Filter=Configuration Files|*.conf|All Files|*.* +Left=16 +Right=288 +Top=50 +Bottom=62 + +[Field 4] +Type="CheckBox" +Text="Storage" +Left=6 +Right=48 +Top=70 +Bottom=80 + +[Field 5] +Type="FileRequest" +State="Storage.conf" +Flags=REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST +Filter=Configuration Files|*.conf|All Files|*.* +Left=16 +Right=288 +Top=82 +Bottom=94 diff --git a/bacula/src/win32/win64_installer/bacula-dir.conf.in b/bacula/src/win32/win64_installer/bacula-dir.conf.in new file mode 100644 index 0000000000..8a53eeee08 --- /dev/null +++ b/bacula/src/win32/win64_installer/bacula-dir.conf.in @@ -0,0 +1,384 @@ +# +# Default Bacula Director Configuration file +# +# The only thing that MUST be changed is to add one or more +# file or directory names in the Include directive of the +# FileSet resource. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ @DISTVER@ +# +# You might also want to change the default email address +# from root to your address. See the "mail" and "operator" +# directives in the Messages resource. +# + +Director { # define myself + Name = @director_name@ + DIRport = @director_port@ # where we listen for UA connections + QueryFile = "@bin_dir@\\query.sql" + WorkingDirectory = "@working_dir@" + PidDirectory = "@working_dir@" + Maximum Concurrent Jobs = @director_maxjobs@ + Password = "@director_password@" # Console password + Messages = Daemon +} + +JobDefs { + Name = "DefaultJob" + Type = Backup + Level = Incremental + Client = @client_name@ + FileSet = "Test Set" + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Default + Priority = 10 +} + + +# +# Define the main nightly save backup job +# By default, this job will back up to disk in C:/tmp +Job { + Name = "Client1" + JobDefs = "DefaultJob" + Write Bootstrap = "@working_dir@\\Client1.bsr" +} + +#Job { +# Name = "Client2" +# Client = @client_name@2 +# JobDefs = "DefaultJob" +# Write Bootstrap = "@working_dir@\\Client2.bsr" +#} + +# Backup the catalog database (after the nightly save) +Job { + Name = "BackupCatalog" + JobDefs = "DefaultJob" + Level = Full + FileSet="Catalog" + Schedule = "WeeklyCycleAfterBackup" + # This creates an ASCII copy of the catalog + RunBeforeJob = "\"@bin_dir@\\make_catalog_backup\" bacula bacula" + # This deletes the copy of the catalog + RunAfterJob = "\"@bin_dir@\\delete_catalog_backup\"" + Write Bootstrap = "@working_dir@\\BackupCatalog.bsr" + Priority = 11 # run after main backup +} + +# +# Standard Restore template, to be changed by Console program +# Only one such job is needed for all Jobs/Clients/Storage ... +# +Job { + Name = "RestoreFiles" + Type = Restore + Client=@client_name@ + FileSet="Test Set" + Storage = File + Pool = Default + Messages = Standard + Where = "C:\\tmp\\bacula-restores" +} + +# +# Note: Windows path separators do NOT work correctly in FileSets. +# +# List of files to be backed up +FileSet { + Name = "Test Set" + Include { + Options { + signature = MD5 + ignore case = yes + } +# +# Put your list of files here, preceded by 'File =', one per line +# or include an external list with: +# +# File = #2v1H?(E94)8AKnQs@4sx~jUmw{7?GuXsdg%zrOo+Qc-F zDalij|9U)MzU=YbSRh2=1^+p^Z6+ls+y{p?&!UwxH`1`~N9gi8Z&CTuUr_!$zmnf~ zMiB1t4&M+5agip`hv7a<^hLNY?p?WvhFtj=6)W^Tc{~&oAq~$kv&3+x)fEs?jm>`TjEEDd0av0sq5HOPMB; zH)*IK+=t%b+bLsOCwYEbiCN=iCwz{D9!4jg2>bm8xQ z{_b%k#6eu7@p#Te8%E;+Fs z(BIe0-ayUjy=h}BILqVs1dn599!K9lh9@0gs0-?Zx_La2Iw@=vXcO9&uu){6jRyMq z;wiV&rPV$#+6t1A{^W6cfa!7`x1{q3PrA(_Nz@T_MV)mX1{($1h_)td6!FE^_yMiy zvRV}_RK9e59s}?omHP1WDAvK|@>td2dwmSg?`PCGIk27OzTdd+`Wn*TbaB}eG<)>j zbYNq`MiGy>wNvxjRI64knlopPBTbz;m4*)=P7ND2q~zp(PKL@Xo_)SDyq>h2=k@Ol z_#!G*>>HXm@IiWT!}SRnEQ9_M_pMsU^FS*aHf$Kh5>A{rL38KM&Efbe#QbYE^WM*m z_$rwHCmPo6D4~zy@%zmUdF)zp3-xUCETshh;65EK_)sjkl5zL$-OKZ$m-9Hk=Rl|W zd6QBZU*i~G?;7!iK0;ri&vFAcGSbFP3szCv#;*z=r?8AMI%a+)afNH2K9IX|F0R6L z_c6ZuGQDWT7ktCecj&{6^!_*6=+m5FqnI|V168k7D$`W6@=}9Kcdm&xOn{=A{?jD}UD)Kwor_ry64hsSbpF~fW z6XW=NRk>}jrI=_kT~g^|N}ITo#`bMv9Ji_!N)pJ;xMJKeW~~}kr_p_`pv`F`;=&h) zc56bFD_5rF%a>=0Zn@rx;P;QlGWw3zX@Gi z$V>I>*QZI7CW(BOEn8-(&l_*NVZqhUKmW|Sm5(}f=wOLw*N&TRx=G0V&@HQ0t;#&q z+5QDyIb_HXy5WW!NUcl%{{4;hFI~Dc_3qu9X3d&Kix)4pty7UAMF@GQ^+bHVKKb+K zx0H+cZQHixvO(v5qu$9vr&jaAJ;oEdw*KDqjB&gE`s-=jxN+2=K?CknFRwja#&)$C znZg%v)uv4w%b3OU;ma?-q)nSPQQ5L(jpG4~U3%%I^uh}-#8m9Bzy3gdI)fh_-dFxf4&7*9?w*PWi<}&fxlk8dg-rSJ!4+Tn>R0w?A83d#+7W$x8HtC zUAuO*j0rFW-hpqihRonfmNjF>jEMU5>(@_yHeOX+HEPs|zWCw`V?5K#c;G52=@RDo zA9B6Hv*M2{)O**iU97VQ=&q&XGK{UP=2vR}{`T8%)U;_+%UDAG)&u(g_uqdf#FupD z%o$5Gi7U)gGLGF9yyVY6|FopX1Mr+DPoDJpfLA^D+;b7}@B(?D%&l9uiumADCr_R< z#sxpr>yNr2eZ`6uGs&+!Y`YJ#OfiCaTsK>O)uTs`sQrREo<4m#q78rj^_Q4ONAzfx zBXETV96x@XAUl9pl_*g{^uOA$Pd@pCnm2Dwg$oy^f&~kv)9tt4u0|7Mgn1A;r5ew4 zU$kgZg8T#dPY;mKq`a4!ni_$>ufF<`C!TnMI(6zql`2(= zsK2Zi=DWtPHA4H`tik{V{uo=x>@l+Q7^Lfz&3)4FwQ zwJG8r?UCcGULm8YLGmj#PPBW-v%1VOcI?>n@-Qds0W!OuFUA7ptKq%(-m~yNJ&pRD z9k}v%hH||hJ4Z(-Z|Y9!)ov)S6}2I(&4R|T{)hE6VDOu7zEPV)x7~IdRVZCFQ@Fxh zP_0_E3{my!)rH)B#T8f3(4j+V%a$z>wkAu3`Qgns-xP8x>{5E@*|TTFIATm<#TEF1 zB){J;cn$O}Jq#EyAiX^3LwcApWlH*Yi4Btswr<@zfh+W-6Jf5+9$ekP^~PHFDyCXY zK_;FKm6cG-+%voT;wZR4_xi$L9e$o%VG7z z{J(VRQlW1{#(?W3!&Ic;kKBhL+lYGg z`%bc)IG=4BMI-uHZKHY*JCsxC+_|%`qw8@lzZ|wes|CtQKY>GP7Fujv`~9JMSH zu11U)VTptIx88cIDZ8le;-L?!^~Jp%uJ8@^8?4pG8enS(Fppn1cW{Pqb=T6HsZaZ- zdF}U{9mnRtmjQE-9%986qL6hV@7fXg9Q4X~%2%-6>jC;8+NlT3d#D3!GqPWB#rg>B z63|CHp2Ae3$U;Jz_Z>TSjHqL1KU_b4 zKaFV*Q|N3IU<6nJX6)9vZ=1h{*MyH7{R-fJogBE2c~m3L(|OIzuAlVxuzl+O2WlH( zE5X>C{Q6?W)zPCz)vSel4%?SrCpXV-aRr+hbOSX&W`|Dgrkr@;3iG&bSH@fm`x)#b zdNB8G63YY77uy@?8-W>M2N+U)Zl(_hX3lULtNi5k{>pgT%-@{*0(vp@=HkVR3oMi` zU!HV=T?l@{-Me?EjT<*cT`PP0?YD)#8xLGT2h;;>=FpQDELb3Zx8VCGg3Jp&TYiIV zp$G6o`5jkj2bnf)njTf?g7@BguUPL@)2R1_3Kfc&2Vu+C>uSQqt*8}8(6)RRyT3T9qK5E_MJ#?8R#R$m^U?_0*x z62@q$b7`&e6YLu;TecMIvd=&NJV7^xJ`NrO`+$jbTch3{{TY3Tdc(Is59Z&Ly*}8k zUAqWdr=F+XGcW-EuUP7T*Ijpsy2IE0>8GEz%i8$fPHs0w&frVPOXyqJPcot-qgdb% zd3e3JhWQb&1WeVcBG)I0F?@#o_Lp$n0wPTak5)`IZrnI#9U|7|!*&AM73If+U*Wg8 zef#!Ut0CfN23M#*)eR=J**V5~+ zzb@urHJ;P`J@?!r_?60w^)_H!)I9FI^G-|sAmc!F?H>8Tu8DaCbC-%K*>|WLXDi@`DVercv*KL*${p%g8-=CDy>fuVvXzSJVsZ z&u+>>-ZC#>2H4@Q6$DK6Zuj5m&v@_ionqN)4)>*1U&8*DtO}4xA^SpRgRi<eZ_SpFx_t z@4lNJc;EpG!7ilM2l$4+8T>JKvhRbehf|#(cVhfe9_-4J)U_s*0Y6;$ctU4ET`+!n zee`FvPWQ~TG=r;24xTHc57^&O{K&TS|m{1;8WNh;33Z{K<6 z9ih|0PJ{ZbU%x(rpliTp8_xj$Agu4fpA`9{uTA{{e<;`{Ga9hwXNRj%qeex|R-HRw zLwV_?m!hW8BRuoWGeY-<%|Z=W!$O+qYwcw{8F*%RRRl@-`9?VkmffGOyNdsihJS>EbR`kxtA03 zfL(=PU#MBLrYlTgd`*5lc6n#^{l0zs#P1j7!VYT+knOSV`tipfTj%N*!xB{`}s;Yd1#w_wQG;r!cOt7q$z_<44sV(m{Q?2CaeYL}P(9<~lOIQ3yH zxWYajJxE`By$yhuGk+|yhwhbr|9*S z&#(ADK^Ht-_oWLW2r1YRS@$;}m5 zR|9lmyL7SO3c9iGn+Sd8$}6uFzJhui@vQTVFuyu(!4&>~OaD$!#_haHoIe#!ZV&mJ z=jC~`KJ!~=zZtjuYW(=|={mI3rRB9rlO_Z^G5X9+z&S_YDSDr~Nvp?? z!-eU+zDEagpeY{S#eyruKX~wKMY1OKgAk~KEmS2VZHL!lZ!9dujP*d#5akB;??MC1)nF+uZ z{HOJR^=ms^nBHe4uIkmRm#N>6#8tUc&$8e7-Yh#0d^hhqOb+-RWp}-w^=IsXlKmSS zuI6$&>--*m{x^S168e)~p8kxrL6nan%%{LH0xXT}#GhIj-(rel`COzLX4|bAU>R_|c^|f6Vf_t0ae9DWg?!)_ zuLszPuqGESC!C-DF8gqW{r?pVRFdEM3Hv#9dlzhLg$v}#^jR^cdC%_MqDegk-+~T~ z^(fdF+=LLWW^r3W{L0Nd=q6t`aj=$Z9oH889Fp0*-dC7^RuKE=wr$%c)|Rn<>BA2{ zjK~_kCelU)oa%OJB*450UWWBttdYWBMkVagLtU~CS3%}ajfL*3maE>QUJpL_pztHr zF@-h^95|3#T~<9?c$JDX@W(#w8&dwfDMG%1e=*kNF^|LM4Ey#q*IXlP6R=N!Fb>^X zHK)N{`G5Ht_G6{DA9JR>)XRb%6h^ichptm$RJG;~Ul{ zvKCj>IRCA}hdx?eOy6PC2nLgRO{QPA<4R)e(M{87!@Qwl4>Zo$>fXAZ*vH?taSd@6 zU$c5ucpWlK*Ny5-w_ZO~;3_-#71qAYeho>i7rvj4EAXzAlo$A2Dn0!0!=~;goF{^{ zHx*a7$L|Phfo?NUGk4%N@6S4tHhNX9nS4o>G8lr;B%zf%yc{i zgRpN~?H8%3X<}^;`Va_fEtoT~S6ol8KEnqN{28`Q$XG}V`2fEio#3N`w7{48Z72I) zsd=jR@Q+vHKKkgR4t_ErTwxAT)9CkDgT`JV*dh)bI3RRI>CreKPr9706eXy0*N^7NdF_l9D`>%4eh1u2P2P zjOj{;w_Ka!Fa_S09sEi{4KgXtqS5;@^gPypE8uLNO?-RZ&YXX=_|Vf*T$bf$J$wMq z!|<_rjcJE1zbad@F#kWpNxTnvxFc;{bQSHmX*9v+4S6QkdFOnKpPje@zOWt$-8FLT zujY3;zryo7Op$U_Wcp~hvHOlaMkASCXDY&E7Z2y{r?=K2moo{2F z9rbaGE7->%L)#I2klfnPU^j>yKiIBJxPo7ZI~!DFo+gYSuPIEcnVx0(oeAY)FN^sc z0-vu4<7pn-3r?PkYprK6`M(_bRd$Ty`BsL+734^#0AI_HA6h}~Tl}tdN)dbra#XYc zo064h!6tahIA)V^A&anjlv*IH3yepy%zpp&|Hm&6O?t5dJi;90ulLtRQ zH(xU%fh(4&RBTIJMbihvxcWctWB5Yr^aa0bLO9RNO_2M0LwIS;X(RpB!s8#0|4{+i zDN^SQmoc2bhj1G3*J3=~!Smj4{7%Q<-&CdiXEb;0?)3i=w`$hF1g_M z)6G-2Mf^`o;0pe)*zW|tFG;YaCFCpX`KLNI!u;w!9s}5XRC={(jW6C zPA_p}y4K|Hb~pm&uojN9br26S6#RhZFg?u#-fGHIzI%zkCo=)R@?GdEea6>2_>99A zUAlNdBW31nVs&20Y4>jDL9CzQH)$f+Zm>23e^IyopRkwX|D+@bhB1G@m|hhzrq(eY z#oz641uR+d5Zm(tPT!I#JQu@fyi1E0GUYR#)36ZF`bu0yliT5^fb|g*;mj=4dZ`oN zg6~m?rvMM&Et8p?u;GL&JKL92e)8MbTy6!Xb)tOuj1TDa1npVA*dm9GT3_+I!pRTzGB^ZuNYT*Z1v^uCVmC^>G>#WC5H4X*1Fp;HKAgKKIe1M z577N__8HF&7&5i-pTHG-Rs#M2%e0Wy)0iqT{m!J1yZVgrH{ohvlyqty>OJPXF?_~K zVP2-pDCQX*t=Z=S~#gM`$8wPKL3adY+Po* z7334Z{+6iX)yR?j)|VV;+P(9_PlCDN&fXCp&u8@x6n?eA zj?6X#RmyeIshFZic7VPB#>yx(K}ydgZcUbZp7ZWJDK=ldQU7c$n#7}8kt z4)|Z>dK9FAog4G{1v%6IM9wqk`xX2OK0om!FYk}>dXrct&P%ncmJ#EK|L23gz<4g1 z-j~;KeLM&5i2);6D;^O;d@H7s1J7}t3bF5X-5l%FbiQLrtsi`S?pZNDZglU;39PG6 zrh^6_B47&t69{^p-`6ZAj0F4(8Hep-N)zILXF1&_##AcxY*Rm5_q3?}oVd5HOUJW6 zfZ>AqQdwRf%zKD-F^`P4z7pm+DZ%xO4PY|-F511<`yFFykoe!U)A@g&CFZ`Y8{2r| zBqMoYd_((&_zcqEWX4wH8m|d20skE=k5zJw#pJ+I*7?fwd78y&bJ~c6jGl!udPZ=N z6=|>!VE)zJ#J)$jI-$?EmwC@cj4Sva*z+u}_eaLxWMOyh&;Q#hC+<1OiayUxc`m=U zKl7|)#>))G%V|fv1d|VQyrPc$4gY`2@2gDZN)@3svj-)3R4(9AcE1;33-e-fpu4S~ zFZfe1`FXZY_?doHXBZeS-v#%Efq6ad!LSQBW z{k|XgeO|`T!3bRWeV;IUC_s0#^xsWs3ov&%6D`ku+&gTd__Z@L$3_47@7Lze1S$ zTgdz=!8`dHpdM}NC2XGwT-oAEIQkFsud^)A2l&1n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bacula/src/win32/win64_installer/storage.conf.in b/bacula/src/win32/win64_installer/storage.conf.in new file mode 100644 index 0000000000..5928815c5c --- /dev/null +++ b/bacula/src/win32/win64_installer/storage.conf.in @@ -0,0 +1,10 @@ +# Definition of file storage device +Storage { + Name = File +# Do not use "localhost" here + Address = @storage_address@ # N.B. Use a fully qualified name here + SDPort = @storage_port@ + Password = "@storage_password@" + Device = FileStorage + Media Type = File +} diff --git a/bacula/src/win32/win64_installer/winbacula.nsi b/bacula/src/win32/win64_installer/winbacula.nsi new file mode 100644 index 0000000000..bc8b81d00f --- /dev/null +++ b/bacula/src/win32/win64_installer/winbacula.nsi @@ -0,0 +1,900 @@ +; winbsclient.nsi +; +; Began as a version written by Michel Meyers (michel@tcnnet.dyndns.org) +; +; Adapted by Kern Sibbald for native Win32 Bacula +; added a number of elements from Christopher Hull's installer +; +; D. Scott Barninger Nov 13 2004 +; added configuration editing for bconsole.conf and bwx-console.conf +; better explanation in dialog boxes for editing config files +; added Start Menu items +; fix uninstall of config files to do all not just bacula-fd.conf +; +; D. Scott Barninger Dec 05 2004 +; added specification of default permissions for bacula-fd.conf +; - thanks to Jamie Ffolliott for pointing me at cacls +; added removal of working-dir files if user selects to remove config +; uninstall is now 100% clean +; +; D. Scott Barninger Apr 17 2005 +; 1.36.3 release docs update +; add pdf manual and menu shortcut +; +; Robert Nelson May 15 2006 +; Added server installs and implemented Microsoft install locations +; Use LogicLib.nsh +; Added Bacula-SD and Bacula-DIR +; Replaced ParameterGiven with standard GetOptions +; +; Kern Sibbald October 2008 +; Remove server installs +; Install into single bacula directory +; (i.e. undo a large part of what Robert Nelson did) +; +; Eric Bollengier March 2009 +; Updated to handle Win64 installation +; +; Version $Id: winbacula.nsi 7074 2008-05-31 18:43:21Z kerns $ +; +; Command line options: +; +; /service - +; /start +; +; netsh firewall add portopening protocol=tcp port=9102 name="Bacula-FD" + + +!define PRODUCT "Bacula Systems" + +; +; Include the Modern UI +; + +!include "MUI.nsh" +!include "LogicLib.nsh" +!include "FileFunc.nsh" +!include "Sections.nsh" +!include "StrFunc.nsh" +!include "WinMessages.nsh" +; +; Basics +; +Name "Bacula" +OutFile "${OUT_DIR}\win${WINVER}baculasystems-${VERSION}.exe" +SetCompressor lzma + +InstallDir "$PROGRAMFILES\bacula" +InstallDirRegKey HKLM "Software\Bacula" "InstallLocation" + +InstType "Client" + +!insertmacro GetParent + +${StrCase} +${StrRep} +${StrTok} +${StrTrimNewLines} + +; +; Pull in pages +; + +!define MUI_COMPONENTSPAGE_SMALLDESC + +!define MUI_HEADERIMAGE +!define MUI_BGCOLOR 739AB9 +!define MUI_HEADERIMAGE_BITMAP "bacula-logo.bmp" + +!InsertMacro MUI_PAGE_WELCOME +!InsertMacro MUI_PAGE_LICENSE "..\..\..\LICENSE" +Page custom EnterInstallType +!define MUI_PAGE_CUSTOMFUNCTION_SHOW PageComponentsShow +!InsertMacro MUI_PAGE_COMPONENTS +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre +!InsertMacro MUI_PAGE_DIRECTORY +Page custom EnterConfigPage1 LeaveConfigPage1 +Page custom EnterConfigPage2 LeaveConfigPage2 +!Define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveInstallPage +!InsertMacro MUI_PAGE_INSTFILES +Page custom EnterWriteTemplates +!Define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt +!InsertMacro MUI_PAGE_FINISH + +!InsertMacro MUI_UNPAGE_WELCOME +!InsertMacro MUI_UNPAGE_CONFIRM +!InsertMacro MUI_UNPAGE_INSTFILES +!InsertMacro MUI_UNPAGE_FINISH + +!define MUI_ABORTWARNING + +!InsertMacro MUI_LANGUAGE "English" + +!InsertMacro GetParameters +!InsertMacro GetOptions + +DirText "Setup will install Bacula Systems ${VERSION} to the directory specified below. To install in a different folder, click Browse and select another folder." + +!InsertMacro MUI_RESERVEFILE_INSTALLOPTIONS +; +; Global Variables +; +Var OptService +Var OptStart +Var OptSilent + +Var CommonFilesDone + +Var OsIsNT + +Var HostName + +Var ConfigClientName +Var ConfigClientPort +Var ConfigClientMaxJobs +Var ConfigClientPassword +Var ConfigClientInstallService +Var ConfigClientStartService + +Var ConfigStorageName +Var ConfigStoragePort +Var ConfigStorageMaxJobs +Var ConfigStoragePassword +Var ConfigStorageInstallService +Var ConfigStorageStartService + +Var ConfigDirectorName +Var ConfigDirectorPort +Var ConfigDirectorMaxJobs +Var ConfigDirectorPassword +Var ConfigDirectorAddress +Var ConfigDirectorMailServer +Var ConfigDirectorMailAddress +Var ConfigDirectorDB +Var ConfigDirectorInstallService +Var ConfigDirectorStartService + +Var ConfigMonitorName +Var ConfigMonitorPassword + +Var LocalDirectorPassword +Var LocalHostAddress + +Var MySQLPath +Var MySQLVersion +Var PostgreSQLPath +Var PostgreSQLVersion + +Var AutomaticInstall +Var InstallType + +!define NewInstall 0 +!define UpgradeInstall 1 +!define MigrateInstall 2 + +Var OldInstallDir +Var PreviousComponents +Var NewComponents + +; Bit 0 = File Service +; 1 = Storage Service +; 2 = Director Service +; 3 = Command Console +; 4 = Graphical Console +; 5 = Documentation (PDF) +; 6 = Documentation (HTML) + +!define ComponentFile 1 +!define ComponentStorage 2 +!define ComponentDirector 4 +!define ComponentTextConsole 8 +!define ComponentGUIConsole 16 +!define ComponentPDFDocs 32 +!define ComponentHTMLDocs 64 + +!define ComponentsRequiringUserConfig 31 +!define ComponentsFileAndStorage 3 +!define ComponentsFileAndStorageAndDirector 7 +!define ComponentsDirectorAndTextGuiConsoles 28 +!define ComponentsTextAndGuiConsoles 24 + +Var HDLG +Var HCTL + +Function .onInit + Push $R0 + Push $R1 + + ; Process Command Line Options + StrCpy $OptService 1 + StrCpy $OptStart 1 + StrCpy $OptSilent 0 + StrCpy $CommonFilesDone 0 + StrCpy $OsIsNT 0 + StrCpy $AutomaticInstall 0 + StrCpy $InstallType ${NewInstall} + StrCpy $OldInstallDir "" + StrCpy $PreviousComponents 0 + StrCpy $NewComponents 0 + StrCpy $MySQLPath "" + StrCpy $MySQLVersion "" + StrCpy $PostgreSQLPath "" + StrCpy $PostgreSQLVersion "" + StrCpy $LocalDirectorPassword "" + + ${GetParameters} $R0 + + ClearErrors + ${GetOptions} $R0 "/noservice" $R1 + IfErrors +2 + StrCpy $OptService 0 + + ClearErrors + ${GetOptions} $R0 "/nostart" $R1 + IfErrors +2 + StrCpy $OptStart 0 + + IfSilent 0 +2 + StrCpy $OptSilent 1 + + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + ${If} $R0 != "" + StrCpy $OsIsNT 1 + ${EndIf} + + Call GetComputerName + Pop $HostName + + Call GetHostName + Pop $LocalHostAddress + + Call GetUserName + + ; Configuration Defaults + + StrCpy $ConfigClientName "$HostName-fd" + StrCpy $ConfigClientPort 9102 + StrCpy $ConfigClientMaxJobs 5 + ;StrCpy $ConfigClientPassword + StrCpy $ConfigClientInstallService "$OptService" + StrCpy $ConfigClientStartService "$OptStart" + + + StrCpy $ConfigMonitorName "$HostName-mon" + ;StrCpy $ConfigMonitorPassword + + InitPluginsDir + File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe" + File "/oname=$PLUGINSDIR\ssleay32-0.9.8.dll" "${SRC_DIR}\ssleay32-0.9.8.dll" + File "/oname=$PLUGINSDIR\cryptoeay32-0.9.8.dll" "${SRC_DIR}\cryptoeay32-0.9.8.dll" +; File "/oname=$PLUGINSDIR\libeay32.dll" "${SRC_DIR}\libeay32.dll" +; File "/oname=$PLUGINSDIR\ssleay32.dll" "${SRC_DIR}\ssleay32.dll" + File "/oname=$PLUGINSDIR\sed.exe" "${SRC_DIR}\sed.exe" + + !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "InstallType.ini" + !InsertMacro MUI_INSTALLOPTIONS_EXTRACT "WriteTemplates.ini" + + SetPluginUnload alwaysoff + + nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33' + pop $R0 + ${If} $R0 = 0 + FileOpen $R1 "$PLUGINSDIR\pw.txt" r + IfErrors +4 + FileRead $R1 $R0 + ${StrTrimNewLines} $ConfigClientPassword $R0 + FileClose $R1 + ${EndIf} + + SetPluginUnload manual + + nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33' + pop $R0 + ${If} $R0 = 0 + FileOpen $R1 "$PLUGINSDIR\pw.txt" r + IfErrors +4 + FileRead $R1 $R0 + ${StrTrimNewLines} $ConfigMonitorPassword $R0 + FileClose $R1 + ${EndIf} + + Pop $R1 + Pop $R0 +FunctionEnd + +Function .onSelChange + Call UpdateComponentUI +FunctionEnd + +Function InstallCommonFiles + ${If} $CommonFilesDone = 0 + SetOutPath "$INSTDIR" + File "Readme.txt" + + SetOutPath "$INSTDIR" +!if "${BUILD_TOOLS}" == "MinGW" + File "${SRC_DIR}\mingwm10.dll" + File "${SRC_DIR}\pthreadGCE.dll" + File "${SRC_DIR}\zlib1.dll" + File "${SRC_DIR}\ssleay32.dll" + File "${SRC_DIR}\libeay32.dll" +!endif +!if "${BUILD_TOOLS}" == "MinGW64" + File "${SRC_DIR}\pthreadGCE.dll" + File "${SRC_DIR}\cryptoeay32-0.9.8.dll" + File "${SRC_DIR}\ssleay32-0.9.8.dll" + File "${SRC_DIR}\zlib1.dll" +!endif + File "${SRC_DIR}\bacula.dll" + + File "/oname=$INSTDIR\openssl.cnf" "${SRC_DIR}\openssl.cnf" + File "${SRC_DIR}\openssl.exe" + File "${SRC_DIR}\bsleep.exe" + File "${SRC_DIR}\bsmtp.exe" + File "${SRC_DIR}\expr64.exe" + File "${SRC_DIR}\snooze.exe" + + CreateShortCut "$SMPROGRAMS\Bacula\Documentation\View Readme.lnk" "write.exe" '"$INSTDIR\Readme.txt"' + + StrCpy $CommonFilesDone 1 + ${EndIf} +FunctionEnd + +Section "-Initialize" + + WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR" + + Call GetSelectedComponents + Pop $R2 + WriteRegDWORD HKLM Software\Bacula Components $R2 + + ; remove start menu items + SetShellVarContext all + + Delete /REBOOTOK "$SMPROGRAMS\Bacula\Configuration\*" + Delete /REBOOTOK "$SMPROGRAMS\Bacula\Documentation\*" + Delete /REBOOTOK "$SMPROGRAMS\Bacula\*" + RMDir "$SMPROGRAMS\Bacula\Configuration" + RMDir "$SMPROGRAMS\Bacula\Documentation" + RMDir "$SMPROGRAMS\Bacula" + CreateDirectory "$SMPROGRAMS\Bacula" + CreateDirectory "$SMPROGRAMS\Bacula\Configuration" + CreateDirectory "$SMPROGRAMS\Bacula\Documentation" + + CreateDirectory "$INSTDIR" + CreateDirectory "$INSTDIR\working" + + SetOutPath "$INSTDIR" + File "..\..\..\LICENSE" + Delete /REBOOTOK "$INSTDIR\License.txt" + + FileOpen $R1 $PLUGINSDIR\config.sed w + FileWrite $R1 "s;@VERSION@;${VERSION};g$\r$\n" + FileWrite $R1 "s;@DATE@;${__DATE__};g$\r$\n" + FileWrite $R1 "s;@DISTNAME@;Windows;g$\r$\n" + +!If "$BUILD_TOOLS" == "MinGW" + StrCpy $R2 "MinGW32" +!Else + StrCpy $R2 "MinGW64" +!EndIf + + Call GetHostName + Exch $R3 + Pop $R3 + + FileWrite $R1 "s;@DISTVER@;$R2;g$\r$\n" + + ${StrRep} $R2 "$INSTDIR\working" "\" "\\\\" + FileWrite $R1 's;@working_dir@;$R2;g$\r$\n' + ${StrRep} $R2 "$INSTDIR\working" "\" "\\" + FileWrite $R1 's;@working_dir_cmd@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR" "\" "\\\\" + FileWrite $R1 's;@bin_dir@;$R2;g$\r$\n' + ${StrRep} $R2 "$INSTDIR" "\" "\\" + FileWrite $R1 's;@bin_dir_cmd@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR\plugins" "\" "\\\\" + FileWrite $R1 's;@fdplugins_dir@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR" "\" "/" + FileWrite $R1 "s;@BUILD_DIR@;$R2;g$\r$\n" + + FileWrite $R1 "s;@client_address@;$LocalHostAddress;g$\r$\n" + + ${If} "$ConfigClientName" != "" + FileWrite $R1 "s;@client_name@;$ConfigClientName;g$\r$\n" + ${EndIf} + ${If} "$ConfigClientPort" != "" + FileWrite $R1 "s;@client_port@;$ConfigClientPort;g$\r$\n" + ${EndIf} + ${If} "$ConfigClientMaxJobs" != "" + FileWrite $R1 "s;@client_maxjobs@;$ConfigClientMaxJobs;g$\r$\n" + ${EndIf} + ${If} "$ConfigClientPassword" != "" + FileWrite $R1 "s;@client_password@;$ConfigClientPassword;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorName" != "" + FileWrite $R1 "s;@director_name@;$ConfigDirectorName;g$\r$\n" + ${EndIf} + ${If} "$ConfigMonitorName" != "" + FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;g$\r$\n" + ${EndIf} + ${If} "$ConfigMonitorPassword" != "" + FileWrite $R1 "s;@monitor_password@;$ConfigMonitorPassword;g$\r$\n" + ${EndIf} + + FileClose $R1 + + + ${If} ${FileExists} "$OldInstallDir\bin\bacula-fd.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /remove' ; Remove existing service + ${EndIf} + +SectionEnd + +SectionGroup "Client" SecGroupClient + +Section "File Service" SecFileDaemon + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\plugins" + File "${SRC_DIR}\exchange-fd.dll" + + SetOutPath "$INSTDIR" + + File "${SRC_DIR}\bacula-fd.exe" + + File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in" + + StrCpy $0 "$INSTDIR" + StrCpy $1 bacula-fd.conf + Call ConfigEditAndCopy + + StrCpy $0 bacula-fd + StrCpy $1 "File Service" + StrCpy $2 $ConfigClientInstallService + StrCpy $3 $ConfigClientStartService + + Call InstallDaemon + + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Client Configuration.lnk" "write.exe" '"$INSTDIR\bacula-fd.conf"' +SectionEnd + +SectionGroupEnd + +Section "-Finish" + Push $R0 + + ${If} $OsIsNT = 1 + nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$INSTDIR" /T /G SYSTEM:F Administrators:F' + nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$INSTDIR" /T /G SYSTEM:F Administrators:F' + ${EndIf} + + ; Write the uninstall keys for Windows & create Start Menu entry + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "InstallLocation" "$INSTDIR" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayVersion" "${VERSION}" + ${StrTok} $R0 "${VERSION}" "." 0 0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMajor" $R0 + ${StrTok} $R0 "${VERSION}" "." 1 0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMinor" $R0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoRepair" 1 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLUpdateInfo" "http://www.baculasystems.com" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.baculasystems.com" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "https://www.baculasystems.com/rt/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteUninstaller "$INSTDIR\Uninstall.exe" + CreateShortCut "$SMPROGRAMS\Bacula\Uninstall Bacula.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 + Pop $R0 +SectionEnd + +; Extra Page descriptions + +LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula Systems File Daemon on this system." +LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system." +LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install graphical console program on this system." +LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system." +LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system." + +LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration" +LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration." + +LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)" +LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration." + +LangString TITLE_InstallType ${LANG_ENGLISH} "Installation Type" +LangString SUBTITLE_InstallType ${LANG_ENGLISH} "Choose installation type." + +LangString TITLE_WriteTemplates ${LANG_ENGLISH} "Create Templates" +LangString SUBTITLE_WriteTemplates ${LANG_ENGLISH} "Create resource templates for inclusion in the Director's configuration file." + +!InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN + !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml) +!InsertMacro MUI_FUNCTION_DESCRIPTION_END + +; Uninstall section + +UninstallText "This will uninstall Bacula. Hit next to continue." + +Section "Uninstall" + ; Shutdown any baculum that could be running + nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /kill' + Sleep 3000 + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\plugins\exchange-fd.dll" /remove' + ${EndIf} + + ; remove registry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" + DeleteRegKey HKLM "Software\Bacula" + + ; remove start menu items + SetShellVarContext all + Delete /REBOOTOK "$SMPROGRAMS\Bacula\*" + RMDir "$SMPROGRAMS\Bacula" + + ; remove files and uninstaller (preserving config for now) + Delete /REBOOTOK "$INSTDIR\doc\*" + Delete /REBOOTOK "$INSTDIR\*" + + ; Check for existing installation + MessageBox MB_YESNO|MB_ICONQUESTION \ + "Would you like to delete the current configuration files and the working state file?" IDNO NoDel + Delete /REBOOTOK "$INSTDIR\*" + Delete /REBOOTOK "$INSTDIR\working\*" + Delete /REBOOTOK "$INSTDIR\plugins\*" + Delete /REBOOTOK "$PLUGINSDIR\bacula-*.conf" + Delete /REBOOTOK "$PLUGINSDIR\*console.conf" + Delete /REBOOTOK "$PLUGINSDIR\*conf.in" + Delete /REBOOTOK "$PLUGINSDIR\openssl.exe" + Delete /REBOOTOK "$PLUGINSDIR\libeay32.dll" + Delete /REBOOTOK "$PLUGINSDIR\ssleay32.dll" + Delete /REBOOTOK "$PLUGINSDIR\sed.exe" + Delete /REBOOTOK "$PLUGINSDIR\pw.txt" + Delete /REBOOTOK "$PLUGINSDIR\*.sed" + Delete /REBOOTOK "$PLUGINSDIR\*.cmd" + Delete /REBOOTOK "$PLUGINSDIR\*.sql" + RMDir "$INSTDIR\plugins" + RMDir "$INSTDIR\working" + RMDir "$INSTDIR" +NoDel: + + ; remove directories used + RMDir "$INSTDIR\doc" + RMDir "$INSTDIR" +SectionEnd + +; +; $0 - Service Name (ie Bacula-FD) +; $1 - Service Description (ie Bacula File Daemon) +; $2 - Install as Service +; $3 - Start Service now +; +Function InstallDaemon + Call InstallCommonFiles + + WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2 + + ${If} $2 = 1 + nsExec::ExecToLog '"$INSTDIR\$0.exe" /install -c "$INSTDIR\$0.conf"' + + ${If} $OsIsNT <> 1 + File "Start.bat" + File "Stop.bat" + ${EndIf} + + ; Start the service? + + ${If} $3 = 1 + ${If} $OsIsNT = 1 + nsExec::ExecToLog 'net start $0' + ${Else} + Exec '"$INSTDIR\$0.exe" -c "$INSTDIR\$0.conf"' + ${EndIf} + ${EndIf} + ${Else} + CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\$0.exe" '-c "$INSTDIR\$0.conf"' "$INSTDIR\$0.exe" 0 + ${EndIf} +FunctionEnd + +Function GetComputerName + Push $R0 + Push $R1 + Push $R2 + + System::Call "kernel32::GetComputerNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2" + + ${StrCase} $R0 $R0 "L" + + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +!define ComputerNameDnsFullyQualified 3 + +Function GetHostName + Push $R0 + Push $R1 + Push $R2 + + ${If} $OsIsNT = 1 + System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e" + ${If} $R2 = 0 + Pop $R2 + DetailPrint "GetComputerNameExA failed - LastError = $R2" + Call GetComputerName + Pop $R0 + ${Else} + Pop $R2 + ${EndIf} + ${Else} + Call GetComputerName + Pop $R0 + ${EndIf} + + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +!define NameUserPrincipal 8 + +Function GetUserName + Push $R0 + Push $R1 + Push $R2 + + ${If} $OsIsNT = 1 + System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e" + ${If} $R2 = 0 + Pop $R2 + DetailPrint "GetUserNameExA failed - LastError = $R2" + Pop $R0 + StrCpy $R0 "" + ${Else} + Pop $R2 + ${EndIf} + ${Else} + StrCpy $R0 "" + ${EndIf} + + ${If} $R0 == "" + System::Call "advapi32::GetUserNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e" + ${If} $R2 = 0 + Pop $R2 + DetailPrint "GetUserNameA failed - LastError = $R2" + StrCpy $R0 "" + ${Else} + Pop $R2 + ${EndIf} + ${EndIf} + + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +Function ConfigEditAndCopy + Push $R1 + + ${If} ${FileExists} "$0\$1" + StrCpy $R1 ".new" + ${Else} + StrCpy $R1 "" + ${EndIf} + + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\$1"' + CopyFiles "$PLUGINSDIR\$1" "$0\$1$R1" + + Pop $R1 +FunctionEnd + +Function GetSelectedComponents + Push $R0 + StrCpy $R0 0 + ${If} ${SectionIsSelected} ${SecFileDaemon} + IntOp $R0 $R0 | ${ComponentFile} + ${EndIf} + ${If} ${SectionIsSelected} ${SecConsole} + IntOp $R0 $R0 | ${ComponentTextConsole} + ${EndIf} + ${If} ${SectionIsSelected} ${SecWxConsole} + IntOp $R0 $R0 | ${ComponentGUIConsole} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDocPdf} + IntOp $R0 $R0 | ${ComponentPDFDocs} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDocHtml} + IntOp $R0 $R0 | ${ComponentHTMLDocs} + ${EndIf} + Exch $R0 +FunctionEnd + +Function PageComponentsShow + + Call SelectPreviousComponents + Call UpdateComponentUI +FunctionEnd + +Function PageDirectoryPre + ${If} $AutomaticInstall = 1 + ${OrIf} $InstallType = ${UpgradeInstall} + Abort + ${EndIf} +FunctionEnd + +Function LeaveInstallPage + Push "$INSTDIR\install.log" + Call DumpLog +FunctionEnd + +Function EnterWriteTemplates + Push $R0 + Push $R1 + + Call GetSelectedComponents + Pop $R0 + + IntOp $R0 $R0 & ${ComponentDirector} + IntOp $R1 $NewComponents & ${ComponentsFileAndStorage} + + ${If} $R0 <> 0 + ${OrIf} $R1 = 0 + Pop $R1 + Pop $R0 + Abort + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 = 0 + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 0 + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags DISABLED + DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED + ${Else} + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" State 1 + DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 2" Flags + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 3" State "C:\$ConfigClientName.conf" + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST + ${EndIf} + + + !InsertMacro MUI_HEADER_TEXT "$(TITLE_WriteTemplates)" "$(SUBTITLE_WriteTemplates)" + !InsertMacro MUI_INSTALLOPTIONS_DISPLAY "WriteTemplates.ini" + + !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 2" State + ${If} $R0 <> 0 + File "/oname=$PLUGINSDIR\client.conf.in" "client.conf.in" + + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\client.conf.in"' + !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 3" State + ${If} $R0 != "" + CopyFiles "$PLUGINSDIR\client.conf.in" "$R0" + ${EndIf} + ${EndIf} + + + Pop $R1 + Pop $R0 +FunctionEnd + +Function SelectPreviousComponents + ${If} $InstallType <> ${NewInstall} + IntOp $R1 $PreviousComponents & ${ComponentFile} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecFileDaemon} + !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecFileDaemon} + !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_RO} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentTextConsole} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecConsole} + !InsertMacro SetSectionFlag ${SecConsole} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecConsole} + !InsertMacro ClearSectionFlag ${SecConsole} ${SF_RO} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentGUIConsole} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecWxConsole} + !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecWxConsole} + !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_RO} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentPDFDocs} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDocPdf} + !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecDocPdf} + !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_RO} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentHTMLDocs} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDocHtml} + !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecDocHtml} + !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_RO} + ${EndIf} + ${EndIf} +FunctionEnd + +Function UpdateComponentUI + Push $R0 + Push $R1 + + Call GetSelectedComponents + Pop $R0 + + IntOp $R1 $R0 ^ $PreviousComponents + IntOp $NewComponents $R0 & $R1 + + ${If} $InstallType <> ${NewInstall} + IntOp $R1 $NewComponents & ${ComponentFile} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentTextConsole} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecConsole} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecConsole} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentGUIConsole} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentPDFDocs} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentHTMLDocs} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_BOLD} + ${EndIf} + ${EndIf} + + GetDlgItem $R0 $HWNDPARENT 1 + + IntOp $R1 $NewComponents & ${ComponentsRequiringUserConfig} + ${If} $R1 = 0 + SendMessage $R0 ${WM_SETTEXT} 0 "STR:Install" + ${Else} + SendMessage $R0 ${WM_SETTEXT} 0 "STR:&Next >" + ${EndIf} + + Pop $R1 + Pop $R0 +FunctionEnd + + +!include "InstallType.nsh" +!include "ConfigPage1.nsh" +!include "ConfigPage2.nsh" +!include "DumpLog.nsh" diff --git a/bacula/technotes b/bacula/technotes index f74eb2ea5c..a7137a8485 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -1,10 +1,13 @@ Technical notes for current SVN General: -04Apr09 + +03Apr09 +kes Implement more automatic build of Win64 client. Note, there are still + lots of warning messages, but it seems to build a correct binary. +02Apr09 kes Enhance Job messages from SD when the FD->SD protocol is incorrect and the SD hangs up. Previously this looked like a comm error. -02Apr09 mvw Fixed problem in xattr and acl code trying to send empty acl or xattr streams. mvw Fix for bug #1261 where we send out a null stream when a file only an -- 2.39.5