Автор: vint56
Дата сообщения: 29.08.2012 15:33
MOD_TEC вот пример
[more][Setup]
AppName=«Company of Heroes. Anthology»
AppVersion=1.5
DefaultDirName={pf}\Company of Heroes. Anthology
DefaultGroupName=Company of Heroes. Anthology
[Files]
Source: Files\botva2.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\b2p.dll; DestDir: {tmp}; Flags: dontcopy;
Source: Files\Edit.png; DestDir: {tmp}; Flags: dontcopy;
[Icons]
Name: "{group}\«Company of Heroes. Anthology»"; Filename: "{app}\MyProg.exe"
Name: "{group}\{cm:UninstallProgram,Ìîÿ ïðîãðàììà}"; Filename: "{uninstallexe}"
[Code]
var
Edit,GroupEdit: Longint;
DirEditLabel, GroupEditLabel: TLabel;
#include "Modules\botva2.iss"
function InitializeSetup:boolean;
begin
if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
Result:=True;
end;
procedure DirChange(Sender: TObject);
begin
DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
end;
procedure GroupChange(Sender: TObject);
begin
GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
end;
procedure InitializeWizard;
begin
Edit:=ImgLoad(WizardForm.SelectDirPage.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(0), ScaleY(81),ScaleX(332),ScaleY(22),True,True);
GroupEdit:=ImgLoad(WizardForm.SelectProgramGroupPage.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(0), ScaleY(81),ScaleX(332),ScaleY(22),True,True);
ImgApplyChanges(WizardForm.SelectDirPage.Handle);
ImgApplyChanges(WizardForm.SelectProgramGroupPage.Handle);
DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(5), ScaleY(85), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 9;
Font.Color:=$000000;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
Parent := WizardForm.SelectDirPage;
end;
GroupEditLabel := TLabel.Create(WizardForm);
with GroupEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(5), ScaleY(85), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 9;
Font.Color:=$000000;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
Parent := WizardForm.SelectProgramGroupPage;
end;
WizardForm.DirEdit.OnChange := @DirChange;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
WizardForm.GroupEdit.OnChange := @GroupChange;
end;
procedure HideComponents;
begin
WizardForm.DirEdit.Hide;
WizardForm.GroupEdit.Hide;
DirEditLabel.Hide;
GroupEditLabel.Hide;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
HideComponents;
case CurPageID of
wpSelectDir:
begin
DirEditLabel.Show;
end;
wpSelectProgramGroup:
GroupEditLabel.Show;
end;
end;
procedure DeinitializeSetup();
begin
gdipShutdown;
end;[/more]