schSCManager = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
if (schSCManager == NULL) {
- logerror("install_service failed to open Service Control Manager");
+ fprintf(stderr, "install_service failed to open Service Control Manager\n");
return EXIT_FAILURE;
}
NULL); /* no password */
if (schService == NULL) {
- logerror("install_service failed to create service %s", service_name);
+ fprintf(stderr, "install_service failed to create service %s\n", service_name);
return EXIT_FAILURE;
}
sdBuf.lpDescription = "Server for Empire game";
schService, /* handle to service */
SERVICE_CONFIG_DESCRIPTION, /* change: description */
&sdBuf)) { /* value: new description */
- logerror("install_service failed to set the description");
+ fprintf(stderr, "install_service failed to set the description\n");
}
printf("Service %s installed.\n", service_name);
schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (schSCManager == NULL) {
- logerror("remove_service failed to open Service Control Manager");
+ fprintf(stderr, "remove_service failed to open Service Control Manager\n");
return EXIT_FAILURE;
}
hService = OpenService(schSCManager, service_name, SERVICE_ALL_ACCESS);
if (hService == NULL) {
- logerror("remove_service failed to open service %s", service_name);
+ fprintf(stderr, "remove_service failed to open service %s\n", service_name);
return EXIT_FAILURE;
}
if (DeleteService(hService) == 0) {
- logerror("remove_service failed to remove service %s", service_name);
+ fprintf(stderr, "remove_service failed to remove service %s\n", service_name);
return EXIT_FAILURE;
}
if (CloseServiceHandle(hService) == 0) {
- logerror("remove_service failed to close service %s", service_name);
+ fprintf(stderr, "remove_service failed to close service %s\n", service_name);
return EXIT_FAILURE;
} else {
printf("Service %s removed.\n", service_name);
#if defined(_WIN32)
if ((debug || datadir_set || config_file != NULL) &&
remove_service_set) {
- logerror("Can't use -d, -D or -e with either "
- "-r or -R options when starting the server");
+ fprintf(stderr, "Can't use -d, -D or -e with either "
+ "-r or -R options when starting the server\n");
exit(EXIT_FAILURE);
}
if (debug && install_service_set) {
- logerror("Can't use -d with either "
- "-i or -I options when starting the server");
+ fprintf(stderr, "Can't use -d with either "
+ "-i or -I options when starting the server\n");
exit(EXIT_FAILURE);
}
if (install_service_set && remove_service_set) {
- logerror("Can't use both -r or -R and -i or -I options when starting "
- "the server");
+ fprintf(stderr, "Can't use both -r or -R and -i or -I options when starting "
+ "the server\n");
exit(EXIT_FAILURE);
}
#endif /* _WIN32 */