[c++] service installation

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

[c++] service installation

Postby mlaski » Wed Jul 04, 2018 4:02 am

Hi,

I have created simple service (using template) and it works as expected. "Project1.exe /install" runs instalation and i have it on services list in sevices.msc. I can start and stop it correctly and functionality it provides works good. So I move the Project1.exe to another machine (Windows 8.1) and exec again "Project1.exe /install". BUT service is not installed. Application just running like standalone one providing all finctionality I've implemented.

No installation errors, no messages? How can I check where is the problem?

I have c++Builder 2007 and Windows 10 for developing.

Regards
Maciek
mlaski
 
Posts: 2
Joined: Wed Jul 04, 2018 3:53 am

Re: [c++] service installation

Postby rlebeau » Thu Jul 05, 2018 1:19 pm

mlaski wrote:So I move the Project1.exe to another machine (Windows 8.1) and exec again "Project1.exe /install". BUT service is not installed.


Are you running the /install command from an elevated command prompt window with admin rights?

mlaski wrote:Application just running like standalone one providing all finctionality I've implemented.


A default TService project cannot be run as a standalone application, except during (un)installation. It takes more work to make a service "runnable" outside of the SCM.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1547
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: [c++] service installation

Postby mlaski » Tue Jul 10, 2018 5:51 am

Yes from elevated rights.

That's what is bothering me. I create simple test file in initialization procedure. And this file is created when I'm running /instal AND /uninstall on computer with development tools. BUT, file is NOT created when service starts to run.

On second computer, where service doesn't create file is also created when I run /install.

Can't find solution. Will try to upload source code, but it's basicly the clean new service project.

Regards
Maciek
mlaski
 
Posts: 2
Joined: Wed Jul 04, 2018 3:53 am

Re: [c++] service installation

Postby rlebeau » Tue Jul 10, 2018 11:40 am

mlaski wrote:Yes from elevated rights.

That's what is bothering me. I create simple test file in initialization procedure. And this file is created when I'm running /instal AND /uninstall on computer with development tools. BUT, file is NOT created when service starts to run.


Please show your actual code. For instance, what path are you trying to write it to exactly, and does your project have write access to that folder during both installation and running? What user account, if any, is your service configured to run as? Or does it run as the local SYSTEM account?

mlaski wrote:On second computer, where service doesn't create file is also created when I run /install.


You said earlier that you can't even install the service on the other computer. That implies that either your service has a dependency that is missing on that computer, or the service is trying to do something it doesn't have rights to do on that computer.

mlaski wrote:Can't find solution.


Neither can anyone else here, because we can't see what your project is actually doing.

mlaski wrote:Will try to upload source code, but it's basicly the clean new service project.


There has to be something more to it than just that, or you wouldn't be having troubles with it.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1547
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA


Return to Technical

Who is online

Users browsing this forum: Google [Bot] and 5 guests