diff options
author | miguel@light.local <> | 2001-10-25 05:57:15 -0200 |
---|---|---|
committer | miguel@light.local <> | 2001-10-25 05:57:15 -0200 |
commit | 03bf236f4a70bf50158a186ffafd838a88823f1d (patch) | |
tree | 7359b5cdbf17b8b80cc59389b5deb2ecb6133491 /sql/mysqld.cc | |
parent | 28f35b261f96a9e064e3f6686ca78cdfd9e0da0c (diff) | |
download | mariadb-git-03bf236f4a70bf50158a186ffafd838a88823f1d.tar.gz |
Adding code for NT service in the install and remove
routines for avoid to leave the Service Control Manager
in bad state. Print messages for to reduce the current
user errors when are trying to install or start the service.
Adding the option to install the service for manual start:
--install-manual.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index abcfbd0d457..be0c14babd3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2053,14 +2053,18 @@ int main(int argc, char **argv) { if (argc == 2) { + char path[FN_REFLEN]; + my_path(path, argv[0], ""); // Find name in path + fn_format(path,argv[0],path,"",1+4+16); // Force use of full path + if (!strcmp(argv[1],"-install") || !strcmp(argv[1],"--install")) { - char path[FN_REFLEN]; - my_path(path, argv[0], ""); // Find name in path - fn_format(path,argv[0],path,"",1+4+16); // Force use of full path - if (!Service.Install(MYSQL_SERVICENAME,MYSQL_SERVICENAME,path)) - MessageBox(NULL,"Failed to install Service",MYSQL_SERVICENAME, - MB_OK|MB_ICONSTOP); + Service.Install(1,MYSQL_SERVICENAME,MYSQL_SERVICENAME,path); + return 0; + } + else if (!strcmp(argv[1],"-install-manual") || !strcmp(argv[1],"--install-manual")) + { + Service.Install(0,MYSQL_SERVICENAME,MYSQL_SERVICENAME,path); return 0; } else if (!strcmp(argv[1],"-remove") || !strcmp(argv[1],"--remove")) |