I have an update program called. MLupdate.exe. I place it in the primary directory created for my application ( ie. c:\ML ). This has a subdirectory where all files are stored ( ie. C:\ML\Data\ ).
When run as an application, it checks the current drive and directory and creates a cPath variable that points to the data file.
When run as a service, Windows has it start in the System32 folder, even though that is not where it physically resides, and it can't find the data files.
I could probably put a configuration file in the System32 folder to be read by the service, but the main problem is the actual installed location of the data directory can be different. For example, on some servers it might be N:\Shared\ML\Data\. I could create and configure this manually on each install, but prefer to do it with the installer ( Actual Installer ).
The easiest solution would be to get the service to know where it's file is located, and set it's path accordingly.
Any suggestions on to get this accomplished within the service startup code ?
Thanks.