Index: jk_nt_service.c
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat/src/native/mod_jk/nt_service/jk_nt_service.c,v
retrieving revision 1.5
diff -u -r1.5 jk_nt_service.c
--- jk_nt_service.c	2001/09/06 19:12:19	1.5
+++ jk_nt_service.c	2001/09/09 23:15:40
@@ -75,6 +75,7 @@
#define IMAGE_NAME             ("ImagePath")
#define PARAMS_LOCATION        ("Parameters")
#define PRP_LOCATION           ("PropertyFile")
+#define TC3_REGISTRY_LOCATION  ("Software\\Apache Software 
Foundation\\Jakarta Tomcat3.x Services")

// internal variables
static SERVICE_STATUS          ssStatus;       // current status of the 
service
@@ -133,6 +134,7 @@
static void stop_jk_service(void);
static int set_registry_values(char *name,
                                char *prp_file);
+static int remove_registry_values(char *name);
static int create_registry_key(const char *tag,
                                HKEY *key);
static int set_registry_config_parameter(HKEY hkey,
@@ -485,6 +487,7 @@

             // now remove the service
             if(DeleteService(schService)) {
+				remove_registry_values(name);
                 printf("%s removed.\n", name);
             } else {
                 printf("DeleteService failed - %s\n", 
GetLastErrorText(szErr, sizeof(szErr)));
@@ -623,6 +626,22 @@
                 GetLastErrorText(szErr, sizeof(szErr)));
     }

+    rc = create_registry_key(TC3_REGISTRY_LOCATION, &hk);
+
+    if(rc) {
+        rc = set_registry_config_parameter(hk, name, "");
+        if(!rc) {
+            printf("Error: Can not create value [%s] - %s\n",
+                    name,
+                    GetLastErrorText(szErr, sizeof(szErr)));
+        }
+        RegCloseKey(hk);
+    } else {
+        printf("Error: Can not create key [%s] - %s\n",
+                tag,
+                GetLastErrorText(szErr, sizeof(szErr)));
+    }
+
     if(rc) {
         char value[2024];

@@ -662,6 +681,29 @@
     }

     return rc;
+}
+
+static int remove_registry_values(char *name)
+{
+    int rc;
+	HKEY hk;
+
+    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+                      TC3_REGISTRY_LOCATION,
+                      (DWORD)0,
+                      KEY_WRITE | KEY_READ,
+                      &hk);
+
+	if (rc == ERROR_SUCCESS) {
+		rc = RegDeleteValue(hk, name);
+    }
+
+    // Don't show message as this is valid if the service was added with a 
previous version
+	/*if(rc != ERROR_SUCCESS) {
+        printf("Warning: Failed to delete registry value - %s\n",
+                    GetLastErrorText(szErr, sizeof(szErr)));
+    }*/
+	return rc;
}

static void start_jk_service(char *name)

