Access permission on a Delphi application

Asked

Viewed 429 times

0

Good morning!

I am using Inno Setup to generate an installer of my Delphi application.

In the application, I need to read Windows registry variables in HKEY_LOCAL_MACHINE:

if Registry.Openkey(' Software Enterprise'+'System', True) then showmessage('Opened Registration Key for Reading!');

But I can only perform this operation if I run the system as "Administrator". My question is: How do I create an installation in Inno Setup that already gives permission to the executable to perform reading and writing on the record?

Grateful for the attention

  • This is a prerogative of the operating system and not of the program.

  • Hi Reginaldo, thank you for answering. So, I made a minimal application with only a button on the screen that when clicking tries to access the windows registry. When I compile the code in Delphi 7, the client’s machine accesses the registration key and when I compile in Delphi xe3, , the machine does not access the registration key. Must be some option in the build between a Delphi and another. But I don’t know which one.

  • In which folder are installed these Delphis, the 7 and the XE3?

  • Delphis are in c: program files

  • I don’t know if this could be the problem, but I know that Delphi XE when installed in the Program Files folder is problematic. The programs in the client are also running in the Program Files folder?

  • 1

    yes... but I just saw a tip on how to run an exe with privileges...I needed to create a permissions manifest file and then compile with modification in the "Custom Manifest" option of Project/Options/Application/ "Runtime Themes". Now when you run exe you ask if you want to run as administrator. But I need to study the manifest file in the Trustinfo tag to run as an administrator without asking.

  • 1

    got. modified the <trustInfo> <applicationRequestMinimum>Permissionset ID="Fulltrust" Unrestricted="true" /> tag.

  • Post an answer to your own question. Others may benefit from this.

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.