We haven't discussed this in a couple of years. I need to take a program I run on the server 24/7/365 from an application that is run as a service. We tried this several years ago ( and discussed it here ) but it never actually worked properly.
I'd like to know if anyone has mastered this technology. I'm using Visual Studio 2019 with Harbor and FWH latest version. The service is an auto updater and does not need anything in the way of a screen display and does not need any i/o interactions.
In doing this, and linking harbour libraries, which ones do we actually need to include for the smallest build possible.
Thanks for the ideas and experiences you may share.
Tim
Building a Windows Service
Building a Windows Service
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
-
- Posts: 161
- Joined: Tue Oct 18, 2005 10:01 am
Re: Building a Windows Service
Hi Tim, I use this model and it works fine:
https://github.com/harbour/core/blob/ma ... ervice.prg
Regards.
https://github.com/harbour/core/blob/ma ... ervice.prg
Regards.
- Busmatic_wpb
- Posts: 162
- Joined: Wed Feb 22, 2017 2:19 am
Re: Building a Windows Service
Hello, I want to know how it is applied, an example, I thank you very much
Regards..
Regards..
Regards.
S.I.T.U.
Sistemas Inteligentes de transporte urbano
http://www.situcr.com
_@Situcr.com
Desarrollos BA4/B4j androide
S.I.T.U.
Sistemas Inteligentes de transporte urbano
http://www.situcr.com
_@Situcr.com
Desarrollos BA4/B4j androide
Re: Building a Windows Service
Do you have a build routine ? What are you using for compiling, and linking ?
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
-
- Posts: 161
- Joined: Tue Oct 18, 2005 10:01 am
Re: Building a Windows Service
to compile service.prg I use this:
---cut---
set PATH=c:\bcc\bin;%PATH%
\harbour-install\bin\hbmk2 service -lhbwin -lace32 -lrddads -iC:\harbour-install\contrib\hbwin
---cut---
Regards.
---cut---
set PATH=c:\bcc\bin;%PATH%
\harbour-install\bin\hbmk2 service -lhbwin -lace32 -lrddads -iC:\harbour-install\contrib\hbwin
---cut---
Regards.
Re: Building a Windows Service
OK ... I can build the application and get an .exe. ( I'm using Microsoft Visual Studio 2019 ). As an .exe it runs as expected but is not visible. That is fine.
When I try to run it from the Developer's Command Prompt using abc.exe I it gives me an access denied error. Any thoughts ?
When I try to run it from the Developer's Command Prompt using abc.exe I it gives me an access denied error. Any thoughts ?
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
Re: Building a Windows Service
Still looking for input ... but I did get it to install and "run" ( or at least it says it is running ).
Following the example suggested above:
I place the .exe that is to be run as a service in a folder where the data is located. I need to use those data files. Normally, since the program is located in the directory, I can use commands to find the "path" by identifying the directory and folder. The system path is then used as the "default".
If I hardcode in the path, all is working. However, that path may change depending on where the IT "professional" decides to install the software.
I'm also curious about a question that came up before. I'd love to have the service simply call another .exe file ( but the discussion previously indicated someone would still have to be logged in ). That would allow me to update the service file easily. I would simply have to replace the 2nd exe ( non-service ). Anyone done this ?
Following the example suggested above:
I place the .exe that is to be run as a service in a folder where the data is located. I need to use those data files. Normally, since the program is located in the directory, I can use commands to find the "path" by identifying the directory and folder. The system path is then used as the "default".
If I hardcode in the path, all is working. However, that path may change depending on where the IT "professional" decides to install the software.
I'm also curious about a question that came up before. I'd love to have the service simply call another .exe file ( but the discussion previously indicated someone would still have to be logged in ). That would allow me to update the service file easily. I would simply have to replace the 2nd exe ( non-service ). Anyone done this ?
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019