NetTalk Central

Author Topic: Working directory for Webserver app as service  (Read 3457 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Working directory for Webserver app as service
« on: June 10, 2010, 02:59:35 PM »
Not a NetTalk issue itself, but directly related to Webserver implementation.

I would like to put my Webserver executables in Program Files with a working directory elsewhere.  Not a problem when running as an application, just put the working directory as the Start in of the shortcut.  As a service, though, how do I direct the program to look in another folder for data.  I have a service manager app created with SelfService to install the service, but didn't see anything in the docs to deal with this issue.   

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Working directory for Webserver app as service
« Reply #1 on: June 10, 2010, 10:45:47 PM »
Hi Casey,

There are a couple approaches you can use.

On startup read a setting from a "known" location. This determines where the data is. You could use an INI file for this, or a registry entry, or whatever you prefer.

Then do one, or more, of the following;
a) use SETPATH to set the current folder to that location.
b) use System{prop:datapath} to set the default data file location to that folder or
c) use individual file names to set the location of each file.

Remember though, that a service may not have access to the network, so be cautious about putting service data files on a network drive.

Cheers
Bruce



CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Working directory for Webserver app as service
« Reply #2 on: June 11, 2010, 02:56:13 PM »
Thanks, Bruce.