unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ShellApi;
type
TForm3 =
class(TForm)
Panel1: TPanel;
Label1: TLabel;
lbl_Datei: TLabel;
lbl_Prozent: TLabel;
btn_Beenden: TButton;
Label2: TLabel;
lbl_Pfad: TLabel;
Timer1: TTimer;
procedure btn_BeendenClick(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form3: TForm3;
implementation
uses Unit1, Unit2;
{$R *.dfm}
function AreFilesEqual(
const file1, file2:
String): Boolean;
var
m1, m2: TMemoryStream;
begin
Result := False;
m1 := TMemoryStream.Create;
try
m1.LoadFromFile(file1);
m2 := TMemoryStream.Create;
try
m2.LoadFromFile(file2);
if m1.Size = m2.Size
then
Result := CompareMem(m1.Memory, m2.Memory, m1.Size);
finally
m2.Free;
end;
finally
m1.Free;
end
end;
procedure TForm3.btn_BeendenClick(Sender: TObject);
begin
close;
end;
procedure TForm3.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
form1.close;
form2.close;
end;
procedure TForm3.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled:=false;
//CopyFile(PChar(ExtractFilePath(ParamStr(0))+'data\um_kalender.exe'), PChar(pfad+'\um_kalender.exe'), False);
CopyFile('
C:\Dokumente und Einstellungen\Arne\Desktop\temp\data.zip', PChar(Pfad+'
\data.zip'), False);
lbl_Prozent.Caption:='
100%';
end;
procedure TForm3.FormShow(Sender: TObject);
begin
Pfad:='
C:\Dokumente und Einstellungen\Arne\Desktop\temp\um_kalender';
lbl_Pfad.Caption:=Pfad;
lbl_Datei.Caption:='
Kopiere data.zip';
lbl_Prozent.Caption:='
0%';
ForceDirectories(Pfad);
Timer1.Enabled:=true;
end;
end.