From 6360c734f045a9944b159aef2f445c018e843a8e Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 30 May 2010 12:06:58 +0200 Subject: [PATCH] Fix bug #1554 Windows installer doesn't honor /S flag --- bacula/src/qt-console/make-win32 | 2 +- bacula/src/win32/libwin32/service.cpp | 34 ++++++++++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/bacula/src/qt-console/make-win32 b/bacula/src/qt-console/make-win32 index 3360e3401f..b75ff1723b 100755 --- a/bacula/src/qt-console/make-win32 +++ b/bacula/src/qt-console/make-win32 @@ -12,7 +12,7 @@ if test -e ../config.h.orig ; then mv -f ../config.h.orig ../config.h fi if test -d ../win32/release32; then - cp -f release/bat.exe ../win32/release32 + cp -f debug/bat.exe ../win32/release32 cp -f ${DEPKGS}/depkgs-mingw32/lib/qt/QtGui4.dll ../win32/release32 cp -f ${DEPKGS}/depkgs-mingw32/lib/qt/QtCore4.dll ../win32/release32 rm -rf ../win32/release32/help diff --git a/bacula/src/win32/libwin32/service.cpp b/bacula/src/win32/libwin32/service.cpp index c77f8e286b..c34de5a610 100644 --- a/bacula/src/win32/libwin32/service.cpp +++ b/bacula/src/win32/libwin32/service.cpp @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2009 Free Software Foundation Europe e.V. + Copyright (C) 2007-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -29,8 +29,6 @@ * * Kern Sibbald, August 2007 * - * Version $Id$ - * * This is a generic service routine, which is used by all three * of the daemons. Each one compiles it with slightly different * #defines. @@ -363,8 +361,10 @@ int removeService() } } if (status.dwCurrentState != SERVICE_STOPPED) { - MessageBox(NULL, _("The Bacula service: " APP_NAME " could not be stopped"), - APP_DESC, MB_ICONEXCLAMATION | MB_OK); + if (opt_debug) { + MessageBox(NULL, _("The Bacula service: " APP_NAME " could not be stopped"), + APP_DESC, MB_ICONEXCLAMATION | MB_OK); + } } } @@ -381,9 +381,11 @@ int removeService() CloseServiceHandle(baculaService); } else { - MessageBox(NULL, _("A existing Bacula service: " APP_NAME " could not be found for " - "removal. This is not normally an error."), - APP_DESC, MB_ICONEXCLAMATION | MB_OK); + if (opt_debug) { + MessageBox(NULL, _("An existing Bacula service: " APP_NAME " could not be found for " + "removal. This is not normally an error."), + APP_DESC, MB_ICONEXCLAMATION | MB_OK); + } } CloseServiceHandle(serviceManager); return stat; @@ -400,9 +402,11 @@ int removeService() if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\RunServices", &runservices) != ERROR_SUCCESS) { - MessageBox(NULL, - _("Could not find registry entry.\nService probably not registerd - the Bacula service was not removed"), - APP_DESC, MB_ICONEXCLAMATION | MB_OK); + if (opt_debug) { + MessageBox(NULL, + _("Could not find registry entry.\nService probably not registerd - the Bacula service was not removed"), + APP_DESC, MB_ICONEXCLAMATION | MB_OK); + } } else { /* Now delete the Bacula entry */ if (RegDeleteValue(runservices, APP_NAME) != ERROR_SUCCESS) { @@ -416,9 +420,11 @@ int removeService() /* Stop any running Bacula */ if (!stopRunningBacula()) { - MessageBox(NULL, - _("Bacula could not be contacted, probably not running"), - APP_DESC, MB_ICONEXCLAMATION | MB_OK); + if (opt_debug) { + MessageBox(NULL, + _("Bacula could not be contacted, probably not running"), + APP_DESC, MB_ICONEXCLAMATION | MB_OK); + } return 0; /* not really an error */ } -- 2.39.5