PDA

View Full Version : Scrip to Compress.bat


gatosky1620
13-10-2015, 13:38
Another neccesary tool to be create

Anybody could create a tool (exe, or iss or ??) where they can enter:

-aplication name and numbers of DVD5
-path to be compressed C:\Program Files(x86)\Transformers Devastation
-Check path e.g. "%choice%\Binaries\Win32\DMC-DevilMayCry.exe"
-include .lst files with exclude options to each list if is neccesary
-names of the folders TRANSF_x
and..

:Data1
set arc=Data1.cab
if exist .\TRANSF_1\%arc% goto Data2
echo.Creating %arc%, please wait...
echo.
echo.--------------------------------------------------------------------
arc a -ep1 -r -w.\ -msrep [email protected] [email protected] -dp"%choice%" .\TRANSF_1\%arc%
if ERRORLEVEL 1 goto arcfail

to create automatically a Compress.bat file like i use in my posts

rinaldo
17-10-2015, 21:49
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) :(

[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;

y_thelastknight
18-10-2015, 02:33
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) :(



yes but he just need red marked font as changeable using tedit.

rinaldo
18-10-2015, 18:56
yes but he just need red marked font as changeable using tedit.

english language help me :D

Another example but do not quite understand sorry :p
#define GameName "Car Mechanic Simulator 2015 Gold EditionS"
#define DvD "1x DVD5"

[Setup]
AppName=RinaCompress
AppVersion=1.0.0.0
CreateAppDir=No
OutputBaseFileName=Compressor
OutputDir=.
;SetupIconFile=Icon.ico
Compression=none


[CustomMessages]
en.SelectMsg=Select Game to Compress
en.CompBtn=Compress

[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"

[Code ]
var
Lbl : array [1..6] of TLabel;
CompressBtn: TButton;
FolderTreeView: TFolderTreeView;
CustomDirEdit, CustomOutputEdit: TNewEdit;
List: TStringList;
Dirs,batfile: string;
res: Integer;

procedure DirFolderChange(Sender: TObject);
Begin
CustomDirEdit.Text:=FolderTreeView.Directory;
end;

procedure ConvertOnClick(Sender: TObject);
begin
wizardForm.Close;
Dirs:=WizardForm.DirEdit.Text;
batfile:= ExpandConstant('{src}\Comp.bat');
List:= TStringList.Create;
List.Add('@echo off');
List.Add('arc a DVD\Data1.arc -mx "'+Dirs+'\*"');
List.Add('pause');
List.Add('del Comp.bat');
List.SaveToFile(batfile);
List.Free;
Exec(batfile, '', '', SW_SHOW, ewNoWait, Res);
end;

procedure CW;
begin
WizardForm.Caption := ExpandConstant('Bat Creating Compress Tool');

Lbl[1] := TLabel.Create(WizardForm);
Lbl[1].Parent := WizardForm.WelcomePage;
Lbl[1].Alignment := taCenter;
Lbl[1].Caption := '{#GameName}';
Lbl[1].Font.Height := -14;
Lbl[1].Font.Name := 'Arial Black';
Lbl[1].SetBounds(0,0,480,23);

Lbl[2] := TLabel.Create(WizardForm);
Lbl[2].Parent := WizardForm.WelcomePage;
Lbl[2].Alignment := taCenter;
Lbl[2].Caption := '{#DvD}';
Lbl[2].Font.Height := -12;
Lbl[2].Font.Name := 'Arial Black';
Lbl[2].SetBounds(0,20,480,23);


Lbl[3] := TLabel.Create(WizardForm);
Lbl[3].Parent := WizardForm.WelcomePage;
Lbl[3].Caption := ExpandConstant('{cm:SelectMsg}:');
Lbl[3].Font.Size := 8;
Lbl[3].Font.Name:='Lucida Console'
Lbl[3].SetBounds(5,46,480,23);

Lbl[4] := TLabel.Create(WizardForm);
Lbl[4].Parent := WizardForm.WelcomePage;
Lbl[4].Font.Size := 8;
Lbl[4].Font.Name:='Lucida Console'
Lbl[4].SetBounds(8,280,480,23);

Lbl[5] := TLabel.Create(WizardForm);
Lbl[5].Parent := WizardForm.WelcomePage;
Lbl[5].Font.Size := 8;
Lbl[5].Font.Name:='Lucida Console';

CompressBtn := TButton.Create(WizardForm);
CompressBtn.Parent := WizardForm.WelcomePage;
CompressBtn.SetBounds(410,57,73,25);
CompressBtn.Caption := ExpandConstant('{cm:CompBtn}');
CompressBtn.OnClick := @ConvertOnClick;

CustomDirEdit := TNewEdit.Create(WizardForm);
CustomDirEdit.Parent := WizardForm.WelcomePage;
CustomDirEdit.Text:= ExpandConstant('{pf}\{#GameName}');
CustomDirEdit.SetBounds(5,60,400,20);

FolderTreeView := TFolderTreeView.Create(WizardForm);
FolderTreeView.Parent := WizardForm.WelcomePage;
FolderTreeView.SetBounds(5,90,400,100);
FolderTreeView.OnChange:= @DirFolderChange;

CustomOutputEdit := TNewEdit.Create(WizardForm);
CustomOutputEdit.Parent := WizardForm.WelcomePage;
CustomOutputEdit.Text:= ExpandConstant('{src}\{#GameName}');
CustomOutputEdit.SetBounds(5,124,400,21);
CustomOutputEdit.Hide;
end;

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

procedure InitializeWizard();
begin
WizardForm.WelcomePage.Color := $00FFCA41;
WizardForm.BorderStyle := bsSizeToolWin;
WizardForm.ClientHeight:=200;
WizardForm.CancelButton.Left:=9999;
WizardForm.NextButton.Left:=9999;
WizardForm.WizardBitmapImage.Visible:=False
WizardForm.WelcomeLabel1.Visible:=False;
WizardForm.WelcomeLabel2.Visible:=False;
CW();
end;
Script 2:

#define GameName "Car Mechanic Simulator 2015 Gold EditionS"
#define DvD "1x DVD5"
#define GameSize "10000"

[Setup]
AppName=Bat_Compress
AppVersion=1.0.0.0
CreateAppDir=No
OutputBaseFileName=Bat_Compress
OutputDir=.
SetupIconFile=Include\Icon.ico
Compression=none
AppCopyright=Rinaldo


[CustomMessages]
en.SelectMsg=Select Game to Compress
en.ResetBtn=Reset
en.CompBtn=Compress
en.FreeSpace=Free Space:

[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"

[Code ]
var
Lbl : array [1..6] of TLabel;
ResetBtn,CompressBtn: TButton;
FolderTreeView: TFolderTreeView;
CustomDirEdit, CustomOutputEdit: TNewEdit;
List: TStringList;
Drive,Dirs,BatFile: string;
res: Integer;
FreeMB, TotalMB: Cardinal;

procedure DirFolderChange(Sender: TObject);
Begin
CustomDirEdit.Text:=FolderTreeView.Directory;
end;

procedure ResetOnClick(Sender: TObject);
Begin
CustomDirEdit.Text:=ExpandConstant('{pf}\{#GameNam e}');
end;

procedure ConvertOnClick(Sender: TObject);
begin
wizardForm.Close;
Dirs:=WizardForm.DirEdit.Text;
BatFile:= ExpandConstant('{src}\Comp.bat');
List:= TStringList.Create;
List.Add('@echo off');
List.Add('arc a DVD\Data1.arc -mx "'+Dirs+'\*"');
List.Add('pause');
List.Add('del Comp.bat');
List.SaveToFile(BatFile);
List.Free;
Exec(BatFile, '', '', SW_SHOW, ewNoWait, Res);
end;

Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' MB' else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' GB' else
Result:= NumToStr(Float/(1024*1024))+' TB';
end;

procedure SpaceControls(Sender: TObject);
Begin
Drive:= ExtractFileDrive(CustomDirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
Lbl[5].Caption:=ExpandConstant('{cm:FreeSpace} ')+MbOrTb(FreeMB)+' ('+IntToStr(round(FreeMB*100/TotalMB))+'%)';
CompressBtn.Enabled:= (FreeMB>{#GameSize});
if (FreeMB>{#GameSize}) then begin
end else begin
CustomDirEdit.Enabled:=False;
FolderTreeView.Enabled:=False
end;
end;

procedure CW;
begin
WizardForm.Caption := ExpandConstant('Bat Creating Compress Tool');

Lbl[1] := TLabel.Create(WizardForm);
Lbl[1].Parent := WizardForm.WelcomePage;
Lbl[1].Alignment := taCenter;
Lbl[1].Caption := '{#GameName}';
Lbl[1].Font.Height := -14;
Lbl[1].Font.Name := 'Arial Black';
Lbl[1].SetBounds(0,0,480,23);

Lbl[2] := TLabel.Create(WizardForm);
Lbl[2].Parent := WizardForm.WelcomePage;
Lbl[2].Alignment := taCenter;
Lbl[2].Caption := '{#DvD}';
Lbl[2].Font.Height := -12;
Lbl[2].Font.Name := 'Arial Black';
Lbl[2].SetBounds(0,20,480,23);


Lbl[3] := TLabel.Create(WizardForm);
Lbl[3].Parent := WizardForm.WelcomePage;
Lbl[3].Caption := ExpandConstant('{cm:SelectMsg}:');
Lbl[3].Font.Size := 8;
Lbl[3].Font.Name:='Lucida Console'
Lbl[3].SetBounds(5,46,480,23);

Lbl[4] := TLabel.Create(WizardForm);
Lbl[4].Parent := WizardForm.WelcomePage;
Lbl[4].Font.Size := 8;
Lbl[4].Font.Name:='Lucida Console'
Lbl[4].SetBounds(8,280,480,23);

Lbl[5] := TLabel.Create(WizardForm);
Lbl[5].Parent := WizardForm.WelcomePage;
Lbl[5].Font.Size := 8;
Lbl[5].Font.Name:='Lucida Console';
Lbl[5].Font.Color:=$00FFFFFF;
Lbl[5].Font.Style := [fsBold];
Lbl[5].SetBounds(5,200,400,17);

CompressBtn := TButton.Create(WizardForm);
CompressBtn.Parent := WizardForm.WelcomePage;
CompressBtn.SetBounds(410,58,73,25);
CompressBtn.Caption := ExpandConstant('{cm:CompBtn}');
CompressBtn.OnClick := @ConvertOnClick;

ResetBtn := TButton.Create(WizardForm);
ResetBtn.Parent := WizardForm.WelcomePage;
ResetBtn.SetBounds(410,150,73,25);
ResetBtn.Caption := ExpandConstant('{cm:ResetBtn}');
ResetBtn.OnClick := @ResetOnClick;

CustomDirEdit := TNewEdit.Create(WizardForm);
CustomDirEdit.Parent := WizardForm.WelcomePage;
CustomDirEdit.Text:= ExpandConstant('{pf}\{#GameName}');
CustomDirEdit.SetBounds(5,60,400,20);


FolderTreeView := TFolderTreeView.Create(WizardForm);
FolderTreeView.Parent := WizardForm.WelcomePage;
FolderTreeView.SetBounds(5,90,400,100);
FolderTreeView.OnChange:= @DirFolderChange;

CustomOutputEdit := TNewEdit.Create(WizardForm);
CustomOutputEdit.Parent := WizardForm.WelcomePage;
CustomOutputEdit.Text:= ExpandConstant('{src}\{#GameName}');
CustomOutputEdit.SetBounds(5,124,400,21);
CustomOutputEdit.Hide;
end;

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

procedure InitializeWizard();
begin
WizardForm.WelcomePage.Color := $00FF9D41;
WizardForm.BorderStyle := bsSizeToolWin;
WizardForm.ClientHeight:=220;
WizardForm.CancelButton.Left:=9999;
WizardForm.NextButton.Left:=9999;
WizardForm.WizardBitmapImage.Visible:=False
WizardForm.WelcomeLabel1.Visible:=False;
WizardForm.WelcomeLabel2.Visible:=False;
CW();
CustomDirEdit.OnChange := @SpaceControls;
end;

gatosky1620
19-10-2015, 13:09
i need a scrip in which you can edit everything that has a compress.bat and automatically create such as:

1,2,3 disc name, etc.
Datax.cab to each disc
File .lst file to each Datax.cab
Compression method for each cab file

rinaldo
19-10-2015, 13:16
functions must be added manually .. I do not know how you want to compress and add ... create a .bat file, and then copy the functions in the lines of the list in .iss file



1)I do not know if this is the code you want
2)to add features just add code bat in List.Add ('');
3)This script creates a .bat file in src and then starts it and delete (option that can be removed)
4)you have to adapt the code, I do not know what you want to use as a code (each one in his own)
:):p

Razor12911
19-10-2015, 13:35
lol compress.bat maker, how lazy can you get?

rinaldo
19-10-2015, 13:39
lol compress.bat maker, how lazy can you get?

:p

pakrat2k2
19-10-2015, 14:59
lol compress.bat maker, how lazy can you get?

he just wants you guys to do everything for him. How hard is it to take one compress.bat & edit it :confused: ;)

y_thelastknight
19-10-2015, 15:11
he just wants you guys to do everything for him. How hard is it to take one compress.bat & edit it :confused: ;)

lol, helping others get me some experience. :p



[Setup]
AppName=Bat
AppVername=Bat
DefaultDirName={pf}\Bat
OutputDir=.

[code ]
var
List: TStringList; batfile: string; res: Integer;
CreateBatBtn:TButton;
NameEdit,ArcEdit,DataEdit:TNewEdit;
NameLabel,ArcLabel,DataLabel: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('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';

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';

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;

i think this is what gatosky1620 want. am i correct gatosky1620?

rinaldo
19-10-2015, 15:18
y_thelastknight so we never learn lol :D
you have to grow a child said to her puppy

gatosky1620
19-10-2015, 15:40
lol, helping others get me some experience. :p



[Setup]
AppName=Bat
AppVername=Bat
DefaultDirName={pf}\Bat
OutputDir=.

[code ]
var
List: TStringList; batfile: string; res: Integer;
CreateBatBtn:TButton;
NameEdit,ArcEdit,DataEdit:TNewEdit;
NameLabel,ArcLabel,DataLabel: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('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';

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';

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;

i think this is what gatosky1620 want. am i correct gatosky1620?


Can you add this lines to edit like a Setup.ini

Name of the compress.bat=Tranformers -3XDVD5
Creator=her1620
Default source= C:\Program Files(x86)\Tranformers
Set Source=D:\Juegos\Tranformers
Check Path=Bin32\Transformers.exe

Numbres of DVD5=5
Names of Folder=TRANSF_

Numbers and names of Data.cab in each folder

Data1.cab;DestDir:{FOLDER_1};[email protected];-msre
Data2.cab;DestDir:{FOLDER_1};[email protected]:[email protected];-msrep
Data3.cab;DestDir:{FOLDER_2};[email protected];-m0
Data4.cab;DestDir:{FOLDER_3};[email protected]:-msrep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8
Data5.cab;DestDir:{FOLDER_4};[email protected]:-msrep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8

rinaldo
19-10-2015, 16:01
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;

rinaldo
19-10-2015, 21:03
new idea combobox

[Setup]
AppName=BatMakerTest
AppVersion=1
CreateAppDir=no
OutputBaseFilename=BatMaker
OutputDir=.


[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"

[Code ]
procedure TestOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('', ExpandConstant('{src}\Compress_.bat'),
'', '', SW_SHOW, ewNoWait, ErrorCode);
end;

var
BatLog: String;
TestBtn,CreateBtn: TNewButton;
OptionBox,OptionBox2: TNewComboBox;
OPT,MTD,BreakL:string;

procedure OpBox1;
begin
OptionBox := TNewComboBox.Create(WizardForm);
OptionBox.Parent := WizardForm;
OptionBox.Left := 2;
OptionBox.Width := 290;
OptionBox.Top := 2;
OptionBox.Font.Name := 'Courier New';
//OptionBox.Text:='Option';
OptionBox.Items.Add('a -ep1 -r -ed -lc512 -ld512 -mt1');
end;

procedure OptBox2;
begin
OptionBox2 := TNewComboBox.Create(WizardForm);
OptionBox2.Parent := WizardForm;
OptionBox2.Left := 300;
OptionBox2.Width := 290;
OptionBox2.Top := 2;
OptionBox2.Font.Name := 'Courier New';
//OptionBox2.Text:='Method';
OptionBox2.Items.Add('-m0');
OptionBox2.Items.Add('-m1');
OptionBox2.Items.Add('-m2');
OptionBox2.Items.Add('-m3');
OptionBox2.Items.Add('-m4');
OptionBox2.Items.Add('-m5');
OptionBox2.Items.Add('-m6');
OptionBox2.Items.Add('-m7');
OptionBox2.Items.Add('-m8');
OptionBox2.Items.Add('-m9');
OptionBox2.Items.Add('-mx');
OptionBox2.Items.Add('-mlzma:a1:mfbt4:d158m:fb273:mc1000:lc8');
OptionBox2.Items.Add('-mlzma64:a1:mfbt4:d158m:fb273:mc1000:lc8');
OptionBox2.Items.Add('-mrep+delta+lzma:a1:mfbt4:d158m:fb273:mc1000:lc8');
OptionBox2.Items.Add('-mrep+delta+lzma64:a1:mfbt4:d158m:fb273:mc1000:lc8' );
OptionBox2.Items.Add('-msrep+delta+lzma:a1:mfbt4:d158m:fb273:mc1000:lc8') ;
OptionBox2.Items.Add('-msrep64+delta+lzma64:a1:mfbt4:d158m:fb273:mc1000:l c8');
OptionBox2.Items.Add('-mprecomp+srep+delta+lzma:a1:mfbt4:d158m:fb273:mc10 00:lc8');
OptionBox2.Items.Add('-mprecomp+srep64+delta+lzma64:a1:mfbt4:d158m:fb273: mc1000:lc8 ');
end;


procedure CreateBatOnClick(Sender: TObject);
begin
TestBtn.Visible:=true;
DeleteFile(BatLog);
BreakL:=#13#10
OPT:=OptionBox.Text
MTD:=OptionBox2.Text
SaveStringToFile(BatLog,'@echo off' + BreakL, True);
SaveStringToFile(BatLog,'echo.==========Hello Bro==========' + BreakL, True);
SaveStringToFile(BatLog,'echo.' + BreakL, True);
SaveStringToFile(BatLog,'echo. '+OPT + BreakL, True);
SaveStringToFile(BatLog,'echo. '+MTD + BreakL, True);
SaveStringToFile(BatLog,'pause' + BreakL, True);
end;

procedure InitializeWizard;
begin
OpBox1;
OptBox2;
WizardForm.AutoScroll := False;
WizardForm.ClientHeight := ScaleY(100);
WizardForm.ClientWidth := ScaleX(592);
WizardForm.Color := clMaroon;
WizardForm.Position:=poScreenCenter;
WizardForm.Caption:='LoL';
WizardForm.InnerNotebook.SetBounds(0,0,0,0);
WizardForm.OuterNotebook.SetBounds(0,0,0,0);
WizardForm.Bevel.Top:=220;
WizardForm.Bevel.Width:=999;

WizardForm.WizardBitmapImage.Visible := False;
WizardForm.WelcomeLabel2.Visible := False;
WizardForm.WelcomeLabel1.Visible := False;
WizardForm.CancelButton.SetBounds(0,0,0,0);
WizardForm.NextButton.SetBounds(0,0,0,0);
WizardForm.BackButton.SetBounds(0,0,0,0);

CreateBtn := TNewButton.Create(WizardForm);
CreateBtn.Parent := WizardForm;
CreateBtn.SetBounds(470,70,120,23);
CreateBtn.Font.Name := 'Courier New';
CreateBtn.Caption := 'C r e a t e';
CreateBtn.OnClick:=@CreateBatOnClick;

TestBtn := TNewButton.Create(WizardForm);
TestBtn.Parent := WizardForm;
TestBtn.SetBounds(350,70,120,23);
TestBtn.Caption := 'T e s t';
TestBtn.Font.Name := 'Courier New';
TestBtn.OnClick:=@TestOnClick;
TestBtn.Visible:=false;

BatLog := 'Compress_.bat';
DeleteFile(BatLog);
end;

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

ok ok STOP :D

gatosky1620
20-10-2015, 01:39
ORDERING IDEAS

One Scrip to create a .exe (Converter.exe), with a Converter.ini whit the next options:

Converter.ini
[Aplication]
Name=Transformes DVD9 To 2xDVD5
Path=C:\ProgramFiles\Activision\Transformers
Check=Bin\transformers.exe ///to check the right path
Version=1.0

[Files]
////Name;Folder;Include;Exclude;Method
File1=Data1.cab;TRANF_1;Data1.lst;;-msrep
File2=Data2.cab;TRANF_1;Data2.lst;Data2e.lst;-msrep
File3=Data3.cab;TRANF_2;Data3.lst;;-msrep+lzma:a1:mfbt4:d256m:fb128:mc1000:lc8

[Autorun]
///1=yes; 0=no
Autorun=1
Name=TRANSF_x ///Depends of the number Folder

[ISO]
///1=yes; 0=no
CreateISO=1

After compiling create the Converter.exe

http://i.imgbox.com/dgleneXD.png

http://i.imgbox.com/puhjJ0MR.png

Razor12911
20-10-2015, 04:59
I already created something similar to this.
fileforums.com/showthread.php?t=94435

rinaldo
20-10-2015, 05:21
I already created something similar to this.
fileforums.com/showthread.php?t=94435

http://fileforums.com/images/icons/icon14.gif
http://fileforums.com/images/icons/icon13.gif
http://fileforums.com/images/icons/icon14.gif