y_thelastknight]
[Setup]
AppName=Bat
AppVername=Bat
DefaultDirName={pf}\Bat
OutputDir=.
[code ]
var
List: TStringList; batfile: string; res: Integer;
CreateBatBtn:TButton;
OptionEdit,MethodEdit,NameEdit,ArcEdit,DataEdit:TN ewEdit;
OptionLabel,MethodLabel,NameLabel,ArcLabel,DataLab el:TLabel;
Memo:TNewMemo;
procedure CreateFileBat(Sender: TObject);
begin
batfile:= ExpandConstant('{src}\Compress.bat');
List:= TStringList.Create;
List.Add('@echo off');
List.Add('echo.'+ NameEdit.Text);
List.Add('echo. x 1 DVD5');
List.Add('pause');
List.Add(':'+DataEdit.Text);
List.Add('set arc='+ArcEdit.Text);
List.Add('if exist .\TRANSF_1\%arc% goto Data2');
List.Add('echo.Creating %arc%, please wait...');
List.Add('echo.');
List.Add('echo.--------------------------------------------------------------------');
List.Add(''+OptionEdit.Text+' '+MethodEdit.Text+'
[email protected] [email protected] -dp"%choice%" .\TRANSF_1\%arc%');
//List.Add('arc a -ep1 -r -w.\ -msrep
[email protected] [email protected] -dp"%choice%" .\TRANSF_1\%arc%');
List.Add('if ERRORLEVEL 1 goto arcfail');
List.Add('pause');
List.SaveToFile(batfile);
List.Free;
if Exec(batfile, '', '', SW_SHOW, ewNoWait, Res) then MsgBox('Bat Created', mbInformation, MB_OK);
end;
procedure InitializeWizard();
begin
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.CancelButton.Width:=0;
WizardForm.NextButton.Width:=-0;
CreateBatBtn:= TButton.Create(WizardForm);
CreateBatBtn.Caption := 'Create Bat';
CreateBatBtn.Parent := WizardForm;
CreateBatBtn.SetBounds(420,327,60,25)
CreateBatBtn.onclick:=@CreateFileBat;
NameLabel:=TLabel.Create(WizardForm);
NameLabel.Parent:=WizardForm;
NameLabel.Top:=120;
NameLabel.Left:=20;
NameLabel.Width:=100;
NameLabel.Height:= 23;
NameLabel.Caption:='Name';
//
OptionEdit:=TNewEdit.Create(WizardForm);
OptionEdit.Parent:=WizardForm;
OptionEdit.Top:=68;
OptionEdit.Left:=100;
OptionEdit.Width:=200;
OptionEdit.Height:= 0
MethodEdit:=TNewEdit.Create(WizardForm);
MethodEdit.Parent:=WizardForm;
MethodEdit.Top:=93;
MethodEdit.Left:=100;
MethodEdit.Width:=200;
MethodEdit.Height:= 0
//
NameEdit:=TNewEdit.Create(WizardForm);
NameEdit.Parent:=WizardForm;
NameEdit.Top:=118;
NameEdit.Left:=100;
NameEdit.Width:=200;
NameEdit.Height:= 0;
ArcLabel:=TLabel.Create(WizardForm);
ArcLabel.Parent:=WizardForm;
ArcLabel.Top:=NameLabel.Top+25;
ArcLabel.Left:=20;
ArcLabel.Width:=100;
ArcLabel.Height:= 23;
ArcLabel.Caption:='Archive Name';
ArcEdit:=TNewEdit.Create(WizardForm);
ArcEdit.Parent:=WizardForm;
ArcEdit.Top:=NameEdit.Top+25;
ArcEdit.Left:=NameEdit.Left;
ArcEdit.Width:=200;
ArcEdit.Height:= 0;
DataLabel:=TLabel.Create(WizardForm);
DataLabel.Parent:=WizardForm;
DataLabel.Top:=ArcLabel.Top+25;
DataLabel.Left:=20;
DataLabel.Width:=100;
DataLabel.Height:= 23;
DataLabel.Caption:='Data Number';
//
OptionLabel:=TLabel.Create(WizardForm);
OptionLabel.Parent:=WizardForm;
OptionLabel.Top:=NameLabel.Top-49;
OptionLabel.Left:=20;
OptionLabel.Width:=100;
OptionLabel.Height:= 23;
OptionLabel.Caption:='Option Code';
MethodLabel:=TLabel.Create(WizardForm);
MethodLabel.Parent:=WizardForm;
MethodLabel.Top:=NameLabel.Top-24;
MethodLabel.Left:=20;
MethodLabel.Width:=100;
MethodLabel.Height:= 23;
MethodLabel.Caption:='Method Code';
//
DataEdit:=TNewEdit.Create(WizardForm);
DataEdit.Parent:=WizardForm;
DataEdit.Top:=ArcEdit.Top+25;
DataEdit.Left:=NameEdit.Left;
DataEdit.Width:=200;
DataEdit.Height:= 0;
Memo:=TNewMemo.Create(WizardForm);
Memo.Parent:=WizardForm;
Memo.Left := ScaleX(192);
Memo.Top := ScaleY(96);
Memo.Width := ScaleX(169);
Memo.Height := ScaleY(145);
Memo.Hide;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm := False;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
end;