Inno Setup技巧[实例]添加自定义页面
原文 http://hi.baidu.com/watashi/item/b3dda993459ff8f0291647a0
通过“添加自定义页面”可以丰富安装程序的功能。本文以添加一个页面“选择安装类型”为例,选择标准安装将跳过“选择目标位置”和“选择开始菜单文件夹”两个页面。
在[Code]段添加以下代码:

var
Page: TWizardPage; RadioButton1, RadioButton2: TRadioButton;
Lbl1, Lbl2: TNewStaticText; procedure CreateAddonPage;
begin
Page := CreateCustomPage(wpInfoBefore, '选择安装类型', '请根据您的需要选择安装的类型'); RadioButton1 := TRadioButton.Create(Page);
RadioButton1.Left := ScaleX();
RadioButton1.Top := ScaleY();
RadioButton1.Width := Page.SurfaceWidth;
RadioButton1.Height := ScaleY();
RadioButton1.Caption := '标准安装';
RadioButton1.Checked := True;
RadioButton1.Parent := Page.Surface; Lbl1 := TNewStaticText.Create(Page);
Lbl1.Left := ScaleX();
Lbl1.Top := ScaleY();
Lbl1.Width := ScaleX();
Lbl1.Height := ScaleY();
Lbl1.Caption := '按照标准模式安装软件到您的电脑';
Lbl1.Parent := Page.Surface; RadioButton2 := TRadioButton.Create(Page);
RadioButton2.Left := ScaleX();
RadioButton2.Top := RadioButton1.Top + ScaleY();
RadioButton2.Width := Page.SurfaceWidth;
RadioButton2.Height := ScaleY();
RadioButton2.Caption := '自定义安装';
RadioButton2.Checked := false;
RadioButton2.Parent := Page.Surface; Lbl2 := TNewStaticText.Create(Page);
Lbl2.Left := ScaleX();
Lbl2.Top := Lbl1.Top + ScaleY();
Lbl2.Width := ScaleX();
Lbl2.Height := ScaleY();
Lbl2.Caption := '您可以选择单个安装项,建议经验丰富的用户使用';
Lbl2.Parent := Page.Surface;
end; procedure InitializeWizard();
begin
CreateAddonPage; end; function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = wpSelectDir) and (RadioButton1.Checked) then
Result := True
else if (PageID = wpSelectProgramGroup) and (RadioButton1.Checked) then
Result := True
end;

代码中红色部分表示自定义页面所紧跟的向导页面的CurPageID值,蓝色部分分别表示自定义页面的标题和描述。
默认截图:

自定义截图:

Inno Setup技巧[实例]添加自定义页面的更多相关文章
- Inno Setup技巧[界面]欢迎页面上添加文字
原文:Inno Setup技巧[界面]欢迎页面上添加文字 本文介绍在"欢迎页面添加文字"的两种方法. 界面预览: Setup技巧[界面]欢迎页面上添加文字" title= ...
- Inno Setup技巧[界面]添加和自定义左下角标签
原文 http://blog.sina.com.cn/s/blog_5e3cc2f30100cc49.html 本文介绍添加和自定义“左下角标签”的方法. 界面预览: Setup技巧[界面]添加和自定 ...
- Inno Setup技巧[界面]自定义安装向导小图片宽度
原文 blog.sina.com.cn/s/blog_5e3cc2f30100cj7e.html 英文版中安装向导右上角小图片的大小为55×55,汉化版中为55×51.如果图片超过规定的宽度将会被压 ...
- INNO SETUP数据库的连接与创建
原文:INNO SETUP数据库的连接与创建 说明一下:这块程序的前半部分在INNO SETUP的实例里面就有,而后面如果对数据库进行备份和还原在实例里面没有,在网上也不好找,是本人费了好大劲一句一句 ...
- Inno Setup使用技巧
一.关于Inno Setup如何在安装时播放音乐 方法(1): 在脚本编译里的[Code]与[Files]段处添加以下代码: [Code] Function mciSendString(lpszCom ...
- 本人亲测-inno setup打包EXE(较完整实例)
; Script generated by the Inno Setup Script Wizard.; SEE THE DOCUMENTATION FOR DETAILS ON CREATING I ...
- Inno Setup脚本语法大全
Inno Setup脚本语法大全 ResourceShare Bruce 11个月前 (10-28) 6136浏览 0评论 Inno Setup 是什么?Inno Setup 是一个免费的 Win ...
- Inno Setup入门(十六)——Inno Setup类参考(2)
Inno Setup入门(十六)——Inno Setup类参考(2) http://379910987.blog.163.com/blog/static/33523797201112755641236 ...
- Inno Setup制作安装包的几个问题
1. 卸载时,如何判断应用程序是否运行 InnoSetup 提供变量AppMutex,用来保存应用程序的Mutex名称.现在很多应用程序都是唯一实例运行.这样避免配置文件被错误修改以及其他很多衍 ...
随机推荐
- wordpress教程之文章页single.php获取当前文章所属分类
之所以要发这篇文章,是因为这个方法适用于: WP默认文章分类 手动添加的自定文章分类 插件(custom post type ui)添加的自定义文章分类(含taxonomy) 方法目的:在文章模板中, ...
- Android DatePickerDialog 只选择年月
//对EditText注册OnTouch事件etSscxNssbDate.setOnTouchListener(selectDateTouchListener); //选择日期 private OnT ...
- Android自定义View——自定义搜索框(SearchView)
Android自定义View——自定义搜索框(SearchView) http://www.apkbus.com/android-142064-1-1.html
- 是否需要手动执行DataContext的Dispose方法?
我们知道DataContext实现了IDisposable接口.在C#中,凡是实现了IDisposable接口的类,都推荐的使用using语句.如下: using (DataContext db = ...
- Live555类结构
Medium live555几乎所有的处理单元都继承自Medium类:该类抽象了基本的接口,包括环境,task和媒体名和媒体查找函数(lookupByName)以及一些辅助函数.也包括返回当前的环境类 ...
- LeeCode-Happy Number
Write an algorithm to determine if a number is "happy". A happy number is a number defined ...
- JAVA JNI
jni非常好的一篇文章 http://m.blog.csdn.net/article/details?id=22827307 JAVA JNI介绍 http://blog.csdn.net/cyg08 ...
- poj 3216 (最小路径覆盖)
题意:有n个地方,m个任务,每个任务给出地点,开始的时间和完成需要的时间,问最少派多少工人去可以完成所有的任务.给出任意两点直接到达需要的时间,-1代表不能到达. 思路:很明显的最小路径覆盖问题,刚开 ...
- C#主要字典集合性能对比[转]
A post I made a couple days ago about the side-effect of concurrency (the concurrent collections in ...
- 使用lock_sga和pre_page_sga参数保证SGA常驻物理内存 .
Lock_sga LOCK_SGA locks the entire SGA into physical memory. It is usually advisable to lock the SGA ...