Serega0675 Если не трудо, можете дополнить [more=этот][Setup]
AppName=Lost Planet Colonies
AppVerName=Lost Planet Colonies
DefaultDirName=D:\Games\Lost Planet Colonies
OutputBaseFilename=Setup
Compression=lzma/ultra64
SolidCompression=yes
DiskSpanning=true
SlicesPerDisk=3
DiskSliceSize=1100000000
InternalCompressLevel=ultra64
OutputDir=D:\test\lp_ce
WizardImageFile=D:\test\lp.bmp
WizardSmallImageFile=D:\test\lp_small.bmp
DisableProgramGroupPage=true
DefaultGroupName=Lost Planet Colonies
VersionInfoVersion=1.0.0.0
DirExistsWarning=no
DisableReadyPage=true
AppVersion=1.0.0.0
UninstallDisplayName=Lost Planet Colonies
[Languages]
Name: rus; MessagesFile: compiler:\Languages\Russian.isl
[LangOptions]
WelcomeFontSize=10
[Icons]
Name: "{group}\Lost Planet Colonies"; Filename: "{app}\LPCLauncher.exe"; WorkingDir: "{app}";
Name: "{group}\Удалить игру"; Filename: "{uninstallexe}";
Name: "{userdesktop}\Lost Planet Colonies"; Filename: "{app}\LPCLauncher.exe"; WorkingDir: "{app}";
[Files]
Source:"D:\test\logo.bmp";DestDir:{tmp};Flags: dontcopy nocompression solidbreak
Source: "D:\Games\Lost Planet Colonies\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs sortfilesbyextension
Source: D:\test\NOCOMP\ZZPack1.exe; DestDir: {app}; AfterInstall: Arc1; Flags: ignoreversion createallsubdirs recursesubdirs nocompression
Код: //////////////
var
PageNameLabel, PageDescriptionLabel: TLabel;
DesktopIcon: TCheckBox;
LogoImage:TBitmapImage;
LogoPanel: TPanel;
LogoLabel: TLabel;
const
NeedSize = 7760;
var
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel, FreeSpaceLabel: TLabel;
ExtractFile:TNewStaticText;
/////////
function MakeDesktopIcon: Boolean;
begin
Result:=DesktopIcon.Checked;
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption := 'Доступно место на диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else
FreeSpaceLabel.Caption := 'Доступно место на диске: ' + IntToStr(FreeMB)+ ' MB';
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := false
else
WizardForm.NextButton.Enabled := true;
end;
//////////
procedure LogoLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://kirovmedia.ru/forum', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
TimerID: LongWord;
pfunc: LongWord;
Label1:tlabel;
procedure InitializeWizard();
var
WLabel1, WLabel2: TLabel;
FLabel1, FLabel2: TLabel;
begin
DesktopIcon := TCheckBox.Create(WizardForm);
DesktopIcon.Parent := WizardForm.SelectDirPage;
DesktopIcon.Caption := 'Добавить ярлык на рабочий стол';
DesktopIcon.Left := ScaleX(0);
DesktopIcon.Top := ScaleY(WizardForm.DirEdit.Top + 35);
DesktopIcon.Width := ScaleX(400);
DesktopIcon.Height := ScaleY(15);
DesktopIcon.TabOrder := 0;
DesktopIcon.Checked := True;
////////////
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(53);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clblack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := 'Программа установлена на Ваш компьютер.' #13#13
'Нажмите «Завершить», чтобы выйти из программы установки.';
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.WizardBitmapImage.Width := WizardForm.Width;
WizardForm.WizardBitmapImage.Height := WizardForm.Height;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(54);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clblack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2:=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Color:= clblack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
WizardForm.WizardBitmapImage2.Height := WizardForm.Height;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clblack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := WizardForm.Width;
WizardForm.WizardBitmapImage.Height := WizardForm.Height;
WLabel1 := TLabel.Create(WizardForm);
WLabel1.Left := ScaleX(176);
WLabel1.Top := ScaleY(16);
WLabel1.Width := ScaleX(301);
WLabel1.Height := ScaleY(100);
WLabel1.AutoSize := False;
WLabel1.WordWrap := True;
WLabel1.Font.Size := 12;
WLabel1.Font.Style := [fsBold];
WLabel1.Font.Color:= clblack;
WLabel1.ShowAccelChar := False;
WLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WLabel1.Transparent := True;
WLabel1.Parent := WizardForm.WelcomePage;
WLabel2 :=TLabel.Create(WizardForm);
WLabel2.Top := ScaleY(76);
WLabel2.Left := ScaleX(176);
WLabel2.Width := ScaleX(301);
WLabel2.Height := ScaleY(234);
WLabel2.AutoSize := False;
WLabel2.WordWrap := True;
WLabel2.Font.Color:= clblack;
WLabel2.ShowAccelChar := False;
WLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
WLabel2.Transparent := True;
WLabel2.Parent := WizardForm.WelcomePage;
WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
WizardForm.WizardBitmapImage2.Height := WizardForm.Height;
FLabel1 := TLabel.Create(WizardForm);
FLabel1.Left := ScaleX(176);
FLabel1.Top := ScaleY(16);
FLabel1.Width := ScaleX(301);
FLabel1.Height := ScaleY(54);
FLabel1.AutoSize := False;
FLabel1.WordWrap := True;
FLabel1.Font.Size := 12;
FLabel1.Font.Style := [fsBold];
FLabel1.Font.Color:= clblack;
FLabel1.ShowAccelChar := False;
FLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
FLabel1.Transparent := True;
FLabel1.Parent := WizardForm.FinishedPage;
FLabel2 :=TLabel.Create(WizardForm);
FLabel2.Top := ScaleY(76);
FLabel2.Left := ScaleX(176);
FLabel2.Width := ScaleX(301);
FLabel2.Height := ScaleY(77);
FLabel2.AutoSize := False;
FLabel2.WordWrap := True;
FLabel2.Font.Color:= clblack;
FLabel2.ShowAccelChar := False;
FLabel2.Caption := 'Программа установлена на Ваш компьютер.' #13#13
'Нажмите «Завершить», чтобы выйти из программы установки.';
FLabel2.Transparent := True;
FLabel2.Parent := WizardForm.FinishedPage;
end;
//////////
////////
begin
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(198);
Width := ScaleX(209);
Height := ScaleY(13);
Caption := 'Требуется место на диске: 7,57 GB' ;
end;
////////////
begin
begin
WizardForm.WizardSmallBitmapImage.Left:=0;
WizardForm.WizardSmallBitmapImage.Width:=497;
WizardForm.WizardSmallBitmapImage.Height:=58;
WizardForm.PageDescriptionLabel.Width:=300;
WizardForm.PageNameLabel.Width:=300;
end ;
begin
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(45);
Top := ScaleY(10);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color := clwhite;
Font.Style := [fsBold];
Transparent := True;
Parent := WizardForm.MainPanel;
end;
PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(45);
Top := ScaleY(25);
Width := ScaleX(475);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clwhite;
Transparent := True;
Parent := WizardForm.MainPanel;
end;
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
end;
end;
////////////IntToStr(NeedSize) + ' GB'
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(216);
Width := ScaleX(209);
Height := ScaleY(13);
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;
/////////////////
begin
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(8);
Top := ScaleY(327);
Width := ScaleX(120);
Height := ScaleY(28);
BevelOuter := bvNone;
end;
LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
ExtractTemporaryFile('logo.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
end;
LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoLabelOnClick;
end;
end;
end;
procedure Arc1;
var
res:Integer;
s,s1:string;
begin
s:=ExpandConstant('{app}')+'\ZZPack1.exe';
s1:=ExpandConstant('{app}\Papka\');
Exec(s, '-x -y -dp"'+ s1 + '"', '', SW_SHOWNORMAL, ewWaitUntilTerminated, res);
DeleteFile(ExpandConstant('{app}\ZZPack1.exe'));
end;
///procedure animateprogress;
///begin ProgressBar1.Position := ProgressBar1.Position+1
///end;
///ProgressBar1 := TNewProgressBar.Create(wizardform);
////with ProgressBar1 do
////begin
////Parent := wizardform.installingpage;
////Left := wizardform.progressgauge.left;
////Top := wizardform.progressgauge.top+wizardform.progressgauge.height+15;
///Width := wizardform.progressgauge.width;
///Height := wizardform.progressgauge.height;
///Max :=11; //задается как кол-во файлов в [_run]
///end;
procedure CurPageChanged(CurPageID: Integer);
begin
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
if CurPageID = wpSelectDir
then begin
WizardForm.NextButton.Caption:='Установить';
if FreeMB < NeedSize
then WizardForm.NextButton.Enabled:=False;
end;
end;
[/more] код, [more=этими][Setup]
[Run]
Filename: "{app}\ZZPack1.exe"; WorkingDir: "{app}"; Parameters: "-x -y -s2 -d."; StatusMsg: "Èäåò ðàñïàêîâêà äàííûõ, ïîäîæäèòå ïîæàëóéñòà..."; Flags: runminimized runasoriginaluser
Filename: "cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del /F /Q ZZPack1.exe"; Flags: runhidden runasoriginaluser
Filename: "{app}\ZZPack1_2.exe"; WorkingDir: "{app}"; Parameters: "-x -y -s2 -d."; StatusMsg: "Èäåò ðàñïàêîâêà äàííûõ, ïîäîæäèòå ïîæàëóéñòà..."; Flags: runminimized runasoriginaluser
Filename: "cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del /F /Q ZZPack1_2.exe"; Flags: runhidden runasoriginaluser
Filename: "{app}\ZZPack2.exe"; WorkingDir: "{app}"; Parameters: "-x -y -s2 -d."; StatusMsg: "Èäåò ðàñïàêîâêà äàííûõ, ïîäîæäèòå ïîæàëóéñòà..."; Flags: runminimized runasoriginaluser
Filename: "cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del /F /Q ZZPack2.exe"; Flags: runhidden runasoriginaluser
Filename: "{app}\ZZPack2_2.exe"; WorkingDir: "{app}"; Parameters: "-x -y -s2 -d."; StatusMsg: "Èäåò ðàñïàêîâêà äàííûõ, ïîäîæäèòå ïîæàëóéñòà..."; Flags: runminimized runasoriginaluser
Filename: "cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del /F /Q ZZPack2_2.exe"; Flags: runhidden runasoriginaluser
[/more] файлами, для секции [Code]. Как это должно быть. Исходя из вашего [more=примера][code]
// зачем в каждой процедуре это писать, вы их вынесите в общий var, в начале секции [Code]
...........................
var
res:Integer;
s:string;
................................
procedure Arc1.1;
begin
s:=ExpandConstant('{app}')+'\ZZPack1.1.exe';
Exec(s, '-x -y -d' + 'nativePC\', '', SW_SHOWNORMAL, ewWaitUntilTerminated, res);
DeleteFile(ExpandConstant('{app}\ZZPack1.1.exe'));
ExtractFile.Caption := 'Идёт распаковка данных, пожалуйста подождите';
WizardForm.ProgressGauge.Position:= WizardForm.ProgressGauge.Position + 1;
// Application.ProcessMessages; // необходима расширенная версия от Restools
end;
procedure Arc1.2;
begin
s:=ExpandConstant('{app}')+'\ZZPack1.2.exe';
Exec(s, '-x -y -d' + 'nativePC\', '', SW_SHOWNORMAL, ewWaitUntilTerminated, res);
DeleteFile(ExpandConstant('{app}\ZZPack1.2.exe'));
ExtractFile.Caption := 'Идёт распаковка данных, пожалуйста подождите';
WizardForm.ProgressGauge.Position:= WizardForm.ProgressGauge.Position + 1;
// Application.ProcessMessages; // необходима расширенная версия от Restools
end;
// и так далее