- if ( (length = GetModuleFileName(NULL, filename, sizeof( filename ))) == 0 )
- {
- fputs( "unable to retrieve file name for the service.\n", stderr );
- return;
- }
- if ( !srv_install(SERVICE_NAME, filename) )
+ char *svcName = SERVICE_NAME;
+ char *displayName = "OpenLDAP Directory Service";
+ BOOL auto_start = FALSE;
+
+ if ( (argc > 2) && (argv[2] != NULL) )
+ svcName = argv[2];
+
+ if ( argc > 3 && argv[3])
+ displayName = argv[3];
+
+ if ( argc > 4 && stricmp(argv[4], "auto") == 0)
+ auto_start = TRUE;
+
+ strcat(filename, " service");
+ if ( !lutil_srv_install(svcName, displayName, filename, auto_start) )