[Setup]
AppName=My Program
AppVerName=My Program v1.0
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
DefaultUserInfoName={sysuserinfoname}
DefaultUserInfoOrg={sysuserinfoorg}
DefaultUserInfoSerial=1234-1234-1234-1234
UserInfoPage=true
LicenseFile=C:\Program Files\Inno Setup 5\license.txt
InfoBeforeFile=C:\Program Files\Inno Setup 5\license.txt
OutputDir=.
[Files]
Source: "C:\Program Files\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Components]
Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
Name: "help"; Description: "Help Files"; Types: full
Name: "help\english"; Description: "English"; Types: full
Name: "help\dutch"; Description: "Dutch"; Types: full
[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
Name: "{commondesktop}\My Program"; Filename: "{app}\MyProg.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\MyProg.exe"; Description: "{cm:LaunchProgram,My Program}"; Flags: nowait postinstall skipifsilent
[_Code]
var
Welcome, License, InfoBefore, UserInfo, Tasks, SelProgGroup, SelectDir,
Components, Ready: TButton;
CurPage: integer;
const
BM_CLICK= $00F5;
procedure ChangePage(Sender: TObject);
var i: integer;
begin
if Sender is TButton then
case TButton(Sender) of
Welcome: if CurPage > wpWelcome then begin
if CurPage = wpLicense then
SendMessage(WizardForm.BackButton.Handle,BM_CLICK,0,0)
else
for i:=CurPage-2 downto 1 do SendMessage(WizardForm.BackButton.Handle,BM_CLICK,0,0);
MsgBox('WelcomePage',mbInformation,0);
end;
License: if CurPage= wpLicense then EXIT else begin
if CurPage = 1 then
SendMessage(WizardForm.NextButton.Handle,BM_CLICK,0,0)
else
for i:=CurPage-2 downto 2 do SendMessage(WizardForm.BackButton.Handle,BM_CLICK,0,0);
MsgBox('LicensePage',mbInformation,0);
end;
InfoBefore: if CurPage= wpInfoBefore then EXIT else begin
if CurPage < wpInfoBefore then
for i:=CurPage+1 to 3 do SendMessage(WizardForm.NextButton.Handle,BM_CLICK,0,0)
else
for i:=CurPage-1 downto 4 do SendMessage(WizardForm.BackButton.Handle,BM_CLICK,0,0);
MsgBox('InfoBeforePage',mbInformation,0);
end;
UserInfo: MsgBox('UserInfoPage',mbInformation,0);
Tasks: MsgBox('SelectTasksPage',mbInformation,0);
SelProgGroup: MsgBox('SelectProgramGroupPage',mbInformation,0);
SelectDir: MsgBox('SelectDirPage',mbInformation,0);
Components: MsgBox('SelectComponentsPage',mbInformation,0);
Ready: MsgBox('ReadyPage',mbInformation,0);
end;
end;
procedure RedesignWizardForm;
begin
with WizardForm do
begin
AutoScroll := False;
ClientHeight := ScaleY(409);
end;
{ Welcome }
Welcome := TButton.Create(WizardForm);
with Welcome do
begin
Name := 'Welcome';
Parent := WizardForm;
Left := ScaleX(27);
Top := ScaleY(352);
Width := ScaleX(75);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ License }
License := TButton.Create(WizardForm);
with License do
begin
Name := 'License';
Parent := WizardForm;
Left := ScaleX(102);
Top := ScaleY(352);
Width := ScaleX(75);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ InfoBefore }
InfoBefore := TButton.Create(WizardForm);
with InfoBefore do
begin
Name := 'InfoBefore';
Parent := WizardForm;
Left := ScaleX(177);
Top := ScaleY(352);
Width := ScaleX(75);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ UserInfo }
UserInfo := TButton.Create(WizardForm);
with UserInfo do
begin
Name := 'UserInfo';
Parent := WizardForm;
Left := ScaleX(252);
Top := ScaleY(352);
Width := ScaleX(75);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ Tasks }
Tasks := TButton.Create(WizardForm);
with Tasks do
begin
Name := 'Tasks';
Parent := WizardForm;
Left := ScaleX(212);
Top := ScaleY(380);
Width := ScaleX(80);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ ProgramGroup }
SelProgGroup := TButton.Create(WizardForm);
with SelProgGroup do
begin
Name := 'ProgramGroup';
Parent := WizardForm;
Left := ScaleX(132);
Top := ScaleY(380);
Width := ScaleX(80);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ SelectDir }
SelectDir := TButton.Create(WizardForm);
with SelectDir do
begin
Name := 'SelectDir';
Parent := WizardForm;
Left := ScaleX(327);
Top := ScaleY(352);
Width := ScaleX(75);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ Components }
Components := TButton.Create(WizardForm);
with Components do
begin
Name := 'Components';
Parent := WizardForm;
Left := ScaleX(403);
Top := ScaleY(352);
Width := ScaleX(75);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
{ Ready }
Ready := TButton.Create(WizardForm);
with Ready do
begin
Name := 'Ready';
Parent := WizardForm;
Left := ScaleX(292);
Top := ScaleY(380);
Width := ScaleX(80);
Height := ScaleY(25);
OnClick:= @ChangePage;
end;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
CurPage:= CurPageID;
if CurPageID= wpLicense then SendMessage(WizardForm.LicenseAcceptedRadio.Handle,BM_CLICK,0,0);
end;