RTC Forums
November 27, 2024, 11:58:19 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Cannot run RTC applications as a service  (Read 8033 times)
togrant
RTC Expired
*
Posts: 5


« on: April 21, 2015, 03:57:52 AM »

I am using RTC SDK 6.52 on Win 7 with XE5. Everything works fine except that I cannot run applications make with RTC SDK as a service. Even the RTCWebserer demo will  not run, nor does the old Portal Gateway. The applications all work fine as GUI applications. The services install fine but will not start. I get the message Unable to start service and on the applications with a log I get the following:
FATAL ERROR EOSError: System Error.  Code: 5.
Access is denied

I have set and checked all the permissions on  the applications and folders and have checked everything I can think of. Has any one else experienced this? If so how did you solve it?

Tony Grant
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: April 21, 2015, 06:00:52 AM »

Windows OS Error Code 5 means "Access denied" and points to a problem with priviliges of the User account under which you are trying to install or run the Service. The easiest solution would be to install the Service as Administrator (right-click the EXE and use "Run as Administrator") and run the Service under the Localsystem account (default when installing Services compiled in Delphi).

If there is a reason for you to NOT want to run the Service under the Localsystem account, then you will need to configure all the required permissions manually for the User Account you want to use for running the Service. The absolute minimum you need for RTC components is Network Access. If you are unfamiliar with configuring User permissions under Windows, I am sure you will find a lot  of useful guides on the web. Here is one I've just found which looks like it was written for absolute beginners, while at the same time convering a lot of material:

http://www.howtogeek.com/school/windows-network-sharing/

Best Regards,
Danijel Tkalcec
Logged
togrant
RTC Expired
*
Posts: 5


« Reply #2 on: April 21, 2015, 01:23:32 PM »

The service is running under the Localsystemaccount and "Run as Administrator" was the first thing I tried, but that did not work. The folder and exe has full security rights, I was logged in as administrator for the installation. I can install and run other services without issue. It appears to be only applications using RTC SDK that have that issue. I can use a very old exe of RTC portal gateway that was compiled with a much older version of the SDK using Delphi XE and that installs and runs fine. If I compile the same source code with XE5 using SDK 6.52 I get the problem.

I tried installing the service on a Win XP machine, on the first attempt to start the service I received the message that the service started and stopped because it had nothing to do. On subsequent attempts the result was exactly the same as on the Win 7 machine.

Tony Gant
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: April 21, 2015, 01:29:36 PM »

If you think the problem is the latest RTC SDK version, then I recommend you to download one of the older RTC SDK versions to see if that fixes the problem. But I am sure the problem is somewhere else, because (before posting the 1st reply to your topic) I have compiled the RTC WebServer demo using the latest RTC SDK version (v6.52) with Delphi XE5 to a Win32 application and installed it as a Service on my Windows 7 (64-bit) development machine and it runs without any issues.

Best Regards,
Danijel Tkalcec
Logged
Andrew.W
RTC License
***
Posts: 43


« Reply #4 on: April 21, 2015, 02:33:15 PM »

Hi

I run a version of RTC SDK developed under XE5. I think I'm using 4.62 or something like that.

RTC runs fine as a service, at least in the version I have. It's compiled into a DLL, and the service loads and starts the DLL.

You have not meantioned it, but if I recall you'll need to establish your own message pump. If you don't do this, I can't see how it would work. I'm pretty sure I had to do this.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #5 on: April 21, 2015, 02:44:43 PM »

When you set the MultiThreaded property on the TRtcHttpServer component to TRUE, a separate thread will be created by RTC to handle all the WinSock messages. This is true for a Service as well as normal process, so there is no need for manually creating a message pump if you are using the components in MultiThreaded mode.

Best Regards,
Danijel Tkalcec
Logged
togrant
RTC Expired
*
Posts: 5


« Reply #6 on: April 21, 2015, 02:53:02 PM »

I just did a build or of the Webserver project and now it is working as a service on Win 7. (I built the project last night also. I am not sure what has changed between then and now). The Portal Gateway is still not running as a service, I know this is old code, are there any changes that are needed with this code or in its package code to correct this?

Tony Grant
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #7 on: April 21, 2015, 03:07:07 PM »

RTC Portal Gateway should be working as-is (even the old version), but to run the Portal Host on Windows 7 as a Service, you will need the latest RTC Portal version (v4.09), which splits the Host into a normal process doing all the work and the Service which only checks for the presence of Explorer and acts as a launcher for the desktop Host process. This is required for Portal Host because of limitations enforced by Microsoft on Windows Vista, 7 and later versions.

PS. You can download the latest RTC Portal version from the "RTC Portal Downloads" area. It is compatible with the latest version of the RTC SDK and should work when compiled with Delphi 7 - XE8 for the Win32 platform.

Best Regards,
Danijel Tkalcec
Logged
togrant
RTC Expired
*
Posts: 5


« Reply #8 on: April 21, 2015, 03:26:47 PM »

I am using 4.09 but I will reinstall it as I upgraded some third party components recently and then had minor issues with addons like AQtime and had to reinstall that. 

Tony Grant
Logged
togrant
RTC Expired
*
Posts: 5


« Reply #9 on: April 21, 2015, 04:25:01 PM »

I reinstalled 4.09 and it worked fine. the service is now starting. I think I will do an audit of all my addons, since I have had a few problems with some of them after doing a few upgrades.

thanks for your help.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #10 on: April 21, 2015, 04:55:07 PM »

Ok. Thank you for your feedback.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.028 seconds with 17 queries.