View Single Post
  #2  
Old 17-10-2015, 21:49
rinaldo's Avatar
rinaldo rinaldo is offline
Registered User
 
Join Date: Sep 2015
Location: Rome
Posts: 433
Thanks: 101
Thanked 696 Times in 191 Posts
rinaldo is on a distinguished road
I do not know if I understand correctly, but since the game do not think so ... but what I understand is this (create a bat file in .iss)

Code:
[Setup]
AppName=Bat
AppVername=Bat
DefaultDirName={pf}\Bat

[code ]
var
List: TStringList; batfile: string; res: Integer;
CreateBatBtn:TButton;

procedure CreateFileBat(Sender: TObject);
begin
  batfile:= ExpandConstant('{src}\Compress.bat');
  List:= TStringList.Create;
  List.Add('@echo off');
  List.Add('echo. Transformers Devastation');
  List.Add('echo. x 1 DVD5');
  List.Add(':Data1');
  List.Add('set arc=Data1.cab');
  List.Add('if exist .\TRANSF_1\%arc% goto Data2');
  List.Add('echo.Creating %arc%, please wait...');
  List.Add('echo.');
  List.Add('echo.--------------------------------------------------------------------');
  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 with WizardForm do begin
InnerNotebook.Hide;
OuterNotebook.Hide;
CancelButton.Left:=-Left;
NextButton.Left:=-Left;
CreateBatBtn := TButton.Create(WizardForm);
with CreateBatBtn do begin
Caption := 'Create Bat';
Parent := WizardForm;
SetBounds(420,327,60,25)
onclick:=@CreateFileBat;
end
end;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm := False;
end;

Last edited by rinaldo; 17-10-2015 at 22:49.
Reply With Quote
The Following User Says Thank You to rinaldo For This Useful Post:
y_thelastknight (18-10-2015)