2

I want to ease my father's task of installing some software that I'm developing for him.
For this I'm using Lazarus and I would like to know if there is and API to raize the privilege escalation dialog.

It seams to be hard to pin-point a single query to present on Google:
"lazarus privilege escalation" is not helping.
"lazarus privilege dialog" is not helping either.

I do realize that it's possible to ask the user to run it under gksudo, but I would like to avoid any scripting or command line using.

So I'm a bit lost in terms of where to turn.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76

1 Answers1

0

You can use TProcess to run some tasks with privileges you need using sudo (maybe gksudo works too). Here you have example how to do it:

http://wiki.freepascal.org/Executing_External_Programs#Redirecting_input_and_output_and_running_under_root

TSr
  • 331
  • 1
  • 12
  • My original idea is to raise the running program's privileges, so it can run internal routines as an elevated user, not external commands. – Gustavo Carreno Sep 09 '13 at 19:56
  • Did you try to run your program itself as root with method above and then terminate the first instance? – TSr Sep 11 '13 at 19:33