🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2096

Re: Vista and Writing to the Registry

#2096
From: Remy Lebeau (TeamB)
Date: Wed, 02 May 2007 16:50
30 lines
2122 bytes
"Mark Jacobs" <http://www.jacobsm.com/mjmsg.htm?BorlandNG> wrote in
message news:4638664c@newsgroups.borland.com...

> I have an application that cannot write to the registry
> unless I set its properties, compatibility to run as admin.

Then you are probably writing to a section of the registry that you
shouldn't be, unless you really are trying to perform tasks that are
deemed to be administrative in nature.  What exactly are you trying to
do?  Also, make sure that you are opening the key(s) with the proper
access rights as well.  For instance, TRegistry defaults to requiring
admin rights by default, so you would have to set the TRegistry.Access
property accordingly before opening a key.

> After doing this, each time the PC is restarted, and the app is set
> launch at boot up, but I get a UAC message asking me if I'm sure
> I want to allow my app to run with admin privileges. Is there any
> way programmatically to avoid this prompt each time?

No.  That would circumvent what UAC is all about.

> Is there a better way of ensuring an app can write to the registry
> under Vista?

Don't write to restrictive areas to begin with, unless you absolutely
have to (in which case, you need admin rights to access them).


Gambit
Technical Details
Message-ID: <4638c160$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4638664c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b61a7950d3d9bb4a
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4638664c@newsgroups.borland.com>
Subject: Re: Vista and Writing to the Registry
Date: Wed, 2 May 2007 09:50:36 -0700
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.82.60.244
Message-ID: <4638c160$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1178124640 75.82.60.244 (2 May 2007 09:50:40 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail