Recent

Author Topic: create simple GUI apt-get with output and progress bar  (Read 4393 times)

steve1986

  • Newbie
  • Posts: 3
create simple GUI apt-get with output and progress bar
« on: February 13, 2016, 03:17:00 am »
Hi I have question, how to create simple GUI apt-get output and with progress bar? and only use one button
how to modify this code?

procedure TForm1.Button1Click(Sender: TObject);
var process : tprocess;
begin
   Process := TProcess.Create(nil);
  Process.CommandLine := 'apt-get install -y gedit';
  Process.Options := [poUsePipes];

  Process.Execute;

  while Process.Running do
  Memo1.Lines.LoadFromStream(Process.Output);
end;                             
thank for your answer

itmitica

  • Jr. Member
  • **
  • Posts: 85
Re: create simple GUI apt-get with output and progress bar
« Reply #1 on: February 13, 2016, 08:27:30 am »
You could pipe to debconf-apt-progress.

Code: Pascal  [Select][+][-]
  1. Process.CommandLine := '/bin/sh -c sudo apt-get install -y gedit | debconf-apt-progress';

I'm not sure what the output looks like though.


On the other hand, you could show a undefined progress bar, with an animation, for the duration.
« Last Edit: February 13, 2016, 08:40:19 am by itmitica »


steve1986

  • Newbie
  • Posts: 3
Re: create simple GUI apt-get with output and progress bar
« Reply #3 on: February 14, 2016, 04:35:51 am »
Thank your answer, it is greats.  but a I want GUI progress bar not TUI progressbar

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: create simple GUI apt-get with output and progress bar
« Reply #4 on: February 15, 2016, 05:59:05 pm »
Thank your answer, it is greats.  but a I want GUI progress bar not TUI progressbar
I think Leledumbo's is the answer you're looking for.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

 

TinyPortal © 2005-2018