1. 选择安装界面上的图片
[Setup]
;设置界面上的两个图片
WizardImageFile=WizModernImage.bmp
WizardSmallImageFile=WizSmallImage.bmp
2. 设置安装界面上的文字
[Messages]
;设置开始界面
WelcomeLabel1=%n欢迎安装 MyProgram开发系统
WelcomeLabel2=%n集MyProgram于一体的开发平台%n%n-单机版:用于开发MyProgram功能平台%n%n-网络版:用于开发MyProgram功能平台%n%n%n%n%n
;设置许可证协议界面
WizardLicense=许可证协议
LicenseLabel=在安装“MyProgram开发系统”之前,请阅读%n授权协议
;设置安装路径选择界面
WizardSelectDir=选择安装位置
SelectDirDesc=选择“MyProgram开发系统”的安装文件夹
SelectDirLabel3=-安装程序将安装 MyProgram开发系统 到下列文件夹%n%n-要安装到其他文件夹,单机[浏览(b)...]按钮并选择其他文件夹%n%n-点击[< 返回(B)]按钮返回上一个界面%n%n-选择[继续(N) >]按钮继续安装 MyProgram开发系统%n%n-选择[取消]按钮退出 MyProgram开发系统 安装
SelectDirBrowseLabel=
DiskSpaceMBLabel=
;设置组件安装界面
WizardSelectComponents=选择组件
SelectComponentsDesc=选择您想要安装的 MyProgram开发系统 的组件
SelectComponentsLabel2=请选择您要安装的组件,清除您不想安装的组件。%n点击[继续(N) >]按钮继续。
;设置准备安装界面
WizardReady=准备安装
ReadyLabel1=安装程序将安装 MyProgram开发系统
3. 设置安装界面上的组件
[Types] ;设置组件的两种状态,完全安装与用户自定义安装 Name: "custom"; Description: "用户自定义安装"; Flags: iscustom Name: "full"; Description: "完全安装" [Components] ;默认为选择状态 Name: "demo1"; Description: "demo1"; Types: full custom; Flags: fixed; ;默认为不选择状态,完全安装时为选择状态 Name: "demo2"; Description: "demo2"; Types: full; ;默认为不选择状态 Name: "demo3"; Description: "demo3"; Types: full;
4. 设置安装界面右上角图片大小及位置
[Code]
Var
PageName, PageDescription: TLabel;
{设置安装界面右上角图片大小及位置}
procedure InitializeWizard();
begin
{WizardForm.WizardSmallBitmapImage.width := 100;
WizardForm.WizardSmallBitmapImage.left := WizardForm.width - 100;
WizardForm.WizardSmallBitmapImage.height := 50;
WizardForm.PAGENAMELABEL.width:=100;
WizardForm.PAGEDESCRIPTIONLABEL.width:=200;}
PageName := TLabel.Create(WizardForm.MainPanel);
PageName.Parent := WizardForm.MainPanel;
PageName.Top := WizardForm.PageNameLabel.Top;
PageName.Left := WizardForm.PageNameLabel.Left;
PageName.Width := WizardForm.PageNameLabel.Width;
PageName.Height := WizardForm.PageNameLabel.Height;
PageName.Font := WizardForm.PageNameLabel.Font;
PageName.Transparent := true;
PageName.Font.Color:=clblack;
PageDescription := TLabel.Create(WizardForm.MainPanel);
PageDescription.Parent := WizardForm.MainPanel;
PageDescription.Top := WizardForm.PageDescriptionLabel.Top;
PageDescription.Left := WizardForm.PageDescriptionLabel.Left;
PageDescription.Width := WizardForm.PageDescriptionLabel.Width;
PageDescription.Height := WizardForm.PageDescriptionLabel.Height;
PageDescription.Font := WizardForm.PageDescriptionLabel.Font;
PageDescription.Transparent := true;
PageDescription.Font.Color:=clblack;
WizardForm.WizardSmallBitmapImage.Top := ScaleY(0);
WizardForm.WizardSmallBitmapImage.Left := ScaleX(0);
WizardForm.WizardSmallBitmapImage.Width := WizardForm.MainPanel.Width;
WizardForm.WizardSmallBitmapImage.Height := WizardForm.MainPanel.Height;
WizardForm.PageNameLabel.Visible := false;
WizardForm.PageDescriptionLabel.Visible := false;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
PageName.Caption := WizardForm.PageNameLabel.Caption;
PageDescription.Caption := WizardForm.PageDescriptionLabel.Caption;
PageDescription.width:=300;
end;
5. 定义[Message]段颜色
[code]
procedure InitializeWizard();
begin
WizardForm.BeveledLabel.Enabled:= True;
WizardForm.BeveledLabel.Font.Color:= clblue;
end;
6. 安装、卸载时判断是否程序正在运行,卸载完成时自动打开网页
8. 添加“关于”和网站链接按钮
在脚本编译里的[Code]与[Files]段处添加以下代码:
Function mciSendString(lpszCommand: String; lpszReturnString: Integer;cchReturnLength: Integer; hwndCallback: Integer): Integer;
external 'mciSendStringA@winmm.dll stdcall';
procedure InitializeWizard();
var
BGMusicFile, SplashFile: string;
SplashForm: TForm;
SplashFileName: String;
I: Integer;
begin
ExtractTemporaryFile(ExtractFileName(ExpandConstant('{tmp}\music.mp3')));
SplashForm := TForm.create(nil);
with SplashForm do
begin
mciSendString(ExpandConstant('play {tmp}\music.mp3'),0,0,0);
Close;
Free;
end;
end;
[Files]
Source: "C:\music.mp3"; Flags: dontcopy
或者
Source: "C:\mymusic.mp3";DestDir: "{tmp}"; Flags: dontcopy
代码说明:[Code]中蓝色代码{tmp}与\music.mp3的意思是播放inno setup安装时创建的临时文件夹内的music.mp3音乐文件! [Files]中C:\music.mp3是你音乐源文件的地址,填自己的音频名称与音频格式。Flags: dontcopy 的意思是在安装时将音乐文件放到Inno Setup所创建的临时文件夹内,并且在完成安装后删除此音乐文件
10. 关于Inno Setup安装欢迎界面文字与安装向导文字颜色修改
procedure InitializeWizard();
begin
//改变欢迎页面文字的颜色 (如图)
WizardForm.WelcomeLabel1.Font.Color:= clNavy;
WizardForm.WelcomeLabel2.Font.Color:= clTeal;
end;