cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chrislynn5
Level 6

how to set service to start?

I have a Basic MSI setup design>advanced settings>service that installs correctly and is set as automatic for startup. But after instalaltion I need to 'start' it to get it running? Why is that? Can I start it automatically with a parameter or something? Thanx.

start parameters???
Labels (1)
0 Kudos
(6) Replies
hidenori
Level 17

Did you add a service control event under the Control Settings section and set the Install Start setting under the Operation Time to Yes?
0 Kudos
fpci9590
Level 3

Not sure if this is what you mean, but this is what I do.

I've added the following script in the Custom Actions settings-> After Setup Complete Success dialog.

Change where you see SERVICENAME (2 instances) to whatever your service is called.

The first part sets the retry on failure options.

Filename: startup.vbs

VB Script:

Set wsShellObj = CreateObject("WScript.Shell")
wsShellObj.Run "SC failure SERVICENAME reset= 0 actions= restart/1800000" , 1, false

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='SERVICENAME'")
For Each objService in colServiceList
objService.StartService()
Next
0 Kudos
hidenori
Level 17

What I suggested was to select your service added in the Setup Design > Advanced Settings > Services view, and click the + button in the Events grid under the Control Settings section to add a new service control event. Once the new entry is added, expand the Events > Key Name > Operation Time grid, and then set the Install Start setting to Yes.
0 Kudos
chrislynn5
Level 6

Thanx, I see the options and will give it a try!
0 Kudos
chrislynn5
Level 6

Starting service works great but...

Does anybody know how to set the service User Name (I can set) and Passward (I can't set) dynamically, i.e. I'm using a custom dialog for user entry????
The password is a masked field in the Service Install options area.
I guess I'd like to use Property's to set those. Thanx
0 Kudos
chrislynn5
Level 6

It looks like even though the service password field is hidden *********, that you can still put in a property string, i.e. [TESTME] and it works.....
0 Kudos