Community Forums
Page 3 of 5 FirstFirst 12345 LastLast
Results 11 to 15 of 21

Thread: ServiceExistsService InstallScript function doesn't seem to always work within Vista

  1. #11
    Join Date
    Jul 2003
    Location
    Austin, TX
    Posts
    4,430
    Bryan-

    My typical use case for this type of API call is an AppSearch extension pattern to facilitate allowing a LaunchCondition to abort the install if a certain service ( say w3svc ) isn't installed and/or running. I give different error messages to instruct the user whether he needs to install IIS or simply make sure that it is running.

    I really need to be able to run these API calls from Immeadiate execution and without context elevation. Thanks for opening the WO and no thanks to Microsoft for still having a half baked AppSearch pattern after 10 years of feedback from customers.
    Christopher Painter
    ISWIX, LLC.
    Visit iswix.com for contact information

  2. #12
    Join Date
    Jul 2003
    Location
    Austin, TX
    Posts
    4,430
    Blog article here if anyone is interested.....

    http://blog.deploymentengineering.co...ations-of.html
    Christopher Painter
    ISWIX, LLC.
    Visit iswix.com for contact information

  3. #13
    Join Date
    May 2007
    Location
    Eden Praire, MN
    Posts
    723

    Thanks a Bunch

    Thanks to all that have replied. While you guys were testing I tried a modified version of the code found under 'Set Start Mode of an NT Service' in
    http://www.installsite.org/pages/en/isp_svc.htm as was suggested in an earlier post. So I am now getting the info out of the registry instead of using ServiceExistsService and ServiceGetServiceState. It looks like this is going to work just fine.
    You have my sincere thanks and respect.

  4. #14
    Join Date
    Jul 2003
    Location
    Austin, TX
    Posts
    4,430
    You can technically ( and usually but not always reliably ) query configuration ( but not state ) data regarding a service by looking at the registry, but there is a problem with that.

    The SCM ( Service Control Manager ) is the official API for getting this information. The data that you see in the registry is really private data for that API. It shouldn't be directly relied upon. For example someone could create the registry key for a service and not reboot. The service does not technically exist yet because the SCM doesn't know about it. The same goes for removing a service. Someone could delete that registry key but the service still exists until after a reboot.

    You should really always go through the SCM ( and allow IT to update it's private data storage ) and not directly modify it's private data.... despite the example you are seeing from InstallSite! Calling the SCM API will always give you the authorative answer on what IT thinks is the status of a service.
    Christopher Painter
    ISWIX, LLC.
    Visit iswix.com for contact information

  5. #15
    Join Date
    Apr 2005
    Posts
    275
    Running from a bootstrapper (Setup.exe) with "Highest Level available" the ServiceExistsService functions within the UISequence and ExecuteSequence, but upon ARP-Repair or auto-repair ServiceExistsService doesn't function properly. Unfortunately I need this to be an immediate action.

    Per Macrovision support:
    At the moment, the way our InstallScript engine checks the state of a service requires that the user has elevated privileges. With the changes in the way that Vista manages Administrator rights, we receive improper failure cases for attempting to locate or utilize a service.

    The best workarounds for this issue are to either set the setup.exe's Required Execution Level to as Administrator or only check for services in Deferred in system context custom actions which also means that move the CA from 'Install UI' to 'Install Execute' and executed it "After InstallInitialize", which won't have this issue.
    Last edited by sks2004; 05-08-2007 at 12:50 PM.

Page 3 of 5 FirstFirst 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •