unit uyapimain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, process, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls;
type
{ TForm1 }
TForm1 =
class(TForm)
btnInstall: TButton;
btnCancel: TButton;
btnClose: TButton;
cbPkgToInstall: TComboBox;
Label1: TLabel;
Label2: TLabel;
list: TListBox;
InstallProcess: TProcess;
RadioGroup1: TRadioGroup;
procedure btnCloseClick(Sender: TObject);
procedure btnInstallClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
FPackageName:
String;
FParameters:
String;
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var i: integer;
begin
InstallProcess.CurrentDirectory := GetCurrentDir + '
/';
FPackageName := '
';
if ParamCount <> 0
then FPackageName := ParamStr(1);
for i := 2
to ParamCount-1
do FParameters := FParameters + '
' + ParamStr(i);
cbPkgToInstall.Text := FPackageName;
//ShowMessage('Aktuelles Verzeichnis: '+InstallProcess.CurrentDirectory);
//cbPkgToInstall.Text := '/home/knoppix/Downloads/skypeforlinux-64.deb';
end;
procedure TForm1.btnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.btnInstallClick(Sender: TObject);
begin
//cbPkgToInstall.Text := '/home/knoppix/Downloads/skypeforlinux-64.deb';
FPackageName := cbPkgToInstall.Text;
if FPackageName <> '
'
then
begin
InstallProcess.Executable := FPackageName;
InstallProcess.Parameters.Add('
Install');
//Add(FParameters);
InstallProcess.Execute;
list.items.LoadFromStream(InstallProcess.Output);
end
else
begin
ShowMessage('
Bitte zu installierendes Paket angeben!');
end;
end;
end.