From b03fb29542ff875fe200cf9a6de76144e75bb510 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 1 Nov 2009 23:19:04 +0100 Subject: [PATCH] Add bat to Win32 build and install --- bacula/.gitignore | 5 +- bacula/src/qt-console/bat.pro.mingw32.in | 6 +- bacula/src/qt-console/win32/qmake.conf | 2 +- bacula/src/win32/External-mingw32 | 2 +- bacula/src/win32/Makefile | 39 +- bacula/src/win32/README.mingw | 1 + bacula/src/win32/build-depkgs-mingw32 | 11 +- .../full_win32_installer/ConfigPage1.nsh | 294 ++ .../full_win32_installer/ConfigPage2.nsh | 454 +++ .../win32/full_win32_installer/DumpLog.nsh | 46 + .../full_win32_installer/InstallType.ini | 56 + .../full_win32_installer/InstallType.nsh | 99 + .../src/win32/full_win32_installer/Start.bat | 5 + .../src/win32/full_win32_installer/Stop.bat | 5 + .../full_win32_installer/WriteTemplates.ini | 48 + .../full_win32_installer/bacula-dir.conf.in | 380 +++ .../full_win32_installer/bacula-fd.conf.in | 44 + .../full_win32_installer/bacula-logo.bmp | Bin 0 -> 26046 bytes .../full_win32_installer/bacula-sd.conf.in | 115 + .../full_win32_installer/bconsole.conf.in | 10 + .../full_win32_installer/build-installer.cmd | 70 + .../full_win32_installer/bwx-console.conf.in | 10 + .../win32/full_win32_installer/client.conf.in | 11 + .../full_win32_installer/installer.vcproj | 154 + .../full_win32_installer/storage.conf.in | 10 + .../win32/full_win32_installer/winbacula.nsi | 1412 ++++++++ .../src/win32/win32_installer/InstallType.nsh | 3 + bacula/src/win32/win32_installer/Makefile | 7 +- bacula/src/win32/win32_installer/bat.conf.in | 10 + .../src/win32/win32_installer/winbacula.nsi | 2870 +++++++++-------- 30 files changed, 4733 insertions(+), 1446 deletions(-) create mode 100644 bacula/src/win32/full_win32_installer/ConfigPage1.nsh create mode 100644 bacula/src/win32/full_win32_installer/ConfigPage2.nsh create mode 100644 bacula/src/win32/full_win32_installer/DumpLog.nsh create mode 100644 bacula/src/win32/full_win32_installer/InstallType.ini create mode 100644 bacula/src/win32/full_win32_installer/InstallType.nsh create mode 100644 bacula/src/win32/full_win32_installer/Start.bat create mode 100644 bacula/src/win32/full_win32_installer/Stop.bat create mode 100644 bacula/src/win32/full_win32_installer/WriteTemplates.ini create mode 100644 bacula/src/win32/full_win32_installer/bacula-dir.conf.in create mode 100644 bacula/src/win32/full_win32_installer/bacula-fd.conf.in create mode 100644 bacula/src/win32/full_win32_installer/bacula-logo.bmp create mode 100644 bacula/src/win32/full_win32_installer/bacula-sd.conf.in create mode 100644 bacula/src/win32/full_win32_installer/bconsole.conf.in create mode 100644 bacula/src/win32/full_win32_installer/build-installer.cmd create mode 100644 bacula/src/win32/full_win32_installer/bwx-console.conf.in create mode 100644 bacula/src/win32/full_win32_installer/client.conf.in create mode 100644 bacula/src/win32/full_win32_installer/installer.vcproj create mode 100644 bacula/src/win32/full_win32_installer/storage.conf.in create mode 100644 bacula/src/win32/full_win32_installer/winbacula.nsi create mode 100644 bacula/src/win32/win32_installer/bat.conf.in diff --git a/bacula/.gitignore b/bacula/.gitignore index 1a47809201..75b372a38c 100644 --- a/bacula/.gitignore +++ b/bacula/.gitignore @@ -440,7 +440,10 @@ src/qt-console/moc/moc_*.cpp src/qt-console/mount/.*.swp # src/qt-console/obj/ -src/qt-console/obj/*.o +src/qt-console/obj +src/qt-console/obj32 +src/qt-console/moc32 +src/qt-console/ui32 # src/qt-console/testprogs/examp/ src/qt-console/testprogs/examp/main diff --git a/bacula/src/qt-console/bat.pro.mingw32.in b/bacula/src/qt-console/bat.pro.mingw32.in index 93b97cb083..26f5e01008 100644 --- a/bacula/src/qt-console/bat.pro.mingw32.in +++ b/bacula/src/qt-console/bat.pro.mingw32.in @@ -34,9 +34,9 @@ qwt { } RESOURCES = main.qrc -MOC_DIR = moc -OBJECTS_DIR = obj -UI_DIR = ui +MOC_DIR = moc32 +OBJECTS_DIR = obj32 +UI_DIR = ui32 # Main window FORMS += main.ui diff --git a/bacula/src/qt-console/win32/qmake.conf b/bacula/src/qt-console/win32/qmake.conf index 2d19b18e5a..64d850ba0a 100644 --- a/bacula/src/qt-console/win32/qmake.conf +++ b/bacula/src/qt-console/win32/qmake.conf @@ -24,7 +24,7 @@ QMAKE_CFLAGS_DEPS = -M QMAKE_CFLAGS_WARN_ON = -Wall QMAKE_CFLAGS_WARN_OFF = -w QMAKE_CFLAGS_RELEASE = -O2 -QMAKE_CFLAGS_DEBUG = -g +QMAKE_CFLAGS_DEBUG = -g -O2 QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses QMAKE_CXX = $(DEPKGS)/cross-tools/mingw32/bin/mingw32-g++ diff --git a/bacula/src/win32/External-mingw32 b/bacula/src/win32/External-mingw32 index 30ede46fb3..1ab7ee2c52 100644 --- a/bacula/src/win32/External-mingw32 +++ b/bacula/src/win32/External-mingw32 @@ -32,7 +32,7 @@ OPENSSL|http://www.bacula.org/depkgs-mingw32/openssl-0.9.8b.tar.gz PCRE|http://www.bacula.org/depkgs-mingw32/pcre-6.3.tar.bz2 POSTGRESQL|http://www.bacula.org/depkgs-mingw32/postgresql-base-8.1.4.tar.bz2|postgresql-8.1.4 PTHREADS|http://www.bacula.org/depkgs-mingw32/pthreads-snap-2004-06-22.tar.gz -Qt4|http://www.bacula.org/depkgs-mingw32/qt-win-opensource-src-4.3.4.zip +Qt4|http://www.bacula.org/depkgs-mingw32/qt4.3.4-win32-bin.tar.gz|qt4.3.4-win32-bin SCONS|http://www.bacula.org/depkgs-mingw32/scons-0.96.92.tar.gz SED|http://www.bacula.org/depkgs-mingw32/sed-4.1.5.tar.gz SQLITE|http://www.bacula.org/depkgs-mingw32/sqlite-3.3.17.tar.gz diff --git a/bacula/src/win32/Makefile b/bacula/src/win32/Makefile index 240d24d06a..b03d10d191 100644 --- a/bacula/src/win32/Makefile +++ b/bacula/src/win32/Makefile @@ -1,33 +1,21 @@ ECHO_CMD=@ -ifeq ($(WIN64),yes) - DIRS= lib \ - filed \ - filed/plugins \ - console \ - scripts +WIN32_DIRS=lib cats filed filed/plugins dird stored \ + console wx-console tools scripts - INSTALLER=win64_installer +WIN64_DIRS=lib filed filed/plugins console scripts - SPECIAL=bsmtp +ifeq ($(WIN64),yes) + DIRS=$(WIN64_DIRS) + INSTALLER=win64_installer + SPECIAL=bsmtp else - DIRS= lib \ - cats \ - filed \ - filed/plugins \ - dird \ - stored \ - console \ - wx-console \ - tools \ - scripts - - INSTALLER=win32_installer - - SPECIAL= + DIRS=$(WIN32_DIRS) + INSTALLER=win32_installer + SPECIAL=bat endif -.PHONY: $(DIRS) clean all Makefile.inc win32_installer newinstaller \ +.PHONY: $(DIRS) clean all Makefile.inc win32_installer full_win32_installer \ win64_installer bsmtp all: Makefile.inc $(DIRS) $(SPECIAL) $(INSTALLER) @@ -35,7 +23,10 @@ all: Makefile.inc $(DIRS) $(SPECIAL) $(INSTALLER) clean: $(DIRS) win32_installer newinstaller win64_installer $(ECHO_CMD)-rm -rf release32 release64 -newinstaller: +bat: + (cd ../qt-console; ./make-win32) + +full_win32_installer: @if test -f Makefile.inc; then \ if $(MAKE) -C $@ $(MAKECMDGOALS); then \ echo "\n===== Make of $@ succeeded =====\n\n" ; \ diff --git a/bacula/src/win32/README.mingw b/bacula/src/win32/README.mingw index f60353d332..3e39f2edb4 100644 --- a/bacula/src/win32/README.mingw +++ b/bacula/src/win32/README.mingw @@ -96,6 +96,7 @@ Note, a number of packages must be installed to build the cross-tools and the depkgs files. Most are rather standard such as gcc, g++, make, ... However a few that you may not have are: + wget texinfo flex bison diff --git a/bacula/src/win32/build-depkgs-mingw32 b/bacula/src/win32/build-depkgs-mingw32 index d615e152c4..7ccad8bc3e 100755 --- a/bacula/src/win32/build-depkgs-mingw32 +++ b/bacula/src/win32/build-depkgs-mingw32 @@ -36,6 +36,7 @@ SCRIPT_DIR=`pwd` cd ../../.. TOP_DIR=`pwd` +TOP_DIR=${DEPKGS:-${TOP_DIR}} if [ -e ${TOP_DIR}/cross-tools/mingw32/bin/mingw32-gcc ] then @@ -63,7 +64,7 @@ export PATH=${BIN_DIR}:${PATH} OLD_IFS=${IFS};IFS="|"; while read package url dir mkd; do - echo "Got package ${package}" +# echo "Got package ${package}" case ${package} in \#*) ;; *) eval "URL_${package}=${url};DIR_${package}=${dir};MKD_${package}=${mkd}";; @@ -512,7 +513,13 @@ process_dvd_rw_tools() process_qt4() { get_source "${URL_Qt4}" "${DIR_Qt4}" "${MKD_Qt4}" - + echo "Installing Qt4" + rm -rf ${DEPPKG_DIR}/include/qt ${DEPPKG_DIR}/include/src + cp -a include/* ${DEPPKG_DIR}/include/ + rm -rf ${DEPPKG_DIR}/lib/qt +# cp -a ${DEPPKG_DIR}/src/${DIR_Qt4}/lib/* ${DEPPKG_DIR}/lib/ + cp -a lib/* ${DEPPKG_DIR}/lib/ + cp -p lib/qt/*.dll ${DEPPKG_DIR}/bin/ } if [ "$#" -eq 0 ] diff --git a/bacula/src/win32/full_win32_installer/ConfigPage1.nsh b/bacula/src/win32/full_win32_installer/ConfigPage1.nsh new file mode 100644 index 0000000000..71965a2a38 --- /dev/null +++ b/bacula/src/win32/full_win32_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/full_win32_installer/ConfigPage2.nsh b/bacula/src/win32/full_win32_installer/ConfigPage2.nsh new file mode 100644 index 0000000000..532af9b069 --- /dev/null +++ b/bacula/src/win32/full_win32_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="Enter data for Director allowed to access this Client"$\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/full_win32_installer/DumpLog.nsh b/bacula/src/win32/full_win32_installer/DumpLog.nsh new file mode 100644 index 0000000000..c450044a80 --- /dev/null +++ b/bacula/src/win32/full_win32_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/full_win32_installer/InstallType.ini b/bacula/src/win32/full_win32_installer/InstallType.ini new file mode 100644 index 0000000000..73fb8d9390 --- /dev/null +++ b/bacula/src/win32/full_win32_installer/InstallType.ini @@ -0,0 +1,56 @@ +; +; Note: certain text in this file is overwritten by the code in +; InstallType.nsh +; + +[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 (not recommended) +Left=6 +Right=252 +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 have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work. +Left=17 +Right=295 +Top=104 +Bottom=132 diff --git a/bacula/src/win32/full_win32_installer/InstallType.nsh b/bacula/src/win32/full_win32_installer/InstallType.nsh new file mode 100644 index 0000000000..396f88bf81 --- /dev/null +++ b/bacula/src/win32/full_win32_installer/InstallType.nsh @@ -0,0 +1,99 @@ +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" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." + + 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 have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." + ${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." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You have more options, but you will have to manually edit your bacula-fd.conf file before Bacula will work." + ${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/full_win32_installer/Start.bat b/bacula/src/win32/full_win32_installer/Start.bat new file mode 100644 index 0000000000..0b61f7ec1d --- /dev/null +++ b/bacula/src/win32/full_win32_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/full_win32_installer/Stop.bat b/bacula/src/win32/full_win32_installer/Stop.bat new file mode 100644 index 0000000000..3b1d0e5b91 --- /dev/null +++ b/bacula/src/win32/full_win32_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/full_win32_installer/WriteTemplates.ini b/bacula/src/win32/full_win32_installer/WriteTemplates.ini new file mode 100644 index 0000000000..e4fb1de804 --- /dev/null +++ b/bacula/src/win32/full_win32_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="Save Client template in:" +Left=6 +Right=240 +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="Save Storage template in:" +Left=6 +Right=248 +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/full_win32_installer/bacula-dir.conf.in b/bacula/src/win32/full_win32_installer/bacula-dir.conf.in new file mode 100644 index 0000000000..6b3fe43a48 --- /dev/null +++ b/bacula/src/win32/full_win32_installer/bacula-dir.conf.in @@ -0,0 +1,380 @@ +# +# 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 = (+Y|FC8 zmOZw|Gal!0nw_-c-FyN6M;J?6wOu2tU|-(=h88B z5AY}T*@vv8B%KuzG!o#k% zKlj}qbANtOKV}LkZ4*Tw-zc%MP9o$@0sA|Kxj@Lng0#SQE>^6i{O-h$H1hdtLNYLD z?HYe<_kW)JOcZ~zRA_2mM92-6{fJ@j6Y@CB+xz{6N`75*u~0NFg1t9hba%Xnj*siJ z+5|eR{7UcX>)Z%M^oDzD`3e4f%1SH~|Lqi1$JdSk0w@i9Tb*e2$?DC-+HQ2Bdy^%Q zMl^m3ZXs((U40QZblBqMS-2%EQ^gHJ*Rn$1^9JF^S)uUTo;+bI&sRrY2L+x}-C3rJ z100@ih4^)y`9D9qRkCxtj3}LA*;@?z1tITvxQ2hYNJCbv{SI&&$-gyx@@9Yb4Mp~K zMb`D+%o}}K&uQ2DvKAGY=zMb^_x51ko#B&cw}$d=4(6ia27h8qER8Z~4J#?mpnR?K9^t)W~Dcz3h_4L6jM zft(vy2nKn^Lhut_ys5~(4H`f{ULPyGKUR2;8v&Hu0woxngJSX7gDlg)L3fKThqjyj zIdo~mbX}CBr*NQ51nfMu6ttY%gSqGoG5`+c?;6nfd%W`XgHlb69HKnTvad7DXGGzD`Aa|)ZW1&0kT4(ar&g3iYNw_|zt#nAiE7yC|mwK~qV7)zbgoUoO z>pggq364-q0L~hccqUSQ_2*pg$w1G=o^-s35w7=TF9G(R^lM$Ibn1?zm06xi3GL94 zyi9`vJk7zdOW~T$U2j#V`t%eObVM$_U;kq~OClWe+B)NMH#V1jJly5ua~NI9s1E-w=y- z_8D!yA!fcl=3ITkg~r5-Euu@UQmhoOUuu3X=t#S8<@0f2fY68u`cl>u2Q?)z*ak8^hdYnKKOgF2jJ2{Xdz{eEBq0MyLRAz@lcW!lufD zPob3_KV5p_blFCYK0khnwiDBpAv0CsXKEuk&c>dpi=L~Fn5~YOtBJy*z$Pr=&T#%6 zEP;1h)RN@GSS@s=V43r@f8?w@;!JH6P&(HTccwn(Om*Z;Wf+~h95g(e40I?xK3R5R zsvKm5&DX|&p%+^rMdEW!!ui_h8F@I?a=I)SeL(QK533gg2hrwHbMjA0IO5wp!NiY0_7lPx(Y9b&d7m7FZ116LpCNkPu=xyRc@5_J4Cfvh zD>yb$5;$2Lgyl>Y1&kN^VUUR;|EY=)$SSmQsXvQa70yuL=H_4?>=-};$AQlTeZ~J& zX&^-Xu&a#4DZ2guc54Glab{OQqglP{}|rFjI&kYvsDqe0Wo6*ejslk z#~Y+>xR!xzufZJe(UV8Viu}NFh#&Osd{aD>3!()Uj}{(V9sy)L8;!wiA39X7&q%KC zX#PU8l^U-r4CgsF<) z;gi0KH22<=LtRM+JEcyY(t}+xr>7g9)1Q)@(0Wo1^`#%~&+w$|righe(%kyeTn92e zu_7$td{ZLq25(&u+U&tXI_9SC1&Xm;U&dbZ8OGt8}4;l77mT6YyYv76=MZylm*92#E{S!g$hPabWOP$HZM&p4Ju-(5*}3WIuXBAO|x&q1vN)M+ftcK)OH-D8UGLy;B4z)(^549Ik_H zx5Tz3aeupLe}~AvO|-u+*&bx{rMrz6_yGq<@6En!io;j|aJbr;GG8A{amb=L^d>v@ zBpvKaa|0vhYNFxm5x%bS@y+uUeWhN6e1J5LfJHLr0mD9G*fECvTSD3^QsW=b6)be7 zK%KFQcFDnBiD_k+VNHZ#b%bF}q``Aqb%X)>RE8PMWSTZ7ShXbBvN#ExJJ!0eUUj-?ovhhiZZVf|X< z5&9hcxEfZ58_r~zw~1`qB#u;}QeAsfTsRr9pG-Hepd+B^KN|{u3QC4N(x6Xl)(~q^ z7i}>pGcO4?8c(-w6CZ$9o+=HRZ-_?(%k4_?5aA;nnyw5T&hu@T9vn@xlZTshi%mOa z2cVmNr&Z0dDLH=}k2rO!w z*zsJhsS+{fmhTbaY|$B~*AZis;j7OPKo`Z0&(Dt9GBnJ~->hEogc3lAr@oFG#HlXA zxFO1PM7Amkz!pS;)YVt`8-59R5wD{IZXD;b4I5(2A&~XaW~b61&wv8;Y#;*-BRoCG z>X>+)Z{7k`_YsNCkQk+J;4ehfxjjz5Q(^}fJXsuwxD;B0y%mC3_+qGDo7myPNmEW> zFpG!G+j>0P8T>`GkEnH(kB`q*4pev&@~S{Ez_70}?AJ7(!(3q5$Am1N6vw_Xm4lrQ zB82{AhoT^!co5)9h`Y)bUnONPB_&UyqGO8Wdfl3OD*YeEgill0V8 zF)~;H2H9(92JhMx$GnvMS z8~`!`p85J{ga-(35M%eIxb{h{QjhRj4;=h50{4%k9{?ZEH41O^rrjG`-gmrxp{z11 z5J3*h%rXq}08q)7;VactyHO~al@RvEbRJkwqq}7L!sEPA1%}>at8lw63MoSgIZjB> zcdz&}fcBwfm+l-xy`7Bgd*XBlMEkTDe)&Mgy)M$QOJdWPdI&Kj0(+Q!=q7dn2#wC< zLI^P(?3ME#v+A}Ooz|#*sXn|qD1QSGi zn%UL#OAUKds6HaTMQRk=G~TYhb+)Wk4nBUvFkdjt3?DBSPPt&Vh~( zWPA3??2CdhAPlvuwx(-Wyg_BCX-SY#aiC#I(E5gl#X$zmQTxnxgKJ)pSpA)jeF?ht z;rnW-V}fXbelJaR2Z$mZJ;J|XY}4}nu*stFxx}XA1n9@RmZ8Dj=VzuWj;Qp-?={;6 z!wxaFc>CvndgW4ovER<(00VAzqY{u2i0g7&p~|S_xN+GDlMbnqJV2`|#1O{W+Y&|< z7#a=?yz+-He^%`|xK~*TVrETL!e6;K*q3Bce!?8Dqm_qR&=H<$cwQT2-H~*tE=(73LQAYk*$IFN zgFtc6(XyY)Fm97NBH$T0=?hK7E{SfJq}Ex!STg*$nK*IuRDX9%#0#*%*j6LGgALlM zU48d*QAT_UA%9@mUoh-H2n1CuGsv<}wyHwc9wtQ|dpwp^1_bulw##ph`j8%7b)HQKJg4`SIQ5{@T@{hVl^o{zSc! z$g)#p(Hw747irX*VAm3FSs!ISlL0=$Cb$wMD7)97bYF+at~2SNBEx+k0~_Q+%|iR@ z#jvQr0lM!8YD;~TT7-6B@pM%vHfy&OImq4d`uN_}qLeUXR{xe^-)GtP81@gW;HH2n zVFZ(eER-b%y>>bmi9zh&VOLl9=%TFRqs6$X3tZLJoHf)AYN$Cq-PF|_wHVOpq^#_t z#>TpuyLQFyt`0S*4b$rv0vWg!SY6m&*Qs>9rZ}rsp

