читать дальше »
; Script generated by the Ìàñòåð Inno Setup Script.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{B8A23CB6-D773-43C6-8D08-11ADDB1095D5}
AppName=My Program
AppVersion=1.5
;AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=C:\Users\Striker\Desktop
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
WizardImageFile=D:\1.bmp
[code]
var
pnl: TPanel;
///////////////////////WelcomePage//////////////////////////////////////
procedure WelcomePage;
begin
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.WelcomeLabel1.AutoSize;
SetBounds(WizardForm.WelcomeLabel1.Left,WizardForm.WelcomeLabel1.Top,
WizardForm.WelcomeLabel1.Width,WizardForm.WelcomeLabel1.Height);
WordWrap:= WizardForm.WelcomeLabel1.WordWrap;
Caption:= WizardForm.WelcomeLabel1.Caption;
with Font do
begin
Color:= WizardForm.WelcomeLabel1.Font.Color;
Style:= WizardForm.WelcomeLabel1.Font.Style;
Name:= WizardForm.WelcomeLabel1.Font.Name;
Size:= WizardForm.WelcomeLabel1.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.WelcomeLabel2.AutoSize;
SetBounds(WizardForm.WelcomeLabel2.Left,WizardForm.WelcomeLabel2.Top,
WizardForm.WelcomeLabel2.Width,WizardForm.WelcomeLabel2.Height);
WordWrap:= WizardForm.WelcomeLabel2.WordWrap;
Caption:= WizardForm.WelcomeLabel2.Caption;
with Font do
begin
Color:= WizardForm.WelcomeLabel2.Font.Color;
Style:= WizardForm.WelcomeLabel2.Font.Style;
Name:= WizardForm.WelcomeLabel2.Font.Name;
Size:= WizardForm.WelcomeLabel2.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
pnl.Repaint;
end;
/////////////////////////////////////////////////////////////////
///////////////////////SelectDirPage//////////////////////////////////////
procedure SelectDirPage;
begin
with WizardForm do
begin
with DirEdit do
begin
Left:= 40;
Top:= 137;
Parent:= pnl;
end;
with DirBrowseButton do
begin
Left:= WizardForm.DirEdit.Left + WizardForm.DirEdit.Width + 10;
Top:= WizardForm.DirEdit.Top - 1;
Parent:= pnl;
end;
with SelectDirBitmapImage do
begin
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top - 62;
Stretch:= True;
Parent:= pnl;
end;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.SelectDirBrowseLabel.AutoSize;
SetBounds(WizardForm.DirEdit.Left,WizardForm.DirEdit.Top - 30,
WizardForm.SelectDirBrowseLabel.Width, WizardForm.SelectDirBrowseLabel.Height);
WordWrap:= WizardForm.SelectDirBrowseLabel.WordWrap;
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
with Font do
begin
Color:= WizardForm.SelectDirBrowseLabel.Font.Color;
Style:= WizardForm.SelectDirBrowseLabel.Font.Style;
Name:= WizardForm.SelectDirBrowseLabel.Font.Name;
Size:= WizardForm.SelectDirBrowseLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.SelectDirLabel.AutoSize;
SetBounds(WizardForm.SelectDirBitmapImage.Left + 50,WizardForm.SelectDirBitmapImage.Top + 10,
WizardForm.SelectDirLabel.Width,WizardForm.SelectDirLabel.Height);
WordWrap:= WizardForm.SelectDirLabel.WordWrap;
Caption:= WizardForm.SelectDirLabel.Caption;
with Font do
begin
Color:= WizardForm.SelectDirLabel.Font.Color;
Style:= WizardForm.SelectDirLabel.Font.Style;
Name:= WizardForm.SelectDirLabel.Font.Name;
Size:= WizardForm.SelectDirLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.DiskSpaceLabel.AutoSize;
SetBounds(WizardForm.DirEdit.Left,WizardForm.Bevel.Top - 25,
WizardForm.DiskSpaceLabel.Width,WizardForm.DiskSpaceLabel.Height);
WordWrap:= WizardForm.DiskSpaceLabel.WordWrap;
Caption:= WizardForm.DiskSpaceLabel.Caption;
with Font do
begin
Color:= WizardForm.DiskSpaceLabel.Font.Color;
Style:= WizardForm.DiskSpaceLabel.Font.Style;
Name:= WizardForm.DiskSpaceLabel.Font.Name;
Size:= WizardForm.DiskSpaceLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
pnl.Repaint;
end;
/////////////////////////////////////////////////////////////////
///////////////////////ReadyPage//////////////////////////////////////
procedure ReadyPage;
var
ready_str: string;
begin
ready_str:= WizardForm.ReadyMemo.Text;
with TLabel.Create(pnl) do
begin
SetBounds(45,115,WizardForm.ReadyMemo.Width, WizardForm.ReadyMemo.Height);
Caption:= ready_str;
with Font do
begin
Color:= WizardForm.ReadyLabel.Font.Color;
Style:= WizardForm.ReadyLabel.Font.Style;
Name:= WizardForm.ReadyLabel.Font.Name;
Size:= WizardForm.ReadyLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TBevel.Create(WizardForm) do
begin
SetBounds(40,110, WizardForm.ReadyMemo.Width, WizardForm.ReadyMemo.Height);
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.ReadyLabel.AutoSize;
SetBounds(40,70, WizardForm.ReadyLabel.Width, WizardForm.ReadyLabel.Height);
WordWrap:= WizardForm.ReadyLabel.WordWrap;
Caption:= WizardForm.ReadyLabel.Caption;
with Font do
begin
Color:= WizardForm.ReadyLabel.Font.Color;
Style:= WizardForm.ReadyLabel.Font.Style;
Name:= WizardForm.ReadyLabel.Font.Name;
Size:= WizardForm.ReadyLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
pnl.Repaint;
end;
/////////////////////////////////////////////////////////////////
///////////////////////InstallingPage//////////////////////////////////////
procedure InstallingPage;
begin
with WizardForm.ProgressGauge do
begin
Left:= 40;
Top:= 115;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.FilenameLabel.AutoSize;
SetBounds(WizardForm.ProgressGauge.Left,WizardForm.ProgressGauge.Top-20,
WizardForm.FilenameLabel.Width,WizardForm.FilenameLabel.Height);
WordWrap:= WizardForm.FilenameLabel.WordWrap;
Caption:= WizardForm.FilenameLabel.Caption;
with Font do
begin
Color:= WizardForm.FilenameLabel.Font.Color;
Style:= WizardForm.FilenameLabel.Font.Style;
Name:= WizardForm.FilenameLabel.Font.Name;
Size:= WizardForm.FilenameLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.StatusLabel.AutoSize;
SetBounds(WizardForm.StatusLabel.Left,WizardForm.StatusLabel.Top,
WizardForm.StatusLabel.Width,WizardForm.StatusLabel.Height);
WordWrap:= WizardForm.StatusLabel.WordWrap;
Caption:= WizardForm.StatusLabel.Caption;
with Font do
begin
Color:= WizardForm.StatusLabel.Font.Color;
Style:= WizardForm.StatusLabel.Font.Style;
Name:= WizardForm.StatusLabel.Font.Name;
Size:= WizardForm.StatusLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
pnl.Repaint;
end;
/////////////////////////////////////////////////////////////////
///////////////////////FinishedPage//////////////////////////////////////
var
CheckBox: array of TNewCheckBox;
procedure CheckBoxClick(Sender: TObject);
begin
if TNewCheckBox(Sender).Checked then
WizardForm.RunList.Checked[TNewCheckBox(Sender).Tag]:= True
else WizardForm.RunList.Checked[TNewCheckBox(Sender).Tag]:= False;
end;
procedure LabelClick(Sender: TObject);
begin
if CheckBox[TLabel(Sender).Tag].Checked then
begin
WizardForm.RunList.Checked[TLabel(Sender).Tag]:= False;
CheckBox[TLabel(Sender).Tag].Checked:= False;
end
else
begin
WizardForm.RunList.Checked[TLabel(Sender).Tag]:= True;
CheckBox[TLabel(Sender).Tag].Checked:= True;
end;
end;
procedure HideRunList(Control: TWinControl);
var
i, t: Integer;
str: string;
begin
if WizardForm.RunList.Items.Count > 0 then
begin
WizardForm.RunList.Hide;
SetArrayLength(CheckBox, SizeOf(WizardForm.RunList.Items.Count));
for i:= 0 to WizardForm.RunList.Items.Count-1 do
begin
CheckBox[i]:= TNewCheckBox.Create(Control);
with CheckBox[i] do
begin
SetBounds(ScaleX(WizardForm.RunList.Left+2),ScaleY(WizardForm.RunList.Top+2+t),14,14);
Tag:= i;
Checked:= WizardForm.RunList.Checked[i];
Caption:= WizardForm.RunList.Items.Strings[i];
OnClick:= @CheckBoxClick;
Color:= clWhite;
Parent:= Control;
end;
str:= WizardForm.RunList.Items.Strings[i];
with TLabel.Create(WizardForm) do
begin
SetBounds(ScaleX(WizardForm.RunList.Left+20),ScaleY(WizardForm.RunList.Top+2+t),
WizardForm.RunList.Width,14);
Caption:= str;
Tag:= i;
OnClick:= @LabelClick;
Transparent:= True;
Parent:= Control;
end;
t:= t + 20;
end;
end;
end;
procedure FinishedPage;
begin
HideRunList(pnl);
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.FinishedHeadingLabel.AutoSize;
SetBounds(WizardForm.FinishedHeadingLabel.Left,WizardForm.FinishedHeadingLabel.Top,
WizardForm.FinishedHeadingLabel.Width,WizardForm.FinishedHeadingLabel.Height);
WordWrap:= WizardForm.FinishedHeadingLabel.WordWrap;
Caption:= WizardForm.FinishedHeadingLabel.Caption;
with Font do
begin
Color:= WizardForm.FinishedHeadingLabel.Font.Color;
Style:= WizardForm.FinishedHeadingLabel.Font.Style;
Name:= WizardForm.FinishedHeadingLabel.Font.Name;
Size:= WizardForm.FinishedHeadingLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.FinishedLabel.AutoSize;
SetBounds(WizardForm.FinishedLabel.Left,WizardForm.FinishedLabel.Top,
WizardForm.FinishedLabel.Width,WizardForm.FinishedLabel.Height);
WordWrap:= WizardForm.FinishedLabel.WordWrap;
Caption:= WizardForm.FinishedLabel.Caption;
with Font do
begin
Color:= WizardForm.FinishedLabel.Font.Color;
Style:= WizardForm.FinishedLabel.Font.Style;
Name:= WizardForm.FinishedLabel.Font.Name;
Size:= WizardForm.FinishedLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
pnl.Repaint;
end;
/////////////////////////////////////////////////////////////////
procedure CurPageChanged(CurPageID: Integer);
begin
pnl:= TPanel.Create(WizardForm);
with pnl do
begin
Align:= alClient;
Parent:= WizardForm;
end;
with WizardForm do
begin
with WizardBitmapImage do
begin
Align:= alClient;
Stretch:= True;
Parent:= pnl;
end;
NextButton.Parent:= pnl;
CancelButton.Parent:= pnl;
BackButton.Parent:= pnl;
Bevel.Parent:= pnl;
pnl.Repaint;
end;
if (CurPageID > wpWelcome) and (CurPageID < wpFinished) then
begin
WizardForm.Bevel1.Parent:= pnl;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.PageNameLabel.AutoSize;
SetBounds(WizardForm.PageNameLabel.Left,WizardForm.PageNameLabel.Top,
WizardForm.PageNameLabel.Width,WizardForm.PageNameLabel.Height);
Caption:= WizardForm.PageNameLabel.Caption;
with Font do
begin
Color:= WizardForm.PageNameLabel.Font.Color;
Style:= WizardForm.PageNameLabel.Font.Style;
Name:= WizardForm.PageNameLabel.Font.Name;
Size:= WizardForm.PageNameLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
with TLabel.Create(pnl) do
begin
AutoSize:= WizardForm.PageDescriptionLabel.AutoSize;
SetBounds(WizardForm.PageDescriptionLabel.Left,WizardForm.PageDescriptionLabel.Top,
WizardForm.PageDescriptionLabel.Width,WizardForm.PageDescriptionLabel.Height);
Caption:= WizardForm.PageDescriptionLabel.Caption;
with Font do
begin
Color:= WizardForm.PageDescriptionLabel.Font.Color;
Style:= WizardForm.PageDescriptionLabel.Font.Style;
Name:= WizardForm.PageDescriptionLabel.Font.Name;
Size:= WizardForm.PageDescriptionLabel.Font.Size;
end;
Transparent:= True;
Parent:= pnl;
end;
pnl.Repaint;
end;
if CurPageID = wpWelcome then WelcomePage;
if CurPageID = wpSelectDir then SelectDirPage;
if CurPageID = wpReady then ReadyPage;
if CurPageID = wpInstalling then InstallingPage;
if CurPageID = wpFinished then FinishedPage;
end;
[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy
; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: skin.cjstyles; DestDir: {tmp}; Flags: dontcopy
[code]
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';
// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall';
// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('skin.cjstyles');
LoadSkin(ExpandConstant('{tmp}\skin.cjstyles'), '');
Result := True;
end;
procedure DeinitializeSetup();
begin
// Hide Window before unloading skin so user does not get
// a glimpse of an unskinned window before it is closed.
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
end;
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\Programs\Setup\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[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
[Files]
Source: "isgsg.dll"; DestDir: {tmp}; Flags: dontcopy nocompression
Source: "splash.png"; DestDir: {tmp}; Flags: dontcopy nocompression
[code]
procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
procedure InitializeWizard();
begin
WizardForm.PageNameLabel.Font.Color:=clgreen;
WizardForm.LicenseAcceptedRadio.Font.Color:=clwhite;
WizardForm.LicenseNotAcceptedRadio.Font.Color:=clwhite;
WizardForm.Font.Color:=clwhite;
ExtractTemporaryFile('splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);
end;