Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing Registry in Vista/Win7

Status
Not open for further replies.

magicbruno

Programmer
Mar 19, 2010
3
IT

I have an application compiled in Delphi 2005 the read and write some Windows Registry keys.

I tryed on Windows 7 (x64). Non problem, non errors. Values in Reqistry are setted correctly.

I have recompiled the source with Delphi 2009. When I run the program a get the "Impossible create key" error and write fails. If i run the new compilead application "as administrator" the problem disappears.

Why the same application compiled with Delphi 2005 don't need to be run in "administrator mode", and compiled with Delphi 2009 must ?

Any idea.

Tahcsk a lot
 
I think that D2009 includes a manifest resource concerning elevation in Vista/W7.
The culprit however is that your application is trying to read/write keys that are not accessible in the first place. If this is really needed then the D2009 behaviour is correct and the application must have elevated privileges to modify the registry keys.
Try to cure the disease, not the symptoms.

here's a nice document concerning UAC and delphi:

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks a lot. I'm try now to understand how UAC work and this link is very usefull.

Now the question is: Why are'nt virtualized TRegistry write operations in a Delphi 2009 applications ?

magicbruno
 

At last I've understood. Key information: Virtualization is disabled for executables with UAC information in manifest!!!

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top