From fea6ff45a6d988a9365ce35e201b7fb99f51d37a Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 1 Sep 2006 11:55:42 +0000 Subject: [PATCH] Change Groupbox name to Remote Director in Configuration page if Director is not installed locally. Disable installer going to finish page automatically so Details log can be viewed. Change default to install as service and start immediately. Change command line options to /noservice and /nostart. Add bconsole to all components. Add /pause command line option to scsilist.exe so that it can be executed from a menu item without the console window disappearing after execution. Add shortcut to Bacula menu to execute scsilist.cpp Fix /kill AGAIN. Add Comment for #undef _DEBUG git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3393 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/installer/ConfigPage1.nsh | 8 ++-- bacula/src/win32/installer/ConfigPage2.nsh | 19 +++++---- bacula/src/win32/installer/winbacula.nsi | 42 ++++++++++++++----- bacula/src/win32/tools/scsilist.cpp | 8 +++- bacula/src/wx-console/authenticate.c | 5 +++ bacula/src/wx-console/console_conf.c | 5 +++ bacula/src/wx-console/console_thread.cpp | 5 +++ bacula/src/wx-console/main.cpp | 5 +++ bacula/src/wx-console/wxbconfigfileeditor.cpp | 5 +++ bacula/src/wx-console/wxbconfigpanel.cpp | 5 +++ bacula/src/wx-console/wxbhistorytextctrl.cpp | 5 +++ bacula/src/wx-console/wxblistctrl.cpp | 5 +++ bacula/src/wx-console/wxbmainframe.cpp | 5 +++ bacula/src/wx-console/wxbrestorepanel.cpp | 5 +++ bacula/src/wx-console/wxbtableparser.cpp | 5 +++ bacula/src/wx-console/wxbtreectrl.cpp | 5 +++ bacula/src/wx-console/wxbutils.cpp | 5 +++ 17 files changed, 118 insertions(+), 24 deletions(-) diff --git a/bacula/src/win32/installer/ConfigPage1.nsh b/bacula/src/win32/installer/ConfigPage1.nsh index 51f82b6121..0eb9c16652 100644 --- a/bacula/src/win32/installer/ConfigPage1.nsh +++ b/bacula/src/win32/installer/ConfigPage1.nsh @@ -16,10 +16,10 @@ Function EnterConfigPage1 StrCpy $R7 0 ; Top ${If} $R0 = 1 - IntOp $R8 $R7 + 50 + 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 + 10 + 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' @@ -71,10 +71,10 @@ Function EnterConfigPage1 ${Endif} ${If} $R1 = 1 - IntOp $R8 $R7 + 50 + 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 + 10 + 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' diff --git a/bacula/src/win32/installer/ConfigPage2.nsh b/bacula/src/win32/installer/ConfigPage2.nsh index 258a31e33a..d5b07163d7 100644 --- a/bacula/src/win32/installer/ConfigPage2.nsh +++ b/bacula/src/win32/installer/ConfigPage2.nsh @@ -24,16 +24,19 @@ Function EnterConfigPage2 StrCpy $R7 0 ; Top ${If} $R2 = 1 - IntOp $R8 $R7 + 90 - ${ElseIf} $R3 = 1 - IntOp $R8 $R7 + 52 + IntOp $R8 $R7 + 92 + 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 $R8 $R7 + 24 + ${If} $R3 = 1 + IntOp $R8 $R7 + 54 + ${Else} + IntOp $R8 $R7 + 26 + ${EndIf} + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Remote Director"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' ${EndIf} - 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' IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 10 + 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' @@ -205,11 +208,11 @@ Function EnterConfigPage2 ${OrIf} $R1 = 1 ${OrIf} $R2 = 1 - IntOp $R8 $R7 + 40 + 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 + 10 + 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' diff --git a/bacula/src/win32/installer/winbacula.nsi b/bacula/src/win32/installer/winbacula.nsi index c25ca981d6..73fc306734 100644 --- a/bacula/src/win32/installer/winbacula.nsi +++ b/bacula/src/win32/installer/winbacula.nsi @@ -66,11 +66,12 @@ ; Pull in pages ; +!define MUI_COMPONENTSPAGE_SMALLDESC +!define MUI_FINISHPAGE_NOAUTOCLOSE + !InsertMacro MUI_PAGE_WELCOME ; !InsertMacro MUI_PAGE_LICENSE "..\..\LICENSE" -!define MUI_COMPONENTSPAGE_SMALLDESC - !InsertMacro MUI_PAGE_COMPONENTS !InsertMacro MUI_PAGE_DIRECTORY Page custom EnterConfigPage1 LeaveConfigPage1 @@ -148,8 +149,8 @@ Function .onInit ; Process Command Line Options StrCpy $OptCygwin 0 - StrCpy $OptService 0 - StrCpy $OptStart 0 + StrCpy $OptService 1 + StrCpy $OptStart 1 StrCpy $OptSilent 0 StrCpy $DependenciesDone 0 StrCpy $DatabaseDone 0 @@ -163,14 +164,14 @@ Function .onInit StrCpy $OptCygwin 1 ClearErrors - ${GetOptions} $R0 "/service" $R1 + ${GetOptions} $R0 "/noservice" $R1 IfErrors +2 - StrCpy $OptService 1 + StrCpy $OptService 0 ClearErrors - ${GetOptions} $R0 "/start" $R1 + ${GetOptions} $R0 "/nostart" $R1 IfErrors +2 - StrCpy $OptStart 1 + StrCpy $OptStart 0 IfSilent 0 +2 StrCpy $OptSilent 1 @@ -230,6 +231,8 @@ Function .onInit File "/oname=$PLUGINSDIR\ssleay32.dll" "${DEPKGS_BIN}\ssleay32.dll" File "/oname=$PLUGINSDIR\sed.exe" "${DEPKGS_BIN}\sed.exe" + SetPluginUnload alwaysoff + nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33' pop $R0 ${If} $R0 = 0 @@ -260,6 +263,8 @@ Function .onInit FileClose $R1 ${EndIf} + SetPluginUnload manual + nsExec::Exec '"$PLUGINSDIR\openssl.exe" rand -base64 -out $PLUGINSDIR\pw.txt 33' pop $R0 ${If} $R0 = 0 @@ -312,6 +317,8 @@ Function CopyDependencies FunctionEnd Function InstallDatabase + SetOutPath "$INSTDIR\bin" + ${If} $DatabaseDone = 0 ${If} $ConfigDirectorDB = 1 File /oname=bacula_cats.dll "${BACULA_BIN}\cats_mysql.dll" @@ -454,6 +461,7 @@ Section "File Service" SecFileDaemon SectionIn 1 2 3 SetOutPath "$INSTDIR\bin" + File "${BACULA_BIN}\bacula-fd.exe" StrCpy $R0 0 @@ -487,8 +495,9 @@ SectionGroup "Server" Section "Storage Service" SecStorageDaemon SectionIn 2 3 - + SetOutPath "$INSTDIR\bin" + File "${DEPKGS_BIN}\loaderinfo.exe" File "${DEPKGS_BIN}\mt.exe" File "${DEPKGS_BIN}\mtx.exe" @@ -524,6 +533,7 @@ Section "Storage Service" SecStorageDaemon StrCpy $3 $ConfigStorageStartService Call InstallDaemon + CreateShortCut "$SMPROGRAMS\Bacula\List Devices.lnk" "$INSTDIR\bin\scsilist.exe" "/pause" CreateShortCut "$SMPROGRAMS\Bacula\Edit Storage Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-sd.conf"' SectionEnd @@ -531,6 +541,7 @@ Section "Director Service" SecDirectorDaemon SectionIn 2 3 SetOutPath "$INSTDIR\bin" + Call InstallDatabase File "${BACULA_BIN}\bacula-dir.exe" File "${BACULA_BIN}\dbcheck.exe" @@ -597,7 +608,9 @@ SectionGroupEnd SectionGroup "Consoles" Section "Command Console" SecConsole - SectionIn 3 + SectionIn 1 2 3 + + SetOutPath "$INSTDIR\bin" File "${BACULA_BIN}\bconsole.exe" Call CopyDependencies @@ -624,6 +637,8 @@ SectionEnd Section "Graphical Console" SecWxConsole SectionIn 1 2 3 + SetOutPath "$INSTDIR\bin" + Call CopyDependencies !if "${BUILD_TOOLS}" == "VC8" File "${DEPKGS_BIN}\wxbase270_vc_bacula.dll" @@ -669,6 +684,7 @@ Section "Documentation (Acrobat Format)" SecDocPdf SetOutPath "$INSTDIR\doc" CreateDirectory "$INSTDIR\doc" + File "${DOC_DIR}\manual\bacula.pdf" CreateShortCut "$SMPROGRAMS\Bacula\Manual.lnk" '"$INSTDIR\doc\bacula.pdf"' SectionEnd @@ -678,6 +694,7 @@ Section "Documentation (HTML Format)" SecDocHtml SetOutPath "$INSTDIR\doc" CreateDirectory "$INSTDIR\doc" + File "${DOC_DIR}\manual\bacula\*.html" File "${DOC_DIR}\manual\bacula\*.png" File "${DOC_DIR}\manual\bacula\*.css" @@ -731,6 +748,8 @@ Section "Uninstall" 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 @@ -785,9 +804,10 @@ SectionEnd Function InstallDaemon Call CopyDependencies - IfFileExists "$APPDATA\Bacula\$0.conf" 0 +3 + IfFileExists "$APPDATA\Bacula\$0.conf" 0 +4 nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /silent /kill' ; Shutdown any bacula that could be running nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /silent /remove' ; Remove existing service + Sleep 3000 WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2 diff --git a/bacula/src/win32/tools/scsilist.cpp b/bacula/src/win32/tools/scsilist.cpp index 9640256391..65182bfd7f 100644 --- a/bacula/src/win32/tools/scsilist.cpp +++ b/bacula/src/win32/tools/scsilist.cpp @@ -43,6 +43,7 @@ #include #include +#include #include "ScsiDeviceList.h" @@ -50,7 +51,7 @@ #define new DEBUG_NEW #endif -int _tmain(int /* argc */, _TCHAR* /* argv */[]) +int _tmain(int argc, _TCHAR* argv[]) { #if defined(_MSC_VER) && defined(_DEBUG) CMemoryState InitialMemState, FinalMemState, DiffMemState; @@ -98,5 +99,10 @@ int _tmain(int /* argc */, _TCHAR* /* argv */[]) DiffMemState.DumpStatistics(); #endif + if (argc > 1 && _tcsnicmp(argv[1], _T("/pause"), sizeof(_T("/pause")) - sizeof(TCHAR)) == 0) { + _fputts(_T("\nPress any key to continue\n"), stderr); + _getch(); + } + return 0; } diff --git a/bacula/src/wx-console/authenticate.c b/bacula/src/wx-console/authenticate.c index 9fb8e6107f..4d40c460cd 100644 --- a/bacula/src/wx-console/authenticate.c +++ b/bacula/src/wx-console/authenticate.c @@ -28,6 +28,11 @@ /* _("...") macro returns a wxChar*, so if we need a char*, we need to convert it with: * wxString(_("...")).mb_str(*wxConvCurrent) */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/console_conf.c b/bacula/src/wx-console/console_conf.c index d6af64e00c..c7d61e271d 100644 --- a/bacula/src/wx-console/console_conf.c +++ b/bacula/src/wx-console/console_conf.c @@ -37,6 +37,11 @@ /* _("...") macro returns a wxChar*, so if we need a char*, we need to convert it with: * wxString(_("...")).mb_str(*wxConvCurrent) */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/console_thread.cpp b/bacula/src/wx-console/console_thread.cpp index b580b9ee09..6adce12512 100644 --- a/bacula/src/wx-console/console_thread.cpp +++ b/bacula/src/wx-console/console_thread.cpp @@ -26,6 +26,11 @@ /* _("...") macro returns a wxChar*, so if we need a char*, we need to convert it with: * wxString(_("...")).mb_str(*wxConvCurrent) */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/main.cpp b/bacula/src/wx-console/main.cpp index 90522cdddc..1721ea7ae6 100644 --- a/bacula/src/wx-console/main.cpp +++ b/bacula/src/wx-console/main.cpp @@ -29,6 +29,11 @@ // headers // ---------------------------------------------------------------------------- +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbconfigfileeditor.cpp b/bacula/src/wx-console/wxbconfigfileeditor.cpp index 7d1ca289d3..64f0c07e7b 100644 --- a/bacula/src/wx-console/wxbconfigfileeditor.cpp +++ b/bacula/src/wx-console/wxbconfigfileeditor.cpp @@ -21,6 +21,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbconfigpanel.cpp b/bacula/src/wx-console/wxbconfigpanel.cpp index 46fd1d083b..c024f4ca25 100644 --- a/bacula/src/wx-console/wxbconfigpanel.cpp +++ b/bacula/src/wx-console/wxbconfigpanel.cpp @@ -21,6 +21,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbhistorytextctrl.cpp b/bacula/src/wx-console/wxbhistorytextctrl.cpp index f809fe8895..f1b285a142 100644 --- a/bacula/src/wx-console/wxbhistorytextctrl.cpp +++ b/bacula/src/wx-console/wxbhistorytextctrl.cpp @@ -21,6 +21,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxblistctrl.cpp b/bacula/src/wx-console/wxblistctrl.cpp index 99ea98ade4..64c50b94bb 100644 --- a/bacula/src/wx-console/wxblistctrl.cpp +++ b/bacula/src/wx-console/wxblistctrl.cpp @@ -22,6 +22,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbmainframe.cpp b/bacula/src/wx-console/wxbmainframe.cpp index 493eb2ee2e..b7d8db5477 100644 --- a/bacula/src/wx-console/wxbmainframe.cpp +++ b/bacula/src/wx-console/wxbmainframe.cpp @@ -21,6 +21,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index 6819ab895f..926223b6c5 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -49,6 +49,11 @@ Parameters to modify: Select parameter to modify (1-11): */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbtableparser.cpp b/bacula/src/wx-console/wxbtableparser.cpp index b0e0f52d82..34fcb42e54 100644 --- a/bacula/src/wx-console/wxbtableparser.cpp +++ b/bacula/src/wx-console/wxbtableparser.cpp @@ -28,6 +28,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbtreectrl.cpp b/bacula/src/wx-console/wxbtreectrl.cpp index 1b6feca72d..a0431e3dfb 100644 --- a/bacula/src/wx-console/wxbtreectrl.cpp +++ b/bacula/src/wx-console/wxbtreectrl.cpp @@ -22,6 +22,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" diff --git a/bacula/src/wx-console/wxbutils.cpp b/bacula/src/wx-console/wxbutils.cpp index 31330c9e45..1b7e9fb8ec 100644 --- a/bacula/src/wx-console/wxbutils.cpp +++ b/bacula/src/wx-console/wxbutils.cpp @@ -21,6 +21,11 @@ */ +/* Windows debug builds set _DEBUG which is used by wxWidgets to select their + * debug memory allocator. Unfortunately it conflicts with Bacula's SmartAlloc. + * So we turn _DEBUG off since we aren't interested in things it enables. + */ + #undef _DEBUG #include "bacula.h" -- 2.39.5