BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deployment with user level priveliges & TRegistry

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Deployment
View previous topic :: View next topic  
Author Message
James H
Guest





PostPosted: Tue Aug 23, 2005 5:31 am    Post subject: Deployment with user level priveliges & TRegistry Reply with quote



This is similar to question posted on 8/19, but with differences.
Delphi 5 App, WIN XP Pro.

Registry Values installed by administrator level
Using OpenKeyReadOnly to read values in HKLM/Software/App/SomeStringKey
still does not read any data, and no exception is generated either.

I've not been able to debug it as a common user on my dev machine,
because when I log in as user, my Delphi configuration is hosed, and I
haven't taken the time to figure out how to reinstall all the components
and packages I regularly use.

I'm truly stumped. Any suggestions ?

Regards,

Jim
Back to top
Brion L. Webster
Guest





PostPosted: Tue Aug 23, 2005 4:11 pm    Post subject: Re: Deployment with user level priveliges & TRegistry Reply with quote



James H wrote:

Quote:
Registry Values installed by administrator level
Using OpenKeyReadOnly to read values in HKLM/Software/App/SomeStringKey
still does not read any data, and no exception is generated either.

I've not been able to debug it as a common user on my dev machine, because
when I log in as user, my Delphi configuration is hosed, and I haven't
taken the time to figure out how to reinstall all the components and
packages I regularly use.

OpenKeyReadOnly returns True or False.

For debugging purposes, you can either create a log file in "My Documents"
or c:temp, or simply if OKRO then ShowMessage('it worked') else
ShowMessage('it failed').

Before you call OKRO, you also need to make sure you *set*
TRegistry.RootKey. By default it's set to HKCU, not HKLM, so all of your
OKRO calls will likely fail. Before/after you call OKRO, you might also
want to ShowMessage(myRegistry.CurrentKey) and/or myRegistry.CurrentPath.

-Brion

Back to top
James H
Guest





PostPosted: Tue Aug 23, 2005 4:23 pm    Post subject: Re: Deployment with user level priveliges & TRegistry Reply with quote



Thanks, I'll try the showmessages.
I already set Rootkey (I use a standard set of code for all registry
access) I can already guess it failed, because it did not return the
string value from the key. I'll post back when I figure it out.



Brion L. Webster wrote:
Quote:
James H wrote:

Registry Values installed by administrator level
Using OpenKeyReadOnly to read values in
HKLM/Software/App/SomeStringKey still does not read any data, and no
exception is generated either.

I've not been able to debug it as a common user on my dev machine,
because when I log in as user, my Delphi configuration is hosed, and I
haven't taken the time to figure out how to reinstall all the
components and packages I regularly use.


OpenKeyReadOnly returns True or False.

For debugging purposes, you can either create a log file in "My
Documents" or c:temp, or simply if OKRO then ShowMessage('it worked')
else ShowMessage('it failed').

Before you call OKRO, you also need to make sure you *set*
TRegistry.RootKey. By default it's set to HKCU, not HKLM, so all of
your OKRO calls will likely fail. Before/after you call OKRO, you might
also want to ShowMessage(myRegistry.CurrentKey) and/or
myRegistry.CurrentPath.

-Brion

Back to top
James H
Guest





PostPosted: Tue Aug 23, 2005 7:49 pm    Post subject: Re: Deployment with user level priveliges & TRegistry Reply with quote


Egg on face. The registry readstring that read the connection string for an ADO query was still set up as OpenKey(DBKEY, false), which invalidated everything else in the chain.

Thanks.

James H <jim.hock (AT) salemation (DOT) com> wrote:
Quote:
Thanks, I'll try the showmessages.
I already set Rootkey (I use a standard set of code for all registry
access) I can already guess it failed, because it did not return the
string value from the key. I'll post back when I figure it out.



Brion L. Webster wrote:
James H wrote:

Registry Values installed by administrator level
Using OpenKeyReadOnly to read values in
HKLM/Software/App/SomeStringKey still does not read any data, and no
exception is generated either.

I've not been able to debug it as a common user on my dev machine,
because when I log in as user, my Delphi configuration is hosed, and I
haven't taken the time to figure out how to reinstall all the
components and packages I regularly use.


OpenKeyReadOnly returns True or False.

For debugging purposes, you can either create a log file in "My
Documents" or c:temp, or simply if OKRO then ShowMessage('it worked')
else ShowMessage('it failed').

Before you call OKRO, you also need to make sure you *set*
TRegistry.RootKey. By default it's set to HKCU, not HKLM, so all of
your OKRO calls will likely fail. Before/after you call OKRO, you might
also want to ShowMessage(myRegistry.CurrentKey) and/or
myRegistry.CurrentPath.

-Brion


Back to top
Brion L. Webster
Guest





PostPosted: Tue Aug 23, 2005 8:06 pm    Post subject: Re: Deployment with user level priveliges & TRegistry Reply with quote

James H wrote:

Quote:
Egg on face. The registry readstring that read the connection string for
an ADO query was still set up as OpenKey(DBKEY, false), which invalidated
everything else in the chain.

Glad you found it!

-Brion

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Deployment All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.