Archive: Service Questions


Service Questions
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?

Thanks.

Greg


Sleep 10000 ; Pause for 10 seconds

-Stu


Thanks, I should have checked for that. Sorry for being a bonehead


Hi,

I am trying to install a windows service and I am stuck if any one can help me please.

1)
I tried using dselkirk's service functions described at :
http://nsis.sourceforge.net/archive....php?pageid=345

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?!

2)
I also tried to use this plugin:
http://nsis.sourceforge.net/archive....php?pageid=385

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:).

3)

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?!

4)

The service I want install has to take some arguments. But
http://nsis.sourceforge.net/archive....php?pageid=345
seems to take only the path to the program not the arguments to the program.

Thank you for any help.


As for the Service Library, use the save script link instead of copying and pasting. Word wrapping is turned on.


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.


Hi,

I found the solution for 4). Actually it is possible to use the library at
http://nsis.sourceforge.net/archive....php?pageid=345

and giving it path="program.exe arg1 arg2..."


Hi,

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 :

Error 1067.

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.