cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sasung
Level 2

Install script

I have some services which has to be installed along with the setup, how do i need to install the services. Can anyone let me know how to do this?
I am using Install script project for setup creation.
Labels (1)
0 Kudos
(1) Reply
phill_mn
Level 7

Here is some good info:
http://forum.installsite.net/index.php?showtopic=20511

1) Create your Features and related Components with the service related files and dependencies, just as you would for any application.
2) If you have to create a non-default account for your service to use then you can use the SdLogonUserInformation dialog, but I had lots of issues trying to use this feature and I had to import the underlying code and customize to both fix problems and make it more useful in our situation. If the service is to be installed using one of the built-in service accounts you can ignore this issue (and count your blessings).
3) In feature_OnInstalled I would:
a) Archive the values of SERVICE_IS_PARAMS that I need to change.
b) Change values of SERVICE_IS_PARAMS.
c) call ServiceAddService
d) Restore the original values of SERVICE_IS_PARAMS

You can either have ServiceAddService start the service, or if you are not ready for that later you can call ServiceStartService (probably after checking ServiceExistService or calling ServiceGetServiceState to make sure it is not already running.

When a service is installed you should see the related registry keys under
HKLM\SYSTEM\CurrentControlSet\services\ and if necessary prior to starting the service you can edit the some of these keys to add commandline switches, but you should be careful doing this as changing a registry key does not directly change the information the SCM uses in memory. You can use sc.exe to query the service configuration and check whether your setup is doing what you want it to do.
0 Kudos