View Full Version : Service Questions
5th October 2004, 13:30
I am using dselkirk's service functions to create, stop, and delete services. These all seem to work fine except for one issue with the uninstaller. The binpath to the services is in the install location, and if the services are running, when I stop and delete them, the command to recursively remove the INSTALLDIR fails. I think this is just a timing thing as I can delete the INSTALLDIR manually after running the uninstaller.
Additionally for what its worth if the services are not running when I run the uninstaller the whole thing goes off w/o a hitch.
Is there any way to tell the uninstaller to "sleep" for a second or two prior to attempting to remove the INSTALLDIR after stopping and deleting the services, or is there a better way to stop and delete the services?
5th October 2004, 17:59
Sleep 10000 ; Pause for 10 seconds
6th October 2004, 14:47
Thanks, I should have checked for that. Sorry for being a bonehead
1st April 2005, 17:02
I am trying to install a windows service and I am stuck if any one can help me please.
I tried using dselkirk's service functions described at :
but my script would not even compile giving me the error :
Error: unterminated string parsing line at macro:FUNC_SERVICE:21
Error in macro FUNC_SERVICE on macroline 21
Whats wrong with this library?!
I also tried to use this plugin:
but even if it does start, stop a service it does not offer how to install a service...
It would be great if this plugin can be enhanced by some expert:).
I also would like to know how can I find if a service is running by the name of its executable. I can not search for it by name because I have no idea what name my customer has chosen. So I would like to find the service by the name of the program itself... Is this possible?!
The service I want install has to take some arguments. But
seems to take only the path to the program not the arguments to the program.
Thank you for any help.
1st April 2005, 19:24
As for the Service Library, use the save script (http://nsis.sourceforge.net/archive/savescript.php?pageid=345&script=1) link instead of copying and pasting. Word wrapping is turned on.
1st April 2005, 23:58
Thanks Kichik. Now it does compile.
I was also wrong on 2). Looking at the documentation, the creation of a service is there. Sorry about that.
I am left with 3) and 4).
3)How can I find out if a service is running if I do not know the name of the service. All I know is the name of the program itself.
4)And how can I pass arguments to the program I want to install as a service.
Thanks a lot for your help.
5th April 2005, 17:13
I found the solution for 4). Actually it is possible to use the library at
and giving it path="program.exe arg1 arg2..."
6th April 2005, 17:54
I found a workaround for 3) by using the FindProc plugin.
I have a question of any one can help please:
After my installer has created a service. It is unable to start it!. And even if I go the Services conrol panel and try to start it, it gives me the following error :
Ps1: I have admin privileges on the machine I am installing on.
Ps2: If I run the command manually, it does run. But it gives an error if it is through the service...
Thank you for any help.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.