Jeg kan simpelthen ikke få det til at virke... Den kopierer ikke filerne.. Men her er ihvertfald min komplette kode så kan det være der er nogen der kan finde fejlen.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Registry, StdCtrls, ShellAPI;
type
TForm2 = class(TForm)
Install: TButton;
Cancel: TButton;
Edit1: TEdit;
Label1: TLabel;
CheckBox1: TCheckBox;
Label2: TLabel;
procedure InstallClick(Sender: TObject);
procedure CancelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
Target: string;
Source: string;
implementation
{$R *.dfm}
procedure TForm2.InstallClick(Sender: TObject);
begin
Target:= Edit1.text;
Source:= ExtractFilePath(ParamStr(0)) + 'Data/Guess.exe';
if CopyFile(PChar(Source), PChar(Target), True) then
begin
ShowMessage('Install Complete!');
end
else
begin
ShowMessage('An error occured when copying files to your computer. Try and install to another directory or re-run the setup program.');
end;
end;
procedure TForm2.CancelClick(Sender: TObject);
begin
close;
end;
end.
Mvh.
Rune Jensen
---------------------------------------------------------------------------
##The one who laugh last is the one who think slowest!##
---------------------------------------------------------------------------