msi: Implement the InstallServices action

James Hawkins truiken at gmail.com
Mon Jul 10 14:08:17 CDT 2006


On 7/10/06, Robert Shearman <rob at codeweavers.com> wrote:
> James Hawkins wrote:
>
> > +static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
> > +{
> > ...
> > +    service = CreateServiceW(hscm, name, disp, SERVICE_START |
> > GENERIC_ALL,
> > +                             serv_type, start_type, err_control,
> > file->TargetPath,
> > +                             load_order, NULL, depends, serv_name, pass);
> > +    if (!service)
> > +        ERR("Failed to create service %s: %ld\n", debugstr_w(disp),
> > GetLastError());
> > +
> > +    if (!StartServiceW(service, 0, NULL))
> > +        ERR("Failed to start service %s: %ld\n", debugstr_w(disp),
> > GetLastError());
>
>
> Is this function really supposed to start the service as well? Shouldn't
> this be done by the StartServices action instead
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/startservices_action.asp)?
>

When I first wrote InstallServices, I left out the StartService call,
because that makes sense, but the installers were still failing to
connect to the service, leaving the long delay.  I checked and there's
nothing in the StartServices table before or during runtime.  Adding
the call to StartService makes it work.  Is there some functionality
missing in advapi32 where a service starts up on demand if a process
tries to connect to it?  Reading through the relay and advapi logs, I
couldn't find a call to StartService, so I get the feeling the
installer expects the service to already be running, but I could be
wrong.

-- 
James Hawkins



More information about the wine-devel mailing list