// by Kern E. Sibbald. Many thanks to ATT and James Weatherall,
// the original author, for providing an excellent template.
//
-// Copyright (2000-2003) Kern E. Sibbald
+// Copyright (C) 2000-2006 Kern E. Sibbald
//
// SERVICE INSTALL ROUTINE
int
-bacService::InstallService()
+bacService::InstallService(bool silent)
{
const int pathlength = 2048;
char path[pathlength];
RegCloseKey(runservices);
// We have successfully installed the service!
- MessageBox(NULL,
+ if (!silent) {
+ MessageBox(NULL,
_("The Bacula File service was successfully installed.\n"
"The service may be started by double clicking on the\n"
"Bacula \"Start\" icon and will be automatically\n"
"be run the next time this machine is rebooted. "),
szAppName,
MB_ICONINFORMATION | MB_OK);
+ }
break;
// Windows NT, Win2K, WinXP
CloseServiceHandle(hservice);
// Everything went fine
- MessageBox(NULL,
+ if (!silent) {
+ MessageBox(NULL,
_("The Bacula File service was successfully installed.\n"
"The service may be started from the Control Panel and will\n"
"automatically be run the next time this machine is rebooted."),
szAppName,
MB_ICONINFORMATION | MB_OK);
+ }
break;
default:
log_error_message("Unknown Windows System version");
// SERVICE REMOVE ROUTINE
int
-bacService::RemoveService()
+bacService::RemoveService(bool silent)
{
// How to remove the Bacula service depends upon the OS
switch (g_platform_id) {
}
// We have successfully removed the service!
- MessageBox(NULL, _("The Bacula service has been removed"), szAppName, MB_ICONINFORMATION | MB_OK);
+ if (!silent) {
+ MessageBox(NULL, _("The Bacula service has been removed"), szAppName, MB_ICONINFORMATION | MB_OK);
+ }
break;
// Windows NT, Win2K, WinXP
}
// Now remove the service from the SCM
- if(DeleteService(hservice)) {
- MessageBox(NULL, _("The Bacula service has been removed"), szAppName, MB_ICONINFORMATION | MB_OK);
+ if (DeleteService(hservice)) {
+ if (!silent) {
+ MessageBox(NULL, _("The Bacula service has been removed"), szAppName, MB_ICONINFORMATION | MB_OK);
+ }
} else {
MessageBox(NULL, _("The Bacula service could not be removed"), szAppName, MB_ICONEXCLAMATION | MB_OK);
}