Results 1 to 3 of 3

Thread: Service Path

  1. #1

    Default Service Path

    Is there a way to get more info on a Service than just whether or not it is
    running?
    I would like to know the path it is running from.

    Any ideas?

    Thanks,
    --Glenn.

  2. #2

    Default Re: Service Path

    Glenn,

    > Is there a way to get more info on a Service than just whether or not it
    > is running?
    > I would like to know the path it is running from.
    >
    > Any ideas?

    With the Windows Service APIs (Advapi32.dll), it should be possible to use
    the "QueryServiceConfig" API to retrieve the binary path. But there is no
    built-in function in SetupBuilder to handle this, so you have to develop
    your own small DLL and call this from the installer.

    Open a handle to the service using the "OpenService" API, then call
    "QueryServiceConfig" and the second parameter (lpServiceConfig) holds the
    fully-qualified path to the service binary file in
    lpServiceConfig->lpBinaryPathName.

    Friedrich

  3. #3

    Default Re: Service Path

    That sounds good. In the mean time I found this:

    Set Variable %MYSERVICEREGENTRY% to FUNCTION:Get Registry Key
    Value("MyServiceName") from
    "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi ces"
    Set Variable %MYSERVICECURPATH% to FUNCTION:Extract Full
    Folder(%MYSERVICEREGENTRY%)

    Thanks!

    Glenn Paschal

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •