Solved

NT4 service's permission to access registry.

Posted on 2000-05-07
3
194 Views
Last Modified: 2010-04-04
Hello there,

I have written NT service... After it is installed (NT4 WS, admin login) it causes errors every time it tries to read (same with write) some data from/to system registry. Other than that it works as expected but registry is the pain. Furthermore it writes the data to the root of the HKLM dispite the key I am trying to operate at... Seems I missing something obvious am I?? Like permissions etc. Any info will be appreciated. Thanks in advance!

Art.
0
Comment
Question by:_art_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 2785977
some code from your programme will help others understand it better, Art.
0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2786788
if you write the registry code in a normal exe, not a service, does it do as expected? maybe the problem is simply in the code, not in the fact it's a service.
0
 

Accepted Solution

by:
jolla earned 50 total points
ID: 2787516
As mullet writes: Have you checked that the registry access works in a "normal" program?
I have a service that does this in the ServiceStart event:
RegKey is a global:
  RegKey = '\SOFTWARE\TT\Standin\';

var
  RegConnect: TRegistry;
begin
  RegConnect := TRegistry.Create;
  RegConnect.RootKey := HKEY_LOCAL_MACHINE;
      if RegConnect.OpenKey(RegKey, FALSE) then begin
        Datapath := RegConnect.ReadString('Datapath');
        timer1.Interval := RegConnect.ReadInteger('Intervall')*1000;
        os1.logondatabase := RegConnect.ReadString('Database');
        os1.logonusername := RegConnect.ReadString('Username');
        os1.logonpassword := RegConnect.ReadString('Password');
        RegConnect.CloseKey;
[etc]

The keys need to exist I have noticed. So in the AfterInstall event I have a similar thing that creates the keys if they do not exist.
The service management box on the NT under Startup I have marked that it should log on as System Account.


0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Printing problem 2 110
How to renew a Delphi rad-studio licence? 5 77
LAN or WAN ? 11 106
Delphi: barcode reading on android platform 1 72
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question