You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sh...@locus.apache.org on 2000/05/03 14:54:46 UTC
cvs commit: jakarta-tomcat/src/native/nt_service jk_nt_service.c
shachor 00/05/03 05:54:45
Modified: src/native/nt_service jk_nt_service.c
Log:
Minor correction to the error messages
Revision Changes Path
1.2 +21 -11 jakarta-tomcat/src/native/nt_service/jk_nt_service.c
Index: jk_nt_service.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/native/nt_service/jk_nt_service.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jk_nt_service.c 2000/05/01 12:32:21 1.1
+++ jk_nt_service.c 2000/05/03 12:54:45 1.2
@@ -297,20 +297,29 @@
}
void install_service(char *name,
- char *prp_file)
+ char *rel_prp_file)
{
SC_HANDLE schService;
SC_HANDLE schSCManager;
- TCHAR szPath[2048];
+ char szExecPath[2048];
+ char szPropPath[2048];
+ char *dummy;
- if(!jk_file_exists(prp_file)) {
+ if(!GetFullPathName(rel_prp_file, sizeof(szPropPath) - 1, szPropPath, &dummy)) {
+ printf("Unable to install %s - %s\n",
+ name,
+ GetLastErrorText(szErr, sizeof(szErr)));
+ return;
+ }
+
+ if(!jk_file_exists(szPropPath)) {
printf("Unable to install %s - File [%s] does not exists\n",
name,
- prp_file);
+ szPropPath);
return;
}
- if(GetModuleFileName( NULL, szPath, sizeof(szPath) - 1) == 0) {
+ if(GetModuleFileName( NULL, szExecPath, sizeof(szExecPath) - 1) == 0) {
printf("Unable to install %s - %s\n",
name,
GetLastErrorText(szErr, sizeof(szErr)));
@@ -328,7 +337,7 @@
SERVICE_WIN32_OWN_PROCESS, // service type
SERVICE_DEMAND_START, // start type
SERVICE_ERROR_NORMAL, // error control type
- szPath, // service's binary
+ szExecPath, // service's binary
NULL, // no load ordering group
NULL, // no tag identifier
NULL, // dependencies
@@ -336,9 +345,9 @@
NULL); // no password
if(schService) {
- printf("%s created. Now adding registry entries\n", name);
+ printf("The service named %s was created. Now adding registry entries\n", name);
- if(set_registry_values(name, prp_file)) {
+ if(set_registry_values(name, szPropPath)) {
CloseServiceHandle(schService);
} else {
printf("CreateService failed setting the private registry - %s\n", GetLastErrorText(szErr, sizeof(szErr)));
@@ -460,9 +469,9 @@
value);
if(rc) {
printf("Registry values were added\n");
- printf("You can now start the %s service by executing \"net start %s\" from the commanf prompt\n",
- name,
- name);
+ printf("If you have already updated wrapper.properties you may start the %s service by executing \"net start %s\" from the command prompt\n",
+ name,
+ name);
}
}
RegCloseKey(hk);
@@ -910,3 +919,4 @@
return JK_TRUE;
}
+