Recent

Author Topic: Installing deb package from within Lazarus/Pascal application  (Read 1289 times)

MaxCuriosus

  • Full Member
  • ***
  • Posts: 115
Is it possible to install a deb package that requires superuser privilege from within Lazarus/Pascal application? Something that normally is done in the terminal or in a bash script in a way like

sudo dpkg -i abc.deb

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Installing deb package from within Lazarus/Pascal application
« Reply #1 on: April 15, 2020, 12:21:32 pm »
Yes, using TProcess (or one of the function in the Process unit) to run a transitory shell and passing to it the command you want to run.

Similar questions have been already answered in the forum; look for: "running a command as admin" or similar.
« Last Edit: April 15, 2020, 12:24:06 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018