FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour App as service default path
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
App as service default path
Posted: Tue Jul 30, 2019 08:57 PM

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.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: App as service default path
Posted: Thu Aug 01, 2019 04:42 PM

Is no one using FWH / Harbour to build a Windows service ? I would think someone must have encountered this issue.

The main problem is that a 24/7 app used to perform daily tasks automatically, if installed on Windows Server, will not run unless someone actually logs into the server. The way around this is to install a service. I got one built, and running, but had to hardcode a path since it sets it's root as the System/Windows32 folder even when installed elsewhere.

Surely someone has ideas on this.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion