Page 1 of 1

How to start a windows service

Posted: Mon Feb 21, 2011 2:43 pm
by prasanth.nair
Hi,

I am trying to start a windows service. Here is the msi code attached. I am using a batch file (installservice.bat) to install the service and then trying to start the service using Run Program. Any help is appreciated.

if Variable RUNAPP Equals TRUE
if Variable REMOVE Equals FALSE
if Variable SUCCESS Equals COMPLETE
Run Program $TARGETDIR$\_ClientAgents\BatchFile\DeleteFolders.bat (WAIT)
Run Program $TARGETDIR$\_ClientAgents\BatchFile\Install Service.bat (WAIT)
Run Program $TARGETDIR$\_ClientAgents\BatchFile\CreateFolders.bat (WAIT)
Set Variable SRVSTART to FALSE
Run Program $WINSYSDIR$\\net.exe start Atlas Store Daemon (WAIT, get result into variable SRVSTART)
if Variable SRVSTART Equals TRUE
Run Program $TARGETDIR$\_ClientAgents\Atlas.windowsAgent.exe
else
MessageBox: ATLAS STORE DAEMON, Atlas Store Daemon Service not started. Please start the service manually.
end
Comment: TO-DO: Insert command that starts your application here
end
end




Thanks
Prasanth Nair

Re: How to start a windows service

Posted: Mon Feb 21, 2011 2:52 pm
by giaviv
Dear Prasanth,

Please consider the Control Service command (F1 anywhere in the InstallAware IDE and search for Control Service).
We do not recommend calling 3rd party executables because their stability and existence is never promised on target machines.

Re: How to start a windows service

Posted: Mon Feb 21, 2011 3:08 pm
by prasanth.nair
Thanks. Can I start already installed service using Control Service ?

Here is the code that I tried.

Control Service Atlas Store Daemon: start on install [wait for completion]


Looks like the above code is not working. Do i need to change something else to start the service.

Thanks

Re: How to start a windows service

Posted: Mon Feb 21, 2011 3:40 pm
by giaviv
It should work. Are you sure that your service is properly installed and working?
Does it run when you go to cmd and type "sc start <YOUR_SERVICE_NAME>"?

Re: How to start a windows service

Posted: Mon Feb 21, 2011 3:43 pm
by prasanth.nair
Yes. I can start the service using sc start command. I tried a different service using the same code. No luck. :?

Re: How to start a windows service

Posted: Mon Feb 21, 2011 4:30 pm
by giaviv
Could you please send your service to support at installaware.com?

Re: How to start a windows service

Posted: Tue Feb 22, 2011 9:02 am
by prasanth.nair
I tried the same code in a different machine. It is working good. Thanks.

Re: How to start a windows service

Posted: Tue Feb 22, 2011 9:38 am
by giaviv
Great. I am glad it was figured out.

Re: How to start a windows service

Posted: Thu Nov 10, 2011 7:29 pm
by jbutler
I'm having the same issue. Simply try to start SQL Server Service using this approach:
Control Service _SQLServerService: start on install [wait for completion]
Service does not start.
If I run the sc start MSSQLSERVER in a cmd window (run as administrator) the service starts running.

Re: How to start a windows service

Posted: Fri Nov 11, 2011 11:04 am
by giaviv
Could you please also try the same code on a different machine?