Flexera Software Community  

Go Back   Flexera Software Community > Products > InstallShield > InstallShield Windows 12
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 05-03-2007, 08:34 AM
Christopher Painter's Avatar
Christopher Painter Christopher Painter is offline
Uber User (1000+ Posts)
 
Join Date: Jul 2003
Location: Austin, TX
Posts: 4,049
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, Industry Leading Windows Installer Expert
Visit DeploymentEngineering.com for contact information
Note: I am (mostly) retired from the InstallShield Community Forum.
Reply With Quote
  #12  
Old 05-03-2007, 08:51 AM
Christopher Painter's Avatar
Christopher Painter Christopher Painter is offline
Uber User (1000+ Posts)
 
Join Date: Jul 2003
Location: Austin, TX
Posts: 4,049
Blog article here if anyone is interested.....

http://blog.deploymentengineering.co...ations-of.html
__________________
Christopher Painter, Industry Leading Windows Installer Expert
Visit DeploymentEngineering.com for contact information
Note: I am (mostly) retired from the InstallShield Community Forum.
Reply With Quote
  #13  
Old 05-03-2007, 08:58 AM
rguggisberg rguggisberg is offline
Power User (30+ Posts)
 
Join Date: May 2007
Posts: 74
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.
Reply With Quote
  #14  
Old 05-03-2007, 09:05 AM
Christopher Painter's Avatar
Christopher Painter Christopher Painter is offline
Uber User (1000+ Posts)
 
Join Date: Jul 2003
Location: Austin, TX
Posts: 4,049
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, Industry Leading Windows Installer Expert
Visit DeploymentEngineering.com for contact information
Note: I am (mostly) retired from the InstallShield Community Forum.
Reply With Quote
  #15  
Old 05-08-2007, 11:33 AM
sks2004 sks2004 is offline
Mega User (200+ Posts)
 
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:
Quote:
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 11:50 AM.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 08:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Flexera Software Inc. All rights reserved.