[fpc-pascal] TRegistry documentation

Bart bartjunk64 at gmail.com
Wed Jun 16 14:31:41 CEST 2021


On Wed, Jun 16, 2021 at 2:26 PM Jean SUZINEAU via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

> I think there is a way to do this with a single program.

Using Lazarus IDE I tried to set Execution level to
"requireAdministrator", but then the program simply would not run (it
would not ask for the admin password), so in the end I just used
something like:

uses
  WinUtils;

procedure CheckIsAdmin;
begin
  if not WinUtils.IsWindowsAdmin then
  begin
    writeln('This program requires administrator priviliges.');
    writeln;
    Halt;
  end;
end;

Bart


-- 
Bart


More information about the fpc-pascal mailing list