Автор: Qarma
Дата сообщения: 15.04.2009 20:29
doombuster
Мой скрипт...
[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
[Run]
Filename: "{app}\ZZPack1.exe"; WorkingDir: "{app}"; Parameters: "-x -y ""{app}\nativePC"" -s2 -d."; StatusMsg: "Èäåò ðàñïàêîâêà äàííûõ, ïîäîæäèòå ïîæàëóéñòà...";
Filename: "cmd.exe"; WorkingDir: "{app}"; Parameters: "/C del /F /Q ZZPack1.exe"; Flags: runhidden runasoriginaluser
[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\*"; DestDir: "{app}"; Flags: ignoreversion createallsubdirs recursesubdirs nocompression
[Code]
//////////////
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 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]