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.
– Reginaldo Rigo
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.
– alice
In which folder are installed these Delphis, the 7 and the XE3?
– Reginaldo Rigo
Delphis are in c: program files
– alice
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?
– Reginaldo Rigo
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.
– alice
got. modified the <trustInfo> <applicationRequestMinimum>Permissionset ID="Fulltrust" Unrestricted="true" /> tag.
– alice
Post an answer to your own question. Others may benefit from this.
– Reginaldo Rigo