Commit 85809843 authored by Alexandre Julliard's avatar Alexandre Julliard

msiexec: Ignore failure to create the service if it already exists.

parent 19cb5a4f
...@@ -333,6 +333,7 @@ static DWORD DoRegServer(void) ...@@ -333,6 +333,7 @@ static DWORD DoRegServer(void)
{ {
SC_HANDLE scm, service; SC_HANDLE scm, service;
CHAR path[MAX_PATH+12]; CHAR path[MAX_PATH+12];
DWORD ret = 0;
scm = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CREATE_SERVICE); scm = OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CREATE_SERVICE);
if (!scm) if (!scm)
...@@ -348,16 +349,15 @@ static DWORD DoRegServer(void) ...@@ -348,16 +349,15 @@ static DWORD DoRegServer(void)
SERVICE_WIN32_SHARE_PROCESS, SERVICE_DEMAND_START, SERVICE_WIN32_SHARE_PROCESS, SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL, path, NULL, NULL, SERVICE_ERROR_NORMAL, path, NULL, NULL,
NULL, NULL, NULL); NULL, NULL, NULL);
if (!service)
if (service) CloseServiceHandle(service);
else if (GetLastError() != ERROR_SERVICE_EXISTS)
{ {
fprintf(stderr, "Failed to create MSI service\n"); fprintf(stderr, "Failed to create MSI service\n");
CloseServiceHandle(scm); ret = 1;
return 1;
} }
CloseServiceHandle(scm);
CloseServiceHandle(scm); return ret;
CloseServiceHandle(service);
return 0;
} }
static BOOL process_args_from_reg( LPWSTR ident, int *pargc, WCHAR ***pargv ) static BOOL process_args_from_reg( LPWSTR ident, int *pargc, WCHAR ***pargv )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment