unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DFUnRar, ZipMstr, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, Grids, StdCtrls, ShellApi;
type
TForm1 =
class(TForm)
ZipMaster1: TZipMaster;
IdHTTP1: TIdHTTP;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var dat_orig, dat_copy, exe_name, version:
string;
MsgDlg1: integer;
procedure namen;
begin
dat_orig:= '
update.exe';
dat_copy:= '
bak\update.exe';
exe_name:= '
update';
version:= '
1.0.0';
end;
{procedure TForm1.IdHTTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode;
AWorkCountMax: Integer);
begin
form1.ProgressBar1.Max := AWorkCountMax;
gesamt := AWorkCountMax;
Label2.Caption := '0 von '+FloatToStrF(gesamt/1000000,ffFixed,10,2)+' MB geladen';
FTime := GetTickCount;
FBytes := 0;
end;}
procedure upd;
begin
begin
CopyFile(PChar(Dat_orig), PChar(Dat_copy) ,true);
end;
close;
{ form1.zipmaster1.DLLDirectory:= ExtractFilePath(ParamStr(0));
form1.zipmaster1.ExtrOptions:= form1.zipmaster1.ExtrOptions + [ExtrDirNames, ExtrOverwrite];
form1.zipmaster1.ZipFilename:= 'C:\toll.zip';
form1.zipmaster1.ExtrBaseDir:= 'C:\bak';
form1.zipmaster1.Extract;}
end;
procedure start;
begin
MsgDlg1:= MessageDlg('
Backup Anlegen ?', mtConfirmation, [mbYes, mbNo], 0);
if MsgDlg1= mrYes
then
begin
namen;
if
DirectoryExists('
bak')
then
upd
else
mkdir('
bak');
upd;
end
else
begin
upd;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Start;
ShellExecute(Application.Handle,'
open',PChar(exe_name + '
.exe'),PChar('
/update ' + version),PChar('
'),SC_DEFAULT);
end;
end.