Skip to content
Snippets Groups Projects
Commit 6e8adce9 authored by Howard Chu's avatar Howard Chu
Browse files

Fix previous commit, eventlog path was wrong

parent a0d397d0
No related branches found
No related tags found
No related merge requests found
......@@ -63,8 +63,11 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName,
HKEY hKey;
DWORD dwValue, dwDisposition;
SC_HANDLE schSCManager, schService;
char *sp = strchr( lpszBinaryPathName, ' ');
if ( sp ) *sp = '\0';
fprintf( stderr, "The install path is %s.\n", lpszBinaryPathName );
if ( sp ) *sp = ' ';
if ((schSCManager = OpenSCManager( NULL, NULL, SC_MANAGER_CONNECT|SC_MANAGER_CREATE_SERVICE ) ) != NULL )
{
if ((schService = CreateService(
......@@ -95,6 +98,7 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName,
RegCloseKey(hKey);
return(0);
}
if ( sp ) *sp = '\0';
if ( RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, lpszBinaryPathName, strlen(lpszBinaryPathName) + 1) != ERROR_SUCCESS)
{
fprintf( stderr, "RegSetValueEx(EventMessageFile) failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment