Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Using ServiceAddService failes with logon user


1 reply to this topic

ragi

ragi
  • Members
  • 75 posts

Posted 14 March 2005 - 14:04

Hi,

we use IS 9 and we have created an InstallScript Setup. During the setup we want to install a service. We do it like that:


pUser = &szServiceStartName;
pPW = &szServiceUserPW;

ServiceInitParams ();
SERVICE_IS_PARAMS.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
SERVICE_IS_PARAMS.lpServiceStartName = pUser;
SERVICE_IS_PARAMS.lpPassword = pPW;

nRet = ServiceAddService ( szServiceName, szServiceDisplayName, szServiceDescription, szFileName, bStartService, szStartServiceArgs );


We made sure, the the user information is valid.

The problem is, that sometimes the service is installed, and sometimes not. If not, there is an information in the evenlog with Service Control Manager, Event ID 7038, that the service could not logon with the user information.

When I go into the SCM UI manually and just confirm the logon information, it works. After that, reinstalling the service from the setup works, too.

So I think, there is a difference between
- adding a service with logon information from script and
- changing a service's logon information in the SCM UI.

But how can I solve this? Any ideas?

Thanks,
Rainer


Rainer

ragi

ragi
  • Members
  • 75 posts

Posted 15 March 2005 - 17:49

I found the solution: search msdn for LSAPRIVS...
Rainer