|ZBx9>V3L`)6|ao@{_V+= z>mwC;uB0wZzb%G0s@9WJkL3Z3Ja}(SsJ=Wz53M>>|Eb15G^h$Tz@#-{w4u+i7}fxT zn|1X(Qe=6`PwZ@pv&1F>nGHaP%mBm*tvA&L5k5A0*dxFv20H*u_iZ}y#=D$*<98{j zmxp_`D=A;>5LwlR@8bu-D+t@LFQzTk9XS)U{&Za3dXfFW4L5jCvP-+fp>q0u~c&hJgqwNT1kkJpf%N@dcbo?yvNl9VQ|sND zK$ZGv^Y+C30G7|cVSB}=0Y^_BL(B{d-y*bai8HGT!PHLMcL=Rbj`zmDpb+XRQFxvF zk9Q&fZi+Q&7uiD$hH`yq0T)0E8l0>pEK-#W0-1q`8;Xf@0F=u5IMI=;-uZCa6D9u;=`)3&M}RaWud zqT;({i|>}LxE@6itFq-Np*9ozMOf>yYgf#UJ=rNfhAol%5F}vtQ6FJEDuqhIOM>qZ zMYpMx-L(-WHIc>xVq+H*UI_I;{Dsb(B2PhWs8M5tK|>^7L4IDX=FF&dzzmBll9$ z##ER{cnzX-e7PwH5#KpFx^ZZXMw-Ynn@Yz|u&a>XqiNoTU9o#tm9Ylq zdR+_IhbQoioJ#7$GIRIvkC+su?1-^VNsmwm9vN{3P(>_2p9PYA+J~&9{=W1)xE)tvyBNjZs<)yyb2?L z!QGr4<4z@zp1AD;i93fxIzytJgNZtWB6^P-`b4~IShQ;{ZO3t&UE6gt6g`UvY-4-k zcecbMooEl&&?2-MPcySO0LxrBBkU1*(CBL3F3$fNL`C+2{xmxRj??%@WQUv46cY_K zh$!4HG~KOFr~|=(j`zgv>58M*o`k(?uide_^w;>k+;w+-n0{4=!3a&HSScy{C5p#e zBDG=Jur;2kq~RYu)EmshxgHMOfj>?^rz%b$ghn`B7Y!3(r@13GIiaW}RD+AtAPjCH z5sJDP^G=B^lxwz{Cj3!tf@25_vbN!15r5u9Nd_$@$;CwUK&L8fB>!l;)M+Zy%xo7> zMc@jR^pJWOT+G(tgjp{ua|SphTNA`ZgIV5?Hz?zco^+fFtt*E4Y$;UFPjt?DBJ z9)|MqmMlEsXBP{v_hn%JIEZ*P33&iW4&8(A+bgs+4%Ak6(PA98vyPgA16s_1?Odbx z^iMpu*Jjb#{&--`7r*`{CoZWeayL@VIQHsGbwvWdU1U3y1XBr7gsFryI=Y#`BS7P9 zK>Wf)bD6I?vUB_~M~B35AjvYw9=lhlFgjz&2en!2?W~m+W2Gsu;F_f-W2q@vzG?_8 zwzHP_bsJ;5jX6*iy0<=DZ&(68+No=XPE5a39msY{9FRqUkW-H{bP~sZw5SQkM*X=+ z62i3Ne6vex-x>?My5H0yy{~ap?!UEPxSR8j9@De0*Mu2$i0wvB9-Xg?!65WZ5ax~> z1lP3*=~9k~StlV#$1VFu0rN|i{g{xN#=`J7=Sxv*1U?Ss9O(xiPe32xp`1-j z#QMgW9GI9FTtLIk+J+}^jcaNo&=B&EL>#tAIEp%zVQ#$#DhU+> zYw$WEAKMr2{T%&MYzejlJ*h7Aq!`(xG}jJ^!)OY>UN^*7oL1sRuoZ6sgs0o;bDEjd z-(laMxMx_r8+_clH3(CjbXV$>IwCZMH-s6a$MLA9;0o&Q44u5znR=!=3dfE;GW*6T z2(YdDp`v@Y7fU^q`V#0MSoNR&`AJ=zb$g->&dSd=#G~{D8}qwdWg5oWxJ?w_8O=wu zdAVJRB0ihj8JD3;9!|1XX*}~9L6XO(BRc~dL zBQ#j$8x2`$;Hs?R#l_N|#)e66z4<=qDLEo&6WN1_$T%T5#92J@5*_dkGC%}&gYWJv zb7FLG5uK+ye-kkEkqj28zWT*vVZ{+vv=aI%02a#vFF*47Ty&b$L$!CfCUFsRQxeZ`B60-iK0#bs(~CA)R6Z$&>9pn zEq0}ysf)o0X2L78x7P80c5I)->sQh z4Mq4HhzfWOnOW#c$1A5w0u>pDJH>V#iNJx67Ccxsc=7ThP&i(nQx%|%Y%?k%=4zwi z8L2X^(7ATx&+q1KV``ODuxG^P5f&9$9n>LL5OT9JujuV_`6w%bF&`^D)}QLqD}kGU z%p5`b)X+57$u(DNhg4lFPJKICyvFu84Q*WG)wSbUtr%7H2(6tWr^Ds5mp(n;o?Lxm zCpN;!A0iWuv;JuWY+y~2%c)Fr^W9KMxV*!*7Re7EzWdcT|54ydJp!r-uuPohpcn(y zFHlUJ#GTDG*3m?I!IvlnYwZ+k>qyw`ag0_RuAt%Dt9HEFwir$A1be57hcCbX>DT{S zA`w;xYL3ywCR8cn^|!u;UBx~Q59*rA zM;hvDgVaZ57z9aX|LeCuZVA_f(VHv{#2Gzger*i77U$J_s_$I=AquE2wM%h)jJgr1 z^t z%^}=;d&QqqJT_+7LbzLI{q-s>7b3BngTG6-F}lbf%Ha+tOyA^&v9{Zt7(MJnar+(luAt!&WYl zUI7hdg)dz`T^qKyF3O}S#=IiLDDsd~d8l1avLklxQLZ5_g?h9A*-LC9 zKqSPeKV`qf(=yh}70K16So5Y>v-(Km1ExN;QC1ydTWklA*`}xY{n@JpGfzXk`h?B` zl^jADQW{lB;E>_oE^?gBGTgEiICv8hm6dm~Lu%6;YobUy3>>iWM1dtArml-{_+dX> zD0FpB$G15Q3%3YmM8Gq|Ft>=(f7f{-^Y;%+pvViIsYvJ{3xQ&l!BpGPRP#ZZX}`=^ zAvGM38VyK|pKkq9qkf6epwy^4(Xctj1cffh0ORN%@ixvGQCmeTPpZS=R$w$*6YXcR z45eOHA}^=r=siu5`rS!1Hv%C92eBPMpbpkUF(JC(FIcaT*^H)`4}b;hx;4-IXDW0 zzMv|pEBVl1n!Q45hOil16$IPuiNL|6CBd>MpHx0V=j*lO;G*jfD{6 za2yrOKnZ~a_Gnlawq1~@b_u4i=WAWoQ?iCU9D#vgq-AI^71y|uCnuy+;Pj^}gHeNu zAZIzwT(MWc8QTX$m8j^0_zmWI!w=Gfm=qTbf*X28%}lB*CvVt(3gJ&_!gI}@ZXMKX z|D>@HqT-=kibErgjDxXr!QgH1CdoFyp;ctpo#KL&IB-CLC6<4yKL@P8H@QI>IY$2F zVquUwBF_&5%tr$HWd}|n=NP7)W#@^~|1sQqpdtBSb(SzSPIj{^bh_&3h3bGFuHX$z zprsdF>DRg|p7Raf2XQH)Q=FGUo6a>S@O3zV2mu=u4Y4|`3LGVRA~dDdFKLJ22PcaI zupL7Q3L*!T(xHAEH4Hc<=l15o69s+)IX>9gA&BKCT1No?CnXP*q#aUZxFN5IVNrdD zJSr_gL^WfLcOASy{vWDbbdnnda%QF+))E7s;}A`qBiuZQ#bRL#Q`T)D5XP8SQ0oVkDxg8W$-oR zYX@0-|JM1cmLh~Mj~V7y3=6HC2NN0QO;%8)q5cz;=pb+<s(2LEf*u6kU?oCCY@87jVtWf0fWoTb zTwerKs8EIGB7cRHKA1>LI_ZZV=%0aD9W?_}m0PJ>CGt%*c`yv2l2aen%qXC*eRSl5+SDOia@Xetm+$@BrUPS3E@LyBV%i}|5T#hQUVfvtz@YHzgTvHsqHsYFqn+r`s zq-0V0jtGR3x=|##4)E1Kc|PJT)EgtT9JO^=(Kya63kSFg|Q++{GLoN`!iQLZPdva`N0zLQt%Rl|E=p$}-6jDej zUt_=VwGH1dpaNgQMKwu~C}<*dkbaee9TxZT0$svD4ib-G4S)hBw6)+<4k@66!J!-T zF>3D6AAtwmJ`d*NLlxk5xh)CZFg{1dvngp4Bk7I7LB?f#bc1hdxTxuBCqAo5!KXSX z0R2jd)A*+g<)L> zFa$ADU!5&q7>Oceie*1w1Rn|n|DmCNOlw%(_jSqK|o5Rmrd^?e;C%aejyq|xxP%n-iR1D%<0(>L*%7(N_R&`ijn4d9f zuWM^ps8>aP$2*JT(ix)_L(%**`u`A*6*? z&9NT~1o+n;E(-(~G&Jw1Y<{HyZ7X?f&`Q(ob&|e7KPL>5a;du9tqWSoqy~*b!l6eUINt3gq?V}sf{-VKTp}c0Lt~N< zJx|wdp@9c&?1OQRBiM=rdjozVq!HyMn(PUEy;6f+zIM(@Me$zmT&&#G${)gr|CBy( zaIei*e|e|;v)eTv-H?BFyZ+1j6<^#c94_%pjXb8Ojicmkgv{WpbC_AwDiiWCAzu=5 zN@Yup8uMhU+BaLa{7O}IK~3#9@T5o^a7m#uC1TTC68HFA)qe_+n}hrX2vB2qs`T;s z>i4e7zkJa6_1%j4Y?q@h!Qr0A4%+8%s)vJMB=?#Ki6dl)kT9IQ;9ti&aL{9*H1KkZ z|E;OY-@V-M%524E6!aJ1|6lP6=io|zda?S$>s9YBR(*V<__r_T|L&puH!oHH@loN6 z^Q9MiGVafm{{2tNfBQ22jV$@&^Odj7S3R1+Mr?h; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bacula/src/win32/full_win32_installer/storage.conf.in b/bacula/src/win32/full_win32_installer/storage.conf.in new file mode 100644 index 0000000000..5928815c5c --- /dev/null +++ b/bacula/src/win32/full_win32_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/full_win32_installer/winbacula.nsi b/bacula/src/win32/full_win32_installer/winbacula.nsi new file mode 100644 index 0000000000..7cac72b04f --- /dev/null +++ b/bacula/src/win32/full_win32_installer/winbacula.nsi @@ -0,0 +1,1412 @@ +; winbacula.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 +; +; Version $Id$ +; +; Command line options: +; +; /service - +; /start +; +; netsh firewall add portopening protocol=tcp port=9102 name="Bacula-FD" + + +!define PRODUCT "Bacula" + +; +; 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}\winbacula-${VERSION}.exe" +SetCompressor lzma +InstallDir "$PROGRAMFILES\Bacula" +InstallDirRegKey HKLM "Software\Bacula" "InstallLocation" + +InstType "Client" +InstType "Server" +InstType "Full" + +!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 ${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 "" + + ${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 + Pop $ConfigDirectorMailAddress + + Call FindDatabaseApps + + ; Configuration Defaults + + StrCpy $ConfigClientName "$HostName-fd" + StrCpy $ConfigClientPort 9102 + StrCpy $ConfigClientMaxJobs 5 + ;StrCpy $ConfigClientPassword + StrCpy $ConfigClientInstallService "$OptService" + StrCpy $ConfigClientStartService "$OptStart" + + StrCpy $ConfigStorageName "$HostName-sd" + StrCpy $ConfigStoragePort 9103 + StrCpy $ConfigStorageMaxJobs 10 + ;StrCpy $ConfigStoragePassword + StrCpy $ConfigStorageInstallService "$OptService" + StrCpy $ConfigStorageStartService "$OptStart" + + ;StrCpy $ConfigDirectorName "$HostName-dir" + StrCpy $ConfigDirectorPort 9101 + StrCpy $ConfigDirectorMaxJobs 1 + ;StrCpy $ConfigDirectorPassword + StrCpy $ConfigDirectorDB 0 + StrCpy $ConfigDirectorInstallService "$OptService" + StrCpy $ConfigDirectorStartService "$OptStart" + + StrCpy $ConfigMonitorName "$HostName-mon" + ;StrCpy $ConfigMonitorPassword + + InitPluginsDir + File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe" + 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} + + 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} $ConfigStoragePassword $R0 + FileClose $R1 + ${EndIf} + + 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} $LocalDirectorPassword $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\bin" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\msvcm80.dll" + File "${SRC_DIR}\msvcp80.dll" + File "${SRC_DIR}\msvcr80.dll" + File "${SRC_DIR}\Microsoft.VC80.CRT.manifest" + File "${SRC_DIR}\pthreadVCE.dll" +!endif +!if "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\msvcm80.dll" + File "${SRC_DIR}\msvcp80.dll" + File "${SRC_DIR}\msvcr80.dll" + File "${SRC_DIR}\Microsoft.VC80.CRT.manifest" + File "${SRC_DIR}\msvcm80d.dll" + File "${SRC_DIR}\msvcp80d.dll" + File "${SRC_DIR}\msvcr80d.dll" + File "${SRC_DIR}\Microsoft.VC80.DebugCRT.manifest" + File "${SRC_DIR}\pthreadVCE.dll" +!endif +!if "${BUILD_TOOLS}" == "MinGW" + File "${SRC_DIR}\mingwm10.dll" + File "${SRC_DIR}\pthreadGCE.dll" +!endif + File "${SRC_DIR}\libeay32.dll" + File "${SRC_DIR}\ssleay32.dll" + File "${SRC_DIR}\zlib1.dll" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\zlib1.dll.manifest" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\zlib1.dll.manifest" +!endif + 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}\bacula.dll" + 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" + ${If} $MySQLPath != "" + DetailPrint "Found MySQL (version $MySQLVersion)" + ${EndIf} + ${If} $PostgreSQLPath != "" + DetailPrint "Found PostgreSQL (version $PostgreSQLVersion)" + ${EndIf} + + WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR" + + Call GetSelectedComponents + Pop $R2 + WriteRegDWORD HKLM Software\Bacula Components $R2 + + WriteRegDWORD HKLM Software\Bacula Database $ConfigDirectorDB + + ; 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\bin" + CreateDirectory "$APPDATA\Bacula" + CreateDirectory "$APPDATA\Bacula\Work" + CreateDirectory "$APPDATA\Bacula\Spool" + + SetOutPath "$INSTDIR" + File "..\..\..\LICENSE" + Delete /REBOOTOK "$INSTDIR\bin\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 "MVS" +!EndIf + + Call GetHostName + Exch $R3 + Pop $R3 + + FileWrite $R1 "s;@DISTVER@;$R2;g$\r$\n" + + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" + FileWrite $R1 's;@working_dir@;$R2;g$\r$\n' + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\" + FileWrite $R1 's;@working_dir_cmd@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR\bin" "\" "\\\\" + FileWrite $R1 's;@bin_dir@;$R2;g$\r$\n' + ${StrRep} $R2 "$INSTDIR\bin" "\" "\\" + FileWrite $R1 's;@bin_dir_cmd@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR\bin\fdplugins" "\" "\\\\" + FileWrite $R1 's;@fdplugins_dir@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR" "\" "/" + FileWrite $R1 "s;@BUILD_DIR@;$R2;g$\r$\n" + + Call IsDirectorSelected + Pop $R2 + ${If} $R2 = 1 + FileWrite $R1 "s;@director_address@;$LocalHostAddress;g$\r$\n" + ${Else} + ${If} "$ConfigDirectorAddress" != "" + FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;g$\r$\n" + ${EndIf} + ${EndIf} + + FileWrite $R1 "s;@client_address@;$LocalHostAddress;g$\r$\n" + FileWrite $R1 "s;@storage_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} "$ConfigStorageName" != "" + FileWrite $R1 "s;@storage_name@;$ConfigStorageName;g$\r$\n" + ${EndIf} + ${If} "$ConfigStoragePort" != "" + FileWrite $R1 "s;@storage_port@;$ConfigStoragePort;g$\r$\n" + ${EndIf} + ${If} "$ConfigStorageMaxJobs" != "" + FileWrite $R1 "s;@storage_maxjobs@;$ConfigStorageMaxJobs;g$\r$\n" + ${EndIf} + ${If} "$ConfigStoragePassword" != "" + FileWrite $R1 "s;@storage_password@;$ConfigStoragePassword;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorName" != "" + FileWrite $R1 "s;@director_name@;$ConfigDirectorName;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorPort" != "" + FileWrite $R1 "s;@director_port@;$ConfigDirectorPort;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorMaxJobs" != "" + FileWrite $R1 "s;@director_maxjobs@;$ConfigDirectorMaxJobs;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorPassword" != "" + FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorMailServer" != "" + FileWrite $R1 "s;@smtp_host@;$ConfigDirectorMailServer;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorMailAddress" != "" + FileWrite $R1 "s;@job_email@;$ConfigDirectorMailAddress;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} + + ${If} $ConfigDirectorDB = 1 + ${If} $MySQLPath != "" + ${StrRep} $R2 "$MySQLPath\bin" "\" "\\" + FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n" + ${EndIf} + ${ElseIf} $ConfigDirectorDB = 2 + ${If} $PostgreSQLPath != "" + ${StrRep} $R2 "$PostgreSQLPath\bin" "\" "\\" + FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n" + ${EndIf} + ${EndIf} + + FileClose $R1 + + ${If} $InstallType = ${MigrateInstall} + FileOpen $R1 $PLUGINSDIR\migrate.sed w + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" + FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' + FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' + FileClose $R1 + ${EndIf} + + ${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} + + ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /remove' ; Remove existing service + ${EndIf} + + ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /remove' ; Remove existing service + ${EndIf} + +SectionEnd + +SectionGroup "Client" SecGroupClient + +Section "File Service" SecFileDaemon + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin\fdplugins" + File "${SRC_DIR}\exchange-fd.dll" + + SetOutPath "$INSTDIR\bin" + + File "${SRC_DIR}\bacula-fd.exe" + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf" + CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"' + ${Else} + File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in" + + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bacula-fd.conf + Call ConfigEditAndCopy + ${EndIf} + + 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" '"$APPDATA\Bacula\bacula-fd.conf"' +SectionEnd + +SectionGroupEnd + +SectionGroup "Server" SecGroupServer + +Section "Storage Service" SecStorageDaemon + SectionIn 2 3 + + SetOutPath "$INSTDIR\bin" + + File "${SRC_DIR}\loaderinfo.exe" + File "${SRC_DIR}\mt.exe" + File "${SRC_DIR}\mtx.exe" + File "${SRC_DIR}\scsitape.exe" + File "${SRC_DIR}\tapeinfo.exe" + File "${SRC_DIR}\bacula-sd.exe" + File "${SRC_DIR}\bcopy.exe" + File "${SRC_DIR}\bextract.exe" + File "${SRC_DIR}\bls.exe" + File "${SRC_DIR}\bscan.exe" + File "${SRC_DIR}\btape.exe" + File "${SRC_DIR}\scsilist.exe" + File "${SRC_DIR}\mkisofs.exe" + File "${SRC_DIR}\growisofs.exe" + File "${SRC_DIR}\dvd-ram-control.exe" + File "${SRC_DIR}\dvd+rw-booktype.exe" + File "${SRC_DIR}\dvd+rw-format.exe" + File "${SRC_DIR}\dvd+rw-mediainfo.exe" + + File "/oname=$PLUGINSDIR\mtx-changer.cmd" "${SRC_DIR}\mtx-changer.cmd" + + StrCpy $0 "$INSTDIR\bin" + StrCpy $1 mtx-changer.cmd + Call ConfigEditAndCopy + + File "/oname=$PLUGINSDIR\disk-changer.cmd" "${SRC_DIR}\disk-changer.cmd" + + StrCpy $0 "$INSTDIR\bin" + StrCpy $1 disk-changer.cmd + Call ConfigEditAndCopy + + File "/oname=$PLUGINSDIR\dvd-handler.cmd" "${SRC_DIR}\dvd-handler.cmd" + + StrCpy $0 "$INSTDIR\bin" + StrCpy $1 dvd-handler.cmd + Call ConfigEditAndCopy + + File "/oname=$PLUGINSDIR\bacula-sd.conf" "bacula-sd.conf.in" + + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bacula-sd.conf + Call ConfigEditAndCopy + + StrCpy $0 bacula-sd + StrCpy $1 "Storage Service" + StrCpy $2 $ConfigStorageInstallService + StrCpy $3 $ConfigStorageStartService + Call InstallDaemon + + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause" + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"' +SectionEnd + +Section "Director Service" SecDirectorDaemon + SectionIn 2 3 + + SetOutPath "$INSTDIR\bin" + + ${If} $ConfigDirectorDB = 1 + File /oname=bacula_cats.dll "${SRC_DIR}\cats_mysql.dll" + File "${SRC_DIR}\libmysql.dll" + File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_mysql_database.cmd + File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_mysql_database.cmd + File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_mysql_tables.cmd + File ${SRC_DIR}\make_mysql_tables.sql + File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_mysql_tables.cmd + File ${SRC_DIR}\drop_mysql_tables.sql + File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_mysql_privileges.cmd + File ${SRC_DIR}\grant_mysql_privileges.sql + File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_mysql_catalog_backup.cmd + ${ElseIf} $ConfigDirectorDB = 2 + File /oname=bacula_cats.dll "${SRC_DIR}\cats_postgresql.dll" + File "${SRC_DIR}\libpq.dll" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\comerr32.dll" + File "${SRC_DIR}\libintl-2.dll" + File "${SRC_DIR}\libiconv-2.dll" + File "${SRC_DIR}\krb5_32.dll" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\comerr32.dll" + File "${SRC_DIR}\libintl-2.dll" + File "${SRC_DIR}\libiconv-2.dll" + File "${SRC_DIR}\krb5_32.dll" +!endif + File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_postgresql_database.cmd + File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_postgresql_database.cmd + File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_postgresql_tables.cmd + File ${SRC_DIR}\create_postgresql_database.sql + File ${SRC_DIR}\make_postgresql_tables.sql + File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_postgresql_tables.cmd + File ${SRC_DIR}\drop_postgresql_tables.sql + File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_postgresql_privileges.cmd + File ${SRC_DIR}\grant_postgresql_privileges.sql + File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_postgresql_catalog_backup.cmd + ${ElseIf} $ConfigDirectorDB = 3 + File "${SRC_DIR}\sqlite3.exe" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\sqlite3.exe.manifest" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\sqlite3.exe.manifest" +!endif + File /oname=bacula_cats.dll "${SRC_DIR}\cats_sqlite3.dll" + File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_sqlite3_database.cmd + File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_sqlite3_database.cmd + File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_sqlite3_tables.cmd + File ${SRC_DIR}\make_sqlite3_tables.sql + File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_sqlite3_tables.cmd + File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_sqlite3_privileges.cmd + File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_sqlite3_catalog_backup.cmd + ${EndIf} + + File "${SRC_DIR}\bacula-dir.exe" + File "${SRC_DIR}\dbcheck.exe" + + File "/oname=$PLUGINSDIR\delete_catalog_backup.cmd" "${SRC_DIR}\delete_catalog_backup.cmd" + + StrCpy $0 "$INSTDIR\bin" + + StrCpy $1 create_database.cmd + Call ConfigEditAndCopy + + StrCpy $1 drop_database.cmd + Call ConfigEditAndCopy + + StrCpy $1 make_tables.cmd + Call ConfigEditAndCopy + + StrCpy $1 drop_tables.cmd + Call ConfigEditAndCopy + + StrCpy $1 grant_privileges.cmd + Call ConfigEditAndCopy + + StrCpy $1 make_catalog_backup.cmd + Call ConfigEditAndCopy + + StrCpy $1 delete_catalog_backup.cmd + Call ConfigEditAndCopy + + File "${SRC_DIR}\query.sql" + + File "/oname=$PLUGINSDIR\bacula-dir.conf" "bacula-dir.conf.in" + + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bacula-dir.conf + Call ConfigEditAndCopy + + StrCpy $0 bacula-dir + StrCpy $1 "Director Service" + StrCpy $2 $ConfigDirectorInstallService + StrCpy $3 $ConfigDirectorStartService + Call InstallDaemon + + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Director Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-dir.conf"' +SectionEnd + +SectionGroupEnd + +SectionGroup "Consoles" SecGroupConsoles + +Section "Command Console" SecConsole + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin" + + File "${SRC_DIR}\bconsole.exe" + Call InstallCommonFiles + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf" + CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula" + ${Else} + File "/oname=$PLUGINSDIR\bconsole.conf" "bconsole.conf.in" + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bconsole.conf + Call ConfigEditAndCopy + ${EndIf} + + CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"' + +SectionEnd + +Section "Graphical Console" SecWxConsole + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin" + + Call InstallCommonFiles +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\wxbase28_vc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\wxbase28_vc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" +!endif +!if "${BUILD_TOOLS}" == "MinGW" + File "${SRC_DIR}\wxbase28_gcc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll" +!endif + + File "${SRC_DIR}\bwx-console.exe" + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bwx-console.conf" + CopyFiles "$OldInstallDir\bin\bwx-console.conf" "$APPDATA\Bacula" + ${Else} + File "/oname=$PLUGINSDIR\bwx-console.conf" "bwx-console.conf.in" + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bwx-console.conf + Call ConfigEditAndCopy + ${EndIf} + + ; Create Start Menu entry + CreateShortCut "$SMPROGRAMS\Bacula\bwx-console.lnk" "$INSTDIR\bin\bwx-console.exe" '-c "$APPDATA\Bacula\bwx-console.conf"' "$INSTDIR\bin\bwx-console.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bwx-console.conf"' +SectionEnd + +SectionGroupEnd + +SectionGroup "Documentation" SecGroupDocumentation + +Section "Documentation (Acrobat Format)" SecDocPdf + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\doc" + CreateDirectory "$INSTDIR\doc" + + File "${SRC_DIR}\manual\bacula.pdf" + CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"' +SectionEnd + +Section "Documentation (HTML Format)" SecDocHtml + SectionIn 3 + + SetOutPath "$INSTDIR\doc" + CreateDirectory "$INSTDIR\doc" + + File "${SRC_DIR}\manual\bacula\*.html" + File "${SRC_DIR}\manual\bacula\*.png" + File "${SRC_DIR}\manual\bacula\*.css" + CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual (HTML).lnk" '"$INSTDIR\doc\index.html"' +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 "$APPDATA\Bacula" /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://sourceforge.net/project/showfiles.php?group_id=50727" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support" + 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 File Daemon on this system." +LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system." +LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director 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 ${SecStorageDaemon} $(DESC_SecStorageDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon) + !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\bin\bacula-fd.exe" /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill' + Sleep 3000 + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\bin\exchange-fd.dll" /remove' + ${EndIf} + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /remove' + ${EndIf} + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /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\bin\*" + 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 "$APPDATA\Bacula\*" + Delete /REBOOTOK "$APPDATA\Bacula\Work\*" + Delete /REBOOTOK "$APPDATA\Bacula\Spool\*" + 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 "$APPDATA\Bacula\Work" + RMDir "$APPDATA\Bacula\Spool" + RMDir "$APPDATA\Bacula" +NoDel: + + ; remove directories used + RMDir "$INSTDIR\bin" + 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\bin\$0.exe" /install -c "$APPDATA\Bacula\$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\bin\$0.exe" -c "$APPDATA\Bacula\$0.conf"' + ${EndIf} + ${EndIf} + ${Else} + CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\bin\$0.exe" '-c "$APPDATA\Bacula\$0.conf"' "$INSTDIR\bin\$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 FindDatabaseApps + Push $R1 + + ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Location" + + ${If} $0 != "" + Call RemoveTrailingSlash + StrCpy $MySQLPath $0 + ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Version" + StrCpy $MySQLVersion $0 + ${EndIf} + + EnumRegKey $R1 HKLM "Software\PostgreSQL\Installations" 0 + ${If} $R1 != "" + ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Base Directory" + Call RemoveTrailingSlash + StrCpy $PostgreSQLPath $0 + ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Version" + StrCpy $PostgreSQLVersion $0 + ${EndIf} + + Pop $R1 +FunctionEnd + +Function RemoveTrailingSlash + Push $R1 + StrCpy $R1 $0 "" -1 + ${If} $R1 == "\" + StrCpy $0 $0 -1 + ${EndIf} + Pop $R1 +FunctionEnd + +Function IsDirectorSelected + Push $R0 + SectionGetFlags ${SecDirectorDaemon} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + Exch $R0 +FunctionEnd + +Function GetSelectedComponents + Push $R0 + StrCpy $R0 0 + ${If} ${SectionIsSelected} ${SecFileDaemon} + IntOp $R0 $R0 | ${ComponentFile} + ${EndIf} + ${If} ${SectionIsSelected} ${SecStorageDaemon} + IntOp $R0 $R0 | ${ComponentStorage} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDirectorDaemon} + IntOp $R0 $R0 | ${ComponentDirector} + ${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 + ${If} $OsIsNT <> 1 + Call DisableServerSections + ${EndIf} + + 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} + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 = 0 + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 0 + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags DISABLED + DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED + ${Else} + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 1 + DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State "C:\$ConfigStorageName.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} + + !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 4" State + ${If} $R0 <> 0 + File "/oname=$PLUGINSDIR\storage.conf.in" "storage.conf.in" + + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\storage.conf.in"' + !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 5" State + ${If} $R0 != "" + CopyFiles "$PLUGINSDIR\storage.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 & ${ComponentStorage} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecStorageDaemon} + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecStorageDaemon} + !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_RO} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentDirector} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDirectorDaemon} + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecDirectorDaemon} + !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${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 DisableServerSections + !InsertMacro UnselectSection ${SecGroupServer} + !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO} + !InsertMacro UnselectSection ${SecStorageDaemon} + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} + !InsertMacro UnselectSection ${SecDirectorDaemon} + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} +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 & ${ComponentStorage} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentDirector} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${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/src/win32/win32_installer/InstallType.nsh b/bacula/src/win32/win32_installer/InstallType.nsh index 396f88bf81..373f68cce1 100644 --- a/bacula/src/win32/win32_installer/InstallType.nsh +++ b/bacula/src/win32/win32_installer/InstallType.nsh @@ -63,6 +63,9 @@ Function EnterInstallType ${If} ${FileExists} "$R1\bconsole.conf" IntOp $PreviousComponents $PreviousComponents | ${ComponentTextConsole} ${EndIf} + ${If} ${FileExists} "$R1\bat.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentBatConsole} + ${EndIf} ${If} ${FileExists} "$R1\wx-console.conf" IntOp $PreviousComponents $PreviousComponents | ${ComponentGUIConsole} ${EndIf} diff --git a/bacula/src/win32/win32_installer/Makefile b/bacula/src/win32/win32_installer/Makefile index 2872474ac4..703b80d27e 100644 --- a/bacula/src/win32/win32_installer/Makefile +++ b/bacula/src/win32/win32_installer/Makefile @@ -36,7 +36,8 @@ BACULA_BINARIES := \ btape.exe \ dbcheck.exe \ scsilist.exe \ - bwx-console.exe + bwx-console.exe \ + bat.exe DEPKGS_BINARIES := \ libeay32.dll \ @@ -60,7 +61,9 @@ DEPKGS_BINARIES := \ dvd+rw-format.exe \ dvd+rw-mediainfo.exe \ wxbase28_gcc_bacula.dll \ - wxmsw28_core_gcc_bacula.dll + wxmsw28_core_gcc_bacula.dll \ + QtCore4.dll \ + QtGui4.dll NONGCC_BINARIES := \ libmysql.dll diff --git a/bacula/src/win32/win32_installer/bat.conf.in b/bacula/src/win32/win32_installer/bat.conf.in new file mode 100644 index 0000000000..7f0b5f188b --- /dev/null +++ b/bacula/src/win32/win32_installer/bat.conf.in @@ -0,0 +1,10 @@ +# +# Bacula Administration Tool (bat) Configuration File +# + +Director { + Name = @director_name@ + DIRport = @director_port@ + address = @director_address@ + Password = "@director_password@" +} diff --git a/bacula/src/win32/win32_installer/winbacula.nsi b/bacula/src/win32/win32_installer/winbacula.nsi index 7cac72b04f..075f8b3526 100644 --- a/bacula/src/win32/win32_installer/winbacula.nsi +++ b/bacula/src/win32/win32_installer/winbacula.nsi @@ -1,1412 +1,1458 @@ -; winbacula.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 -; -; Version $Id$ -; -; Command line options: -; -; /service - -; /start -; -; netsh firewall add portopening protocol=tcp port=9102 name="Bacula-FD" - - -!define PRODUCT "Bacula" - -; -; 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}\winbacula-${VERSION}.exe" -SetCompressor lzma -InstallDir "$PROGRAMFILES\Bacula" -InstallDirRegKey HKLM "Software\Bacula" "InstallLocation" - -InstType "Client" -InstType "Server" -InstType "Full" - -!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 ${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 "" - - ${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 - Pop $ConfigDirectorMailAddress - - Call FindDatabaseApps - - ; Configuration Defaults - - StrCpy $ConfigClientName "$HostName-fd" - StrCpy $ConfigClientPort 9102 - StrCpy $ConfigClientMaxJobs 5 - ;StrCpy $ConfigClientPassword - StrCpy $ConfigClientInstallService "$OptService" - StrCpy $ConfigClientStartService "$OptStart" - - StrCpy $ConfigStorageName "$HostName-sd" - StrCpy $ConfigStoragePort 9103 - StrCpy $ConfigStorageMaxJobs 10 - ;StrCpy $ConfigStoragePassword - StrCpy $ConfigStorageInstallService "$OptService" - StrCpy $ConfigStorageStartService "$OptStart" - - ;StrCpy $ConfigDirectorName "$HostName-dir" - StrCpy $ConfigDirectorPort 9101 - StrCpy $ConfigDirectorMaxJobs 1 - ;StrCpy $ConfigDirectorPassword - StrCpy $ConfigDirectorDB 0 - StrCpy $ConfigDirectorInstallService "$OptService" - StrCpy $ConfigDirectorStartService "$OptStart" - - StrCpy $ConfigMonitorName "$HostName-mon" - ;StrCpy $ConfigMonitorPassword - - InitPluginsDir - File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe" - 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} - - 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} $ConfigStoragePassword $R0 - FileClose $R1 - ${EndIf} - - 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} $LocalDirectorPassword $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\bin" -!if "${BUILD_TOOLS}" == "VC8" - File "${SRC_DIR}\msvcm80.dll" - File "${SRC_DIR}\msvcp80.dll" - File "${SRC_DIR}\msvcr80.dll" - File "${SRC_DIR}\Microsoft.VC80.CRT.manifest" - File "${SRC_DIR}\pthreadVCE.dll" -!endif -!if "${BUILD_TOOLS}" == "VC8_DEBUG" - File "${SRC_DIR}\msvcm80.dll" - File "${SRC_DIR}\msvcp80.dll" - File "${SRC_DIR}\msvcr80.dll" - File "${SRC_DIR}\Microsoft.VC80.CRT.manifest" - File "${SRC_DIR}\msvcm80d.dll" - File "${SRC_DIR}\msvcp80d.dll" - File "${SRC_DIR}\msvcr80d.dll" - File "${SRC_DIR}\Microsoft.VC80.DebugCRT.manifest" - File "${SRC_DIR}\pthreadVCE.dll" -!endif -!if "${BUILD_TOOLS}" == "MinGW" - File "${SRC_DIR}\mingwm10.dll" - File "${SRC_DIR}\pthreadGCE.dll" -!endif - File "${SRC_DIR}\libeay32.dll" - File "${SRC_DIR}\ssleay32.dll" - File "${SRC_DIR}\zlib1.dll" -!if "${BUILD_TOOLS}" == "VC8" - File "${SRC_DIR}\zlib1.dll.manifest" -!endif -!If "${BUILD_TOOLS}" == "VC8_DEBUG" - File "${SRC_DIR}\zlib1.dll.manifest" -!endif - 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}\bacula.dll" - 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" - ${If} $MySQLPath != "" - DetailPrint "Found MySQL (version $MySQLVersion)" - ${EndIf} - ${If} $PostgreSQLPath != "" - DetailPrint "Found PostgreSQL (version $PostgreSQLVersion)" - ${EndIf} - - WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR" - - Call GetSelectedComponents - Pop $R2 - WriteRegDWORD HKLM Software\Bacula Components $R2 - - WriteRegDWORD HKLM Software\Bacula Database $ConfigDirectorDB - - ; 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\bin" - CreateDirectory "$APPDATA\Bacula" - CreateDirectory "$APPDATA\Bacula\Work" - CreateDirectory "$APPDATA\Bacula\Spool" - - SetOutPath "$INSTDIR" - File "..\..\..\LICENSE" - Delete /REBOOTOK "$INSTDIR\bin\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 "MVS" -!EndIf - - Call GetHostName - Exch $R3 - Pop $R3 - - FileWrite $R1 "s;@DISTVER@;$R2;g$\r$\n" - - ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" - FileWrite $R1 's;@working_dir@;$R2;g$\r$\n' - ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\" - FileWrite $R1 's;@working_dir_cmd@;$R2;g$\r$\n' - - ${StrRep} $R2 "$INSTDIR\bin" "\" "\\\\" - FileWrite $R1 's;@bin_dir@;$R2;g$\r$\n' - ${StrRep} $R2 "$INSTDIR\bin" "\" "\\" - FileWrite $R1 's;@bin_dir_cmd@;$R2;g$\r$\n' - - ${StrRep} $R2 "$INSTDIR\bin\fdplugins" "\" "\\\\" - FileWrite $R1 's;@fdplugins_dir@;$R2;g$\r$\n' - - ${StrRep} $R2 "$INSTDIR" "\" "/" - FileWrite $R1 "s;@BUILD_DIR@;$R2;g$\r$\n" - - Call IsDirectorSelected - Pop $R2 - ${If} $R2 = 1 - FileWrite $R1 "s;@director_address@;$LocalHostAddress;g$\r$\n" - ${Else} - ${If} "$ConfigDirectorAddress" != "" - FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;g$\r$\n" - ${EndIf} - ${EndIf} - - FileWrite $R1 "s;@client_address@;$LocalHostAddress;g$\r$\n" - FileWrite $R1 "s;@storage_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} "$ConfigStorageName" != "" - FileWrite $R1 "s;@storage_name@;$ConfigStorageName;g$\r$\n" - ${EndIf} - ${If} "$ConfigStoragePort" != "" - FileWrite $R1 "s;@storage_port@;$ConfigStoragePort;g$\r$\n" - ${EndIf} - ${If} "$ConfigStorageMaxJobs" != "" - FileWrite $R1 "s;@storage_maxjobs@;$ConfigStorageMaxJobs;g$\r$\n" - ${EndIf} - ${If} "$ConfigStoragePassword" != "" - FileWrite $R1 "s;@storage_password@;$ConfigStoragePassword;g$\r$\n" - ${EndIf} - ${If} "$ConfigDirectorName" != "" - FileWrite $R1 "s;@director_name@;$ConfigDirectorName;g$\r$\n" - ${EndIf} - ${If} "$ConfigDirectorPort" != "" - FileWrite $R1 "s;@director_port@;$ConfigDirectorPort;g$\r$\n" - ${EndIf} - ${If} "$ConfigDirectorMaxJobs" != "" - FileWrite $R1 "s;@director_maxjobs@;$ConfigDirectorMaxJobs;g$\r$\n" - ${EndIf} - ${If} "$ConfigDirectorPassword" != "" - FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;g$\r$\n" - ${EndIf} - ${If} "$ConfigDirectorMailServer" != "" - FileWrite $R1 "s;@smtp_host@;$ConfigDirectorMailServer;g$\r$\n" - ${EndIf} - ${If} "$ConfigDirectorMailAddress" != "" - FileWrite $R1 "s;@job_email@;$ConfigDirectorMailAddress;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} - - ${If} $ConfigDirectorDB = 1 - ${If} $MySQLPath != "" - ${StrRep} $R2 "$MySQLPath\bin" "\" "\\" - FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n" - ${EndIf} - ${ElseIf} $ConfigDirectorDB = 2 - ${If} $PostgreSQLPath != "" - ${StrRep} $R2 "$PostgreSQLPath\bin" "\" "\\" - FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n" - ${EndIf} - ${EndIf} - - FileClose $R1 - - ${If} $InstallType = ${MigrateInstall} - FileOpen $R1 $PLUGINSDIR\migrate.sed w - ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" - FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' - FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' - FileClose $R1 - ${EndIf} - - ${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} - - ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe" - nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /kill' ; Shutdown any bacula that could be running - Sleep 3000 - nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /remove' ; Remove existing service - ${EndIf} - - ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe" - nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /kill' ; Shutdown any bacula that could be running - Sleep 3000 - nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /remove' ; Remove existing service - ${EndIf} - -SectionEnd - -SectionGroup "Client" SecGroupClient - -Section "File Service" SecFileDaemon - SectionIn 1 2 3 - - SetOutPath "$INSTDIR\bin\fdplugins" - File "${SRC_DIR}\exchange-fd.dll" - - SetOutPath "$INSTDIR\bin" - - File "${SRC_DIR}\bacula-fd.exe" - - ${If} $InstallType = ${MigrateInstall} - ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf" - CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula" - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"' - ${Else} - File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in" - - StrCpy $0 "$APPDATA\Bacula" - StrCpy $1 bacula-fd.conf - Call ConfigEditAndCopy - ${EndIf} - - 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" '"$APPDATA\Bacula\bacula-fd.conf"' -SectionEnd - -SectionGroupEnd - -SectionGroup "Server" SecGroupServer - -Section "Storage Service" SecStorageDaemon - SectionIn 2 3 - - SetOutPath "$INSTDIR\bin" - - File "${SRC_DIR}\loaderinfo.exe" - File "${SRC_DIR}\mt.exe" - File "${SRC_DIR}\mtx.exe" - File "${SRC_DIR}\scsitape.exe" - File "${SRC_DIR}\tapeinfo.exe" - File "${SRC_DIR}\bacula-sd.exe" - File "${SRC_DIR}\bcopy.exe" - File "${SRC_DIR}\bextract.exe" - File "${SRC_DIR}\bls.exe" - File "${SRC_DIR}\bscan.exe" - File "${SRC_DIR}\btape.exe" - File "${SRC_DIR}\scsilist.exe" - File "${SRC_DIR}\mkisofs.exe" - File "${SRC_DIR}\growisofs.exe" - File "${SRC_DIR}\dvd-ram-control.exe" - File "${SRC_DIR}\dvd+rw-booktype.exe" - File "${SRC_DIR}\dvd+rw-format.exe" - File "${SRC_DIR}\dvd+rw-mediainfo.exe" - - File "/oname=$PLUGINSDIR\mtx-changer.cmd" "${SRC_DIR}\mtx-changer.cmd" - - StrCpy $0 "$INSTDIR\bin" - StrCpy $1 mtx-changer.cmd - Call ConfigEditAndCopy - - File "/oname=$PLUGINSDIR\disk-changer.cmd" "${SRC_DIR}\disk-changer.cmd" - - StrCpy $0 "$INSTDIR\bin" - StrCpy $1 disk-changer.cmd - Call ConfigEditAndCopy - - File "/oname=$PLUGINSDIR\dvd-handler.cmd" "${SRC_DIR}\dvd-handler.cmd" - - StrCpy $0 "$INSTDIR\bin" - StrCpy $1 dvd-handler.cmd - Call ConfigEditAndCopy - - File "/oname=$PLUGINSDIR\bacula-sd.conf" "bacula-sd.conf.in" - - StrCpy $0 "$APPDATA\Bacula" - StrCpy $1 bacula-sd.conf - Call ConfigEditAndCopy - - StrCpy $0 bacula-sd - StrCpy $1 "Storage Service" - StrCpy $2 $ConfigStorageInstallService - StrCpy $3 $ConfigStorageStartService - Call InstallDaemon - - CreateShortCut "$SMPROGRAMS\Bacula\Configuration\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause" - CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"' -SectionEnd - -Section "Director Service" SecDirectorDaemon - SectionIn 2 3 - - SetOutPath "$INSTDIR\bin" - - ${If} $ConfigDirectorDB = 1 - File /oname=bacula_cats.dll "${SRC_DIR}\cats_mysql.dll" - File "${SRC_DIR}\libmysql.dll" - File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_mysql_database.cmd - File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_mysql_database.cmd - File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_mysql_tables.cmd - File ${SRC_DIR}\make_mysql_tables.sql - File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_mysql_tables.cmd - File ${SRC_DIR}\drop_mysql_tables.sql - File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_mysql_privileges.cmd - File ${SRC_DIR}\grant_mysql_privileges.sql - File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_mysql_catalog_backup.cmd - ${ElseIf} $ConfigDirectorDB = 2 - File /oname=bacula_cats.dll "${SRC_DIR}\cats_postgresql.dll" - File "${SRC_DIR}\libpq.dll" -!if "${BUILD_TOOLS}" == "VC8" - File "${SRC_DIR}\comerr32.dll" - File "${SRC_DIR}\libintl-2.dll" - File "${SRC_DIR}\libiconv-2.dll" - File "${SRC_DIR}\krb5_32.dll" -!endif -!If "${BUILD_TOOLS}" == "VC8_DEBUG" - File "${SRC_DIR}\comerr32.dll" - File "${SRC_DIR}\libintl-2.dll" - File "${SRC_DIR}\libiconv-2.dll" - File "${SRC_DIR}\krb5_32.dll" -!endif - File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_postgresql_database.cmd - File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_postgresql_database.cmd - File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_postgresql_tables.cmd - File ${SRC_DIR}\create_postgresql_database.sql - File ${SRC_DIR}\make_postgresql_tables.sql - File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_postgresql_tables.cmd - File ${SRC_DIR}\drop_postgresql_tables.sql - File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_postgresql_privileges.cmd - File ${SRC_DIR}\grant_postgresql_privileges.sql - File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_postgresql_catalog_backup.cmd - ${ElseIf} $ConfigDirectorDB = 3 - File "${SRC_DIR}\sqlite3.exe" -!if "${BUILD_TOOLS}" == "VC8" - File "${SRC_DIR}\sqlite3.exe.manifest" -!endif -!If "${BUILD_TOOLS}" == "VC8_DEBUG" - File "${SRC_DIR}\sqlite3.exe.manifest" -!endif - File /oname=bacula_cats.dll "${SRC_DIR}\cats_sqlite3.dll" - File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_sqlite3_database.cmd - File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_sqlite3_database.cmd - File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_sqlite3_tables.cmd - File ${SRC_DIR}\make_sqlite3_tables.sql - File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_sqlite3_tables.cmd - File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_sqlite3_privileges.cmd - File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_sqlite3_catalog_backup.cmd - ${EndIf} - - File "${SRC_DIR}\bacula-dir.exe" - File "${SRC_DIR}\dbcheck.exe" - - File "/oname=$PLUGINSDIR\delete_catalog_backup.cmd" "${SRC_DIR}\delete_catalog_backup.cmd" - - StrCpy $0 "$INSTDIR\bin" - - StrCpy $1 create_database.cmd - Call ConfigEditAndCopy - - StrCpy $1 drop_database.cmd - Call ConfigEditAndCopy - - StrCpy $1 make_tables.cmd - Call ConfigEditAndCopy - - StrCpy $1 drop_tables.cmd - Call ConfigEditAndCopy - - StrCpy $1 grant_privileges.cmd - Call ConfigEditAndCopy - - StrCpy $1 make_catalog_backup.cmd - Call ConfigEditAndCopy - - StrCpy $1 delete_catalog_backup.cmd - Call ConfigEditAndCopy - - File "${SRC_DIR}\query.sql" - - File "/oname=$PLUGINSDIR\bacula-dir.conf" "bacula-dir.conf.in" - - StrCpy $0 "$APPDATA\Bacula" - StrCpy $1 bacula-dir.conf - Call ConfigEditAndCopy - - StrCpy $0 bacula-dir - StrCpy $1 "Director Service" - StrCpy $2 $ConfigDirectorInstallService - StrCpy $3 $ConfigDirectorStartService - Call InstallDaemon - - CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Director Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-dir.conf"' -SectionEnd - -SectionGroupEnd - -SectionGroup "Consoles" SecGroupConsoles - -Section "Command Console" SecConsole - SectionIn 1 2 3 - - SetOutPath "$INSTDIR\bin" - - File "${SRC_DIR}\bconsole.exe" - Call InstallCommonFiles - - ${If} $InstallType = ${MigrateInstall} - ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf" - CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula" - ${Else} - File "/oname=$PLUGINSDIR\bconsole.conf" "bconsole.conf.in" - StrCpy $0 "$APPDATA\Bacula" - StrCpy $1 bconsole.conf - Call ConfigEditAndCopy - ${EndIf} - - CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0 - CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"' - -SectionEnd - -Section "Graphical Console" SecWxConsole - SectionIn 1 2 3 - - SetOutPath "$INSTDIR\bin" - - Call InstallCommonFiles -!if "${BUILD_TOOLS}" == "VC8" - File "${SRC_DIR}\wxbase28_vc_bacula.dll" - File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" -!endif -!If "${BUILD_TOOLS}" == "VC8_DEBUG" - File "${SRC_DIR}\wxbase28_vc_bacula.dll" - File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" -!endif -!if "${BUILD_TOOLS}" == "MinGW" - File "${SRC_DIR}\wxbase28_gcc_bacula.dll" - File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll" -!endif - - File "${SRC_DIR}\bwx-console.exe" - - ${If} $InstallType = ${MigrateInstall} - ${AndIf} ${FileExists} "$OldInstallDir\bin\bwx-console.conf" - CopyFiles "$OldInstallDir\bin\bwx-console.conf" "$APPDATA\Bacula" - ${Else} - File "/oname=$PLUGINSDIR\bwx-console.conf" "bwx-console.conf.in" - StrCpy $0 "$APPDATA\Bacula" - StrCpy $1 bwx-console.conf - Call ConfigEditAndCopy - ${EndIf} - - ; Create Start Menu entry - CreateShortCut "$SMPROGRAMS\Bacula\bwx-console.lnk" "$INSTDIR\bin\bwx-console.exe" '-c "$APPDATA\Bacula\bwx-console.conf"' "$INSTDIR\bin\bwx-console.exe" 0 - CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bwx-console.conf"' -SectionEnd - -SectionGroupEnd - -SectionGroup "Documentation" SecGroupDocumentation - -Section "Documentation (Acrobat Format)" SecDocPdf - SectionIn 1 2 3 - - SetOutPath "$INSTDIR\doc" - CreateDirectory "$INSTDIR\doc" - - File "${SRC_DIR}\manual\bacula.pdf" - CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"' -SectionEnd - -Section "Documentation (HTML Format)" SecDocHtml - SectionIn 3 - - SetOutPath "$INSTDIR\doc" - CreateDirectory "$INSTDIR\doc" - - File "${SRC_DIR}\manual\bacula\*.html" - File "${SRC_DIR}\manual\bacula\*.png" - File "${SRC_DIR}\manual\bacula\*.css" - CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual (HTML).lnk" '"$INSTDIR\doc\index.html"' -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 "$APPDATA\Bacula" /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://sourceforge.net/project/showfiles.php?group_id=50727" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support" - 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 File Daemon on this system." -LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system." -LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director 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 ${SecStorageDaemon} $(DESC_SecStorageDaemon) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon) - !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\bin\bacula-fd.exe" /kill' - nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /kill' - nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill' - Sleep 3000 - - ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" - ${If} $R0 = 1 - ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /remove' - nsExec::ExecToLog '"$INSTDIR\bin\exchange-fd.dll" /remove' - ${EndIf} - - ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd" - ${If} $R0 = 1 - ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /remove' - ${EndIf} - - ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir" - ${If} $R0 = 1 - ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /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\bin\*" - 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 "$APPDATA\Bacula\*" - Delete /REBOOTOK "$APPDATA\Bacula\Work\*" - Delete /REBOOTOK "$APPDATA\Bacula\Spool\*" - 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 "$APPDATA\Bacula\Work" - RMDir "$APPDATA\Bacula\Spool" - RMDir "$APPDATA\Bacula" -NoDel: - - ; remove directories used - RMDir "$INSTDIR\bin" - 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\bin\$0.exe" /install -c "$APPDATA\Bacula\$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\bin\$0.exe" -c "$APPDATA\Bacula\$0.conf"' - ${EndIf} - ${EndIf} - ${Else} - CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\bin\$0.exe" '-c "$APPDATA\Bacula\$0.conf"' "$INSTDIR\bin\$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 FindDatabaseApps - Push $R1 - - ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Location" - - ${If} $0 != "" - Call RemoveTrailingSlash - StrCpy $MySQLPath $0 - ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Version" - StrCpy $MySQLVersion $0 - ${EndIf} - - EnumRegKey $R1 HKLM "Software\PostgreSQL\Installations" 0 - ${If} $R1 != "" - ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Base Directory" - Call RemoveTrailingSlash - StrCpy $PostgreSQLPath $0 - ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Version" - StrCpy $PostgreSQLVersion $0 - ${EndIf} - - Pop $R1 -FunctionEnd - -Function RemoveTrailingSlash - Push $R1 - StrCpy $R1 $0 "" -1 - ${If} $R1 == "\" - StrCpy $0 $0 -1 - ${EndIf} - Pop $R1 -FunctionEnd - -Function IsDirectorSelected - Push $R0 - SectionGetFlags ${SecDirectorDaemon} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - Exch $R0 -FunctionEnd - -Function GetSelectedComponents - Push $R0 - StrCpy $R0 0 - ${If} ${SectionIsSelected} ${SecFileDaemon} - IntOp $R0 $R0 | ${ComponentFile} - ${EndIf} - ${If} ${SectionIsSelected} ${SecStorageDaemon} - IntOp $R0 $R0 | ${ComponentStorage} - ${EndIf} - ${If} ${SectionIsSelected} ${SecDirectorDaemon} - IntOp $R0 $R0 | ${ComponentDirector} - ${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 - ${If} $OsIsNT <> 1 - Call DisableServerSections - ${EndIf} - - 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} - - IntOp $R0 $NewComponents & ${ComponentStorage} - ${If} $R0 = 0 - WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 0 - WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags DISABLED - DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State - WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED - ${Else} - WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 1 - DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags - WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State "C:\$ConfigStorageName.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} - - !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 4" State - ${If} $R0 <> 0 - File "/oname=$PLUGINSDIR\storage.conf.in" "storage.conf.in" - - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\storage.conf.in"' - !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 5" State - ${If} $R0 != "" - CopyFiles "$PLUGINSDIR\storage.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 & ${ComponentStorage} - ${If} $R1 <> 0 - !InsertMacro SelectSection ${SecStorageDaemon} - !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} - ${Else} - !InsertMacro UnselectSection ${SecStorageDaemon} - !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_RO} - ${EndIf} - IntOp $R1 $PreviousComponents & ${ComponentDirector} - ${If} $R1 <> 0 - !InsertMacro SelectSection ${SecDirectorDaemon} - !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} - ${Else} - !InsertMacro UnselectSection ${SecDirectorDaemon} - !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${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 DisableServerSections - !InsertMacro UnselectSection ${SecGroupServer} - !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO} - !InsertMacro UnselectSection ${SecStorageDaemon} - !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} - !InsertMacro UnselectSection ${SecDirectorDaemon} - !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} -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 & ${ComponentStorage} - ${If} $R1 <> 0 - !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD} - ${Else} - !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD} - ${EndIf} - IntOp $R1 $NewComponents & ${ComponentDirector} - ${If} $R1 <> 0 - !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD} - ${Else} - !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${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" +; winbacula.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 +; +; Command line options: +; +; /service - +; /start +; +; netsh firewall add portopening protocol=tcp port=9102 name="Bacula-FD" + + +!define PRODUCT "Bacula" + +; +; 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}\winbacula-${VERSION}.exe" +SetCompressor lzma +InstallDir "$PROGRAMFILES\Bacula" +InstallDirRegKey HKLM "Software\Bacula" "InstallLocation" + +InstType "Client" +InstType "Server" +InstType "Full" + +!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 ${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 = Bat Console +; 5 = wxWidgets Console +; 7 = Documentation (PDF) +; 7 = Documentation (HTML) + +!define ComponentFile 1 +!define ComponentStorage 2 +!define ComponentDirector 4 +!define ComponentTextConsole 8 +!define ComponentBatConsole 16 +!define ComponentGUIConsole 32 +!define ComponentPDFDocs 64 +!define ComponentHTMLDocs 128 + +!define ComponentsRequiringUserConfig 63 +!define ComponentsFileAndStorage 3 +!define ComponentsFileAndStorageAndDirector 7 +!define ComponentsDirectorAndTextGuiConsoles 60 +!define ComponentsTextAndGuiConsoles 56 + +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 "" + + ${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 + Pop $ConfigDirectorMailAddress + + Call FindDatabaseApps + + ; Configuration Defaults + + StrCpy $ConfigClientName "$HostName-fd" + StrCpy $ConfigClientPort 9102 + StrCpy $ConfigClientMaxJobs 5 + ;StrCpy $ConfigClientPassword + StrCpy $ConfigClientInstallService "$OptService" + StrCpy $ConfigClientStartService "$OptStart" + + StrCpy $ConfigStorageName "$HostName-sd" + StrCpy $ConfigStoragePort 9103 + StrCpy $ConfigStorageMaxJobs 10 + ;StrCpy $ConfigStoragePassword + StrCpy $ConfigStorageInstallService "$OptService" + StrCpy $ConfigStorageStartService "$OptStart" + + ;StrCpy $ConfigDirectorName "$HostName-dir" + StrCpy $ConfigDirectorPort 9101 + StrCpy $ConfigDirectorMaxJobs 1 + ;StrCpy $ConfigDirectorPassword + StrCpy $ConfigDirectorDB 0 + StrCpy $ConfigDirectorInstallService "$OptService" + StrCpy $ConfigDirectorStartService "$OptStart" + + StrCpy $ConfigMonitorName "$HostName-mon" + ;StrCpy $ConfigMonitorPassword + + InitPluginsDir + File "/oname=$PLUGINSDIR\openssl.exe" "${SRC_DIR}\openssl.exe" + 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} + + 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} $ConfigStoragePassword $R0 + FileClose $R1 + ${EndIf} + + 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} $LocalDirectorPassword $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\bin" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\msvcm80.dll" + File "${SRC_DIR}\msvcp80.dll" + File "${SRC_DIR}\msvcr80.dll" + File "${SRC_DIR}\Microsoft.VC80.CRT.manifest" + File "${SRC_DIR}\pthreadVCE.dll" +!endif +!if "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\msvcm80.dll" + File "${SRC_DIR}\msvcp80.dll" + File "${SRC_DIR}\msvcr80.dll" + File "${SRC_DIR}\Microsoft.VC80.CRT.manifest" + File "${SRC_DIR}\msvcm80d.dll" + File "${SRC_DIR}\msvcp80d.dll" + File "${SRC_DIR}\msvcr80d.dll" + File "${SRC_DIR}\Microsoft.VC80.DebugCRT.manifest" + File "${SRC_DIR}\pthreadVCE.dll" +!endif +!if "${BUILD_TOOLS}" == "MinGW" + File "${SRC_DIR}\mingwm10.dll" + File "${SRC_DIR}\pthreadGCE.dll" +!endif + File "${SRC_DIR}\libeay32.dll" + File "${SRC_DIR}\ssleay32.dll" + File "${SRC_DIR}\zlib1.dll" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\zlib1.dll.manifest" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\zlib1.dll.manifest" +!endif + 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}\bacula.dll" + 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" + ${If} $MySQLPath != "" + DetailPrint "Found MySQL (version $MySQLVersion)" + ${EndIf} + ${If} $PostgreSQLPath != "" + DetailPrint "Found PostgreSQL (version $PostgreSQLVersion)" + ${EndIf} + + WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR" + + Call GetSelectedComponents + Pop $R2 + WriteRegDWORD HKLM Software\Bacula Components $R2 + + WriteRegDWORD HKLM Software\Bacula Database $ConfigDirectorDB + + ; 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\bin" + CreateDirectory "$APPDATA\Bacula" + CreateDirectory "$APPDATA\Bacula\Work" + CreateDirectory "$APPDATA\Bacula\Spool" + + SetOutPath "$INSTDIR" + File "..\..\..\LICENSE" + Delete /REBOOTOK "$INSTDIR\bin\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 "MVS" +!EndIf + + Call GetHostName + Exch $R3 + Pop $R3 + + FileWrite $R1 "s;@DISTVER@;$R2;g$\r$\n" + + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" + FileWrite $R1 's;@working_dir@;$R2;g$\r$\n' + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\" + FileWrite $R1 's;@working_dir_cmd@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR\bin" "\" "\\\\" + FileWrite $R1 's;@bin_dir@;$R2;g$\r$\n' + ${StrRep} $R2 "$INSTDIR\bin" "\" "\\" + FileWrite $R1 's;@bin_dir_cmd@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR\bin\fdplugins" "\" "\\\\" + FileWrite $R1 's;@fdplugins_dir@;$R2;g$\r$\n' + + ${StrRep} $R2 "$INSTDIR" "\" "/" + FileWrite $R1 "s;@BUILD_DIR@;$R2;g$\r$\n" + + Call IsDirectorSelected + Pop $R2 + ${If} $R2 = 1 + FileWrite $R1 "s;@director_address@;$LocalHostAddress;g$\r$\n" + ${Else} + ${If} "$ConfigDirectorAddress" != "" + FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;g$\r$\n" + ${EndIf} + ${EndIf} + + FileWrite $R1 "s;@client_address@;$LocalHostAddress;g$\r$\n" + FileWrite $R1 "s;@storage_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} "$ConfigStorageName" != "" + FileWrite $R1 "s;@storage_name@;$ConfigStorageName;g$\r$\n" + ${EndIf} + ${If} "$ConfigStoragePort" != "" + FileWrite $R1 "s;@storage_port@;$ConfigStoragePort;g$\r$\n" + ${EndIf} + ${If} "$ConfigStorageMaxJobs" != "" + FileWrite $R1 "s;@storage_maxjobs@;$ConfigStorageMaxJobs;g$\r$\n" + ${EndIf} + ${If} "$ConfigStoragePassword" != "" + FileWrite $R1 "s;@storage_password@;$ConfigStoragePassword;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorName" != "" + FileWrite $R1 "s;@director_name@;$ConfigDirectorName;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorPort" != "" + FileWrite $R1 "s;@director_port@;$ConfigDirectorPort;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorMaxJobs" != "" + FileWrite $R1 "s;@director_maxjobs@;$ConfigDirectorMaxJobs;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorPassword" != "" + FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorMailServer" != "" + FileWrite $R1 "s;@smtp_host@;$ConfigDirectorMailServer;g$\r$\n" + ${EndIf} + ${If} "$ConfigDirectorMailAddress" != "" + FileWrite $R1 "s;@job_email@;$ConfigDirectorMailAddress;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} + + ${If} $ConfigDirectorDB = 1 + ${If} $MySQLPath != "" + ${StrRep} $R2 "$MySQLPath\bin" "\" "\\" + FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n" + ${EndIf} + ${ElseIf} $ConfigDirectorDB = 2 + ${If} $PostgreSQLPath != "" + ${StrRep} $R2 "$PostgreSQLPath\bin" "\" "\\" + FileWrite $R1 "s;@SQL_BINDIR@;$R2;g$\r$\n" + ${EndIf} + ${EndIf} + + FileClose $R1 + + ${If} $InstallType = ${MigrateInstall} + FileOpen $R1 $PLUGINSDIR\migrate.sed w + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" + FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' + FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' + FileClose $R1 + ${EndIf} + + ${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} + + ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /remove' ; Remove existing service + ${EndIf} + + ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /remove' ; Remove existing service + ${EndIf} + +SectionEnd + +SectionGroup "Client" SecGroupClient + +Section "File Service" SecFileDaemon + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin\fdplugins" + File "${SRC_DIR}\exchange-fd.dll" + + SetOutPath "$INSTDIR\bin" + + File "${SRC_DIR}\bacula-fd.exe" + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf" + CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"' + ${Else} + File "/oname=$PLUGINSDIR\bacula-fd.conf" "bacula-fd.conf.in" + + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bacula-fd.conf + Call ConfigEditAndCopy + ${EndIf} + + 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" '"$APPDATA\Bacula\bacula-fd.conf"' +SectionEnd + +SectionGroupEnd + +SectionGroup "Server" SecGroupServer + +Section "Storage Service" SecStorageDaemon + SectionIn 2 3 + + SetOutPath "$INSTDIR\bin" + + File "${SRC_DIR}\loaderinfo.exe" + File "${SRC_DIR}\mt.exe" + File "${SRC_DIR}\mtx.exe" + File "${SRC_DIR}\scsitape.exe" + File "${SRC_DIR}\tapeinfo.exe" + File "${SRC_DIR}\bacula-sd.exe" + File "${SRC_DIR}\bcopy.exe" + File "${SRC_DIR}\bextract.exe" + File "${SRC_DIR}\bls.exe" + File "${SRC_DIR}\bscan.exe" + File "${SRC_DIR}\btape.exe" + File "${SRC_DIR}\scsilist.exe" + File "${SRC_DIR}\mkisofs.exe" + File "${SRC_DIR}\growisofs.exe" + File "${SRC_DIR}\dvd-ram-control.exe" + File "${SRC_DIR}\dvd+rw-booktype.exe" + File "${SRC_DIR}\dvd+rw-format.exe" + File "${SRC_DIR}\dvd+rw-mediainfo.exe" + + File "/oname=$PLUGINSDIR\mtx-changer.cmd" "${SRC_DIR}\mtx-changer.cmd" + + StrCpy $0 "$INSTDIR\bin" + StrCpy $1 mtx-changer.cmd + Call ConfigEditAndCopy + + File "/oname=$PLUGINSDIR\disk-changer.cmd" "${SRC_DIR}\disk-changer.cmd" + + StrCpy $0 "$INSTDIR\bin" + StrCpy $1 disk-changer.cmd + Call ConfigEditAndCopy + + File "/oname=$PLUGINSDIR\dvd-handler.cmd" "${SRC_DIR}\dvd-handler.cmd" + + StrCpy $0 "$INSTDIR\bin" + StrCpy $1 dvd-handler.cmd + Call ConfigEditAndCopy + + File "/oname=$PLUGINSDIR\bacula-sd.conf" "bacula-sd.conf.in" + + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bacula-sd.conf + Call ConfigEditAndCopy + + StrCpy $0 bacula-sd + StrCpy $1 "Storage Service" + StrCpy $2 $ConfigStorageInstallService + StrCpy $3 $ConfigStorageStartService + Call InstallDaemon + + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause" + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"' +SectionEnd + +Section "Director Service" SecDirectorDaemon + SectionIn 2 3 + + SetOutPath "$INSTDIR\bin" + + ${If} $ConfigDirectorDB = 1 + File /oname=bacula_cats.dll "${SRC_DIR}\cats_mysql.dll" + File "${SRC_DIR}\libmysql.dll" + File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_mysql_database.cmd + File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_mysql_database.cmd + File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_mysql_tables.cmd + File ${SRC_DIR}\make_mysql_tables.sql + File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_mysql_tables.cmd + File ${SRC_DIR}\drop_mysql_tables.sql + File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_mysql_privileges.cmd + File ${SRC_DIR}\grant_mysql_privileges.sql + File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_mysql_catalog_backup.cmd + ${ElseIf} $ConfigDirectorDB = 2 + File /oname=bacula_cats.dll "${SRC_DIR}\cats_postgresql.dll" + File "${SRC_DIR}\libpq.dll" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\comerr32.dll" + File "${SRC_DIR}\libintl-2.dll" + File "${SRC_DIR}\libiconv-2.dll" + File "${SRC_DIR}\krb5_32.dll" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\comerr32.dll" + File "${SRC_DIR}\libintl-2.dll" + File "${SRC_DIR}\libiconv-2.dll" + File "${SRC_DIR}\krb5_32.dll" +!endif + File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_postgresql_database.cmd + File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_postgresql_database.cmd + File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_postgresql_tables.cmd + File ${SRC_DIR}\create_postgresql_database.sql + File ${SRC_DIR}\make_postgresql_tables.sql + File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_postgresql_tables.cmd + File ${SRC_DIR}\drop_postgresql_tables.sql + File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_postgresql_privileges.cmd + File ${SRC_DIR}\grant_postgresql_privileges.sql + File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_postgresql_catalog_backup.cmd + ${ElseIf} $ConfigDirectorDB = 3 + File "${SRC_DIR}\sqlite3.exe" +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\sqlite3.exe.manifest" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\sqlite3.exe.manifest" +!endif + File /oname=bacula_cats.dll "${SRC_DIR}\cats_sqlite3.dll" + File /oname=$PLUGINSDIR\create_database.cmd ${SRC_DIR}\create_sqlite3_database.cmd + File /oname=$PLUGINSDIR\drop_database.cmd ${SRC_DIR}\drop_sqlite3_database.cmd + File /oname=$PLUGINSDIR\make_tables.cmd ${SRC_DIR}\make_sqlite3_tables.cmd + File ${SRC_DIR}\make_sqlite3_tables.sql + File /oname=$PLUGINSDIR\drop_tables.cmd ${SRC_DIR}\drop_sqlite3_tables.cmd + File /oname=$PLUGINSDIR\grant_privileges.cmd ${SRC_DIR}\grant_sqlite3_privileges.cmd + File /oname=$PLUGINSDIR\make_catalog_backup.cmd ${SRC_DIR}\make_sqlite3_catalog_backup.cmd + ${EndIf} + + File "${SRC_DIR}\bacula-dir.exe" + File "${SRC_DIR}\dbcheck.exe" + + File "/oname=$PLUGINSDIR\delete_catalog_backup.cmd" "${SRC_DIR}\delete_catalog_backup.cmd" + + StrCpy $0 "$INSTDIR\bin" + + StrCpy $1 create_database.cmd + Call ConfigEditAndCopy + + StrCpy $1 drop_database.cmd + Call ConfigEditAndCopy + + StrCpy $1 make_tables.cmd + Call ConfigEditAndCopy + + StrCpy $1 drop_tables.cmd + Call ConfigEditAndCopy + + StrCpy $1 grant_privileges.cmd + Call ConfigEditAndCopy + + StrCpy $1 make_catalog_backup.cmd + Call ConfigEditAndCopy + + StrCpy $1 delete_catalog_backup.cmd + Call ConfigEditAndCopy + + File "${SRC_DIR}\query.sql" + + File "/oname=$PLUGINSDIR\bacula-dir.conf" "bacula-dir.conf.in" + + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bacula-dir.conf + Call ConfigEditAndCopy + + StrCpy $0 bacula-dir + StrCpy $1 "Director Service" + StrCpy $2 $ConfigDirectorInstallService + StrCpy $3 $ConfigDirectorStartService + Call InstallDaemon + + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Director Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-dir.conf"' +SectionEnd + +SectionGroupEnd + +SectionGroup "Consoles" SecGroupConsoles + +Section "Command Console" SecConsole + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin" + + File "${SRC_DIR}\bconsole.exe" + Call InstallCommonFiles + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf" + CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula" + ${Else} + File "/oname=$PLUGINSDIR\bconsole.conf" "bconsole.conf.in" + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bconsole.conf + Call ConfigEditAndCopy + ${EndIf} + + CreateShortCut "$SMPROGRAMS\Bacula\bconsole.lnk" "$INSTDIR\bin\bconsole.exe" '-c "$APPDATA\Bacula\bconsole.conf"' "$INSTDIR\bin\bconsole.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Command Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bconsole.conf"' + +SectionEnd + +Section "Bat Console" SecBatConsole + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin" + + Call InstallCommonFiles + File "${SRC_DIR}\QtCore4.dll" + File "${SRC_DIR}\QtGui4.dll" + + File "${SRC_DIR}\bat.exe" + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bat.conf" + CopyFiles "$OldInstallDir\bin\bat.conf" "$APPDATA\Bacula" + ${Else} + File "/oname=$PLUGINSDIR\bat.conf" "bat.conf.in" + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bat.conf + Call ConfigEditAndCopy + ${EndIf} + + ; Create Start Menu entry + CreateShortCut "$SMPROGRAMS\Bacula\Bat.lnk" "$INSTDIR\bin\bat.exe" '-c "$APPDATA\Bacula\bat.conf"' "$INSTDIR\bin\bat.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Bat Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bat.conf"' +SectionEnd + + +Section "Graphical Console" SecWxConsole + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin" + + Call InstallCommonFiles +!if "${BUILD_TOOLS}" == "VC8" + File "${SRC_DIR}\wxbase28_vc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" +!endif +!If "${BUILD_TOOLS}" == "VC8_DEBUG" + File "${SRC_DIR}\wxbase28_vc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_vc_bacula.dll" +!endif +!if "${BUILD_TOOLS}" == "MinGW" + File "${SRC_DIR}\wxbase28_gcc_bacula.dll" + File "${SRC_DIR}\wxmsw28_core_gcc_bacula.dll" +!endif + + File "${SRC_DIR}\bwx-console.exe" + + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bwx-console.conf" + CopyFiles "$OldInstallDir\bin\bwx-console.conf" "$APPDATA\Bacula" + ${Else} + File "/oname=$PLUGINSDIR\bwx-console.conf" "bwx-console.conf.in" + StrCpy $0 "$APPDATA\Bacula" + StrCpy $1 bwx-console.conf + Call ConfigEditAndCopy + ${EndIf} + + ; Create Start Menu entry + CreateShortCut "$SMPROGRAMS\Bacula\bwx-console.lnk" "$INSTDIR\bin\bwx-console.exe" '-c "$APPDATA\Bacula\bwx-console.conf"' "$INSTDIR\bin\bwx-console.exe" 0 + CreateShortCut "$SMPROGRAMS\Bacula\Configuration\Edit Graphical Console Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bwx-console.conf"' +SectionEnd + +SectionGroupEnd + +SectionGroup "Documentation" SecGroupDocumentation + +Section "Documentation (Acrobat Format)" SecDocPdf + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\doc" + CreateDirectory "$INSTDIR\doc" + + File "${SRC_DIR}\manual\bacula.pdf" + CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"' +SectionEnd + +Section "Documentation (HTML Format)" SecDocHtml + SectionIn 3 + + SetOutPath "$INSTDIR\doc" + CreateDirectory "$INSTDIR\doc" + + File "${SRC_DIR}\manual\bacula\*.html" + File "${SRC_DIR}\manual\bacula\*.png" + File "${SRC_DIR}\manual\bacula\*.css" + CreateShortCut "$SMPROGRAMS\Bacula\Documentation\Manual (HTML).lnk" '"$INSTDIR\doc\index.html"' +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 "$APPDATA\Bacula" /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://sourceforge.net/project/showfiles.php?group_id=50727" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support" + 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 File Daemon on this system." +LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system." +LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director Daemon on this system." +LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system." +LangString DESC_SecBatConsole ${LANG_ENGLISH} "Install Bat graphical console program on this system." +LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install wxWidgets 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 ${SecStorageDaemon} $(DESC_SecStorageDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecBatConsole} $(DESC_SecBatConsole) + !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\bin\bacula-fd.exe" /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill' + Sleep 3000 + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\bin\exchange-fd.dll" /remove' + ${EndIf} + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /remove' + ${EndIf} + + ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir" + ${If} $R0 = 1 + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /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\bin\*" + 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 "$APPDATA\Bacula\*" + Delete /REBOOTOK "$APPDATA\Bacula\Work\*" + Delete /REBOOTOK "$APPDATA\Bacula\Spool\*" + 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 "$APPDATA\Bacula\Work" + RMDir "$APPDATA\Bacula\Spool" + RMDir "$APPDATA\Bacula" +NoDel: + + ; remove directories used + RMDir "$INSTDIR\bin" + 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\bin\$0.exe" /install -c "$APPDATA\Bacula\$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\bin\$0.exe" -c "$APPDATA\Bacula\$0.conf"' + ${EndIf} + ${EndIf} + ${Else} + CreateShortCut "$SMPROGRAMS\Bacula\Start $1.lnk" "$INSTDIR\bin\$0.exe" '-c "$APPDATA\Bacula\$0.conf"' "$INSTDIR\bin\$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 FindDatabaseApps + Push $R1 + + ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Location" + + ${If} $0 != "" + Call RemoveTrailingSlash + StrCpy $MySQLPath $0 + ReadRegStr $0 HKLM "Software\MySQL AB\MySQL Server 5.0" "Version" + StrCpy $MySQLVersion $0 + ${EndIf} + + EnumRegKey $R1 HKLM "Software\PostgreSQL\Installations" 0 + ${If} $R1 != "" + ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Base Directory" + Call RemoveTrailingSlash + StrCpy $PostgreSQLPath $0 + ReadRegStr $0 HKLM "Software\PostgreSQL\Installations\$R1" "Version" + StrCpy $PostgreSQLVersion $0 + ${EndIf} + + Pop $R1 +FunctionEnd + +Function RemoveTrailingSlash + Push $R1 + StrCpy $R1 $0 "" -1 + ${If} $R1 == "\" + StrCpy $0 $0 -1 + ${EndIf} + Pop $R1 +FunctionEnd + +Function IsDirectorSelected + Push $R0 + SectionGetFlags ${SecDirectorDaemon} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + Exch $R0 +FunctionEnd + +Function GetSelectedComponents + Push $R0 + StrCpy $R0 0 + ${If} ${SectionIsSelected} ${SecFileDaemon} + IntOp $R0 $R0 | ${ComponentFile} + ${EndIf} + ${If} ${SectionIsSelected} ${SecStorageDaemon} + IntOp $R0 $R0 | ${ComponentStorage} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDirectorDaemon} + IntOp $R0 $R0 | ${ComponentDirector} + ${EndIf} + ${If} ${SectionIsSelected} ${SecConsole} + IntOp $R0 $R0 | ${ComponentTextConsole} + ${EndIf} + ${If} ${SectionIsSelected} ${SecBatConsole} + IntOp $R0 $R0 | ${ComponentBatConsole} + ${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 + ${If} $OsIsNT <> 1 + Call DisableServerSections + ${EndIf} + + 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} + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 = 0 + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 0 + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags DISABLED + DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" Flags REQ_SAVE|FILE_EXPLORER|WARN_IF_EXIST|DISABLED + ${Else} + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" State 1 + DeleteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 4" Flags + WriteINIStr "$PLUGINSDIR\WriteTemplates.ini" "Field 5" State "C:\$ConfigStorageName.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} + + !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 4" State + ${If} $R0 <> 0 + File "/oname=$PLUGINSDIR\storage.conf.in" "storage.conf.in" + + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\storage.conf.in"' + !InsertMacro MUI_INSTALLOPTIONS_READ $R0 "WriteTemplates.ini" "Field 5" State + ${If} $R0 != "" + CopyFiles "$PLUGINSDIR\storage.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 & ${ComponentStorage} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecStorageDaemon} + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecStorageDaemon} + !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_RO} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentDirector} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDirectorDaemon} + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecDirectorDaemon} + !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${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 & ${ComponentBatConsole} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecBatConsole} + !InsertMacro SetSectionFlag ${SecBatConsole} ${SF_RO} + ${Else} + !InsertMacro UnselectSection ${SecBatConsole} + !InsertMacro ClearSectionFlag ${SecBatConsole} ${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 DisableServerSections + !InsertMacro UnselectSection ${SecGroupServer} + !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO} + !InsertMacro UnselectSection ${SecStorageDaemon} + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} + !InsertMacro UnselectSection ${SecDirectorDaemon} + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} +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 & ${ComponentStorage} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentDirector} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${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 & ${ComponentBatConsole} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecBatConsole} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecBatConsole} ${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" -- 2.39.5