Innosetup 新增一个向导页面,让用户选择安装方式

转载于:http://www.docin.com/p-612536939.html

在Innosetup的向导页面中,新增一个页面,提供两种安装选择

1.选择标准安装将跳过“选择目标位置”和“选择开始菜单文件夹”等页面。(主要是跳过部分页面,快捷安装)

2.用户自定义安装,可以选择安装目录等

在[Code]段添加以下代码:

var
     Page: TWizardPage; {定义一个页面,在pascal中大括号是用来注释的}

RadioButton1, RadioButton2: TRadioButton; {定义2个单选按钮}
     Lbl1, Lbl2: TNewStaticText; {定义两个label,用来阐述安装的信息}

procedure CreateAddonPage;{新建添加页面的方法}
begin
     Page := CreateCustomPage(wpInfoBefore, '选择安装类型', '请根据您的需要选择安装的类型');

{设置单选按钮1的属性,并添加到页面中}

RadioButton1 := TRadioButton.Create(Page);
    RadioButton1.Left := ScaleX(80);
    RadioButton1.Top := ScaleY(40);
    RadioButton1.Width := Page.SurfaceWidth;
    RadioButton1.Height := ScaleY(17);
    RadioButton1.Caption := '标准安装';
    RadioButton1.Checked := True;
    RadioButton1.Parent := Page.Surface;

{设置label1的属性,并添加到页面中}
    Lbl1 := TNewStaticText.Create(Page);
    Lbl1.Left := ScaleX(95);
    Lbl1.Top := ScaleY(60);
    Lbl1.Width := ScaleX(250);
    Lbl1.Height := ScaleY(50);
    Lbl1.Caption := '按照标准模式安装软件到您的电脑';
    Lbl1.Parent := Page.Surface;

{设置单选按钮2的属性,并添加到页面中}
    RadioButton2 := TRadioButton.Create(Page);
    RadioButton2.Left := ScaleX(80);
    RadioButton2.Top := RadioButton1.Top + ScaleY(60);
    RadioButton2.Width := Page.SurfaceWidth;
    RadioButton2.Height := ScaleY(17);
    RadioButton2.Caption := '自定义安装';
    RadioButton2.Checked := false;
    RadioButton2.Parent := Page.Surface;

{设置label2的属性,并添加到页面中}
    Lbl2 := TNewStaticText.Create(Page);
    Lbl2.Left := ScaleX(95);
    Lbl2.Top := Lbl1.Top + ScaleY(60);
    Lbl2.Width := ScaleX(250);
    Lbl2.Height := ScaleY(50);
    Lbl2.Caption := '您可以选择单个安装项,建议经验丰富的用户使用';
    Lbl2.Parent := Page.Surface;
end;

{调用系统自带的方法,InitializeWizard(),在此方法中调用我们定义的方法 CreateAddonPage --准确来说应该叫过程,而不叫方法}
procedure InitializeWizard();
begin
     CreateAddonPage;

end;

{调用系统自带的 ShouldSkipPage方法,此方法是用来跳过某些向导页面的}
function ShouldSkipPage(PageID: Integer): Boolean;
begin

{跳过 选择安装目录的页面 这里的 wpSelectDir,wpSelectProgramGroup都是Innosetup系统预设的,

更多的页面id,请参考http://www.cnblogs.com/tommy-huang/p/4121229.html 中的第三点 }

if (PageID = wpSelectDir) and (RadioButton1.Checked) then
         Result := True
    else if (PageID = wpSelectProgramGroup) and (RadioButton1.Checked) then
         Result := True
end;

Innosetup新增Wizard Page的更多相关文章

  1. 构建基于WinRT的WP8.1 App 03:Page控件

    单页面模板 通常利用Visual Studio 2013创建的最简单的WP8.1应用是Blank App,它只包含一个不带任何UI的页面,并且没有任何状态管理的逻辑. 该不带任何UI的页面称为Blan ...

  2. InnoSetup打包exe安装应用程序,并添加卸载图标 转

    http://blog.csdn.net/guoquanyou/article/details/7445773 InnoSetup真是一个非常棒的工具.给我的印象就是非常的精干.所以,该工具已经一步步 ...

  3. [Inno Setup] How to create a OuterNotebook/welcome page in the uninstaller

    By Martin Prikryl https://stackoverflow.com/questions/42625626/inno-setup-how-to-create-a-outernoteb ...

  4. Git for Windows v2.11.0 Release Notes

    homepage faq contribute bugs questions Git for Windows v2.11.0 Release Notes Latest update: December ...

  5. Inno Setup Compiler 中文使用教程

    一.概要 该文章主要解决,Inno Setup Compiler工具的使用问题. 如有什么建议欢迎提出,本人及时修改.[如有任何疑惑可以加Q群:580749909] 二.步骤 (1)下载地址:http ...

  6. SharePoint 2013 configure and publish infopth

    This article will simply descript how to configure and publish a InfoPath step by step. Note: To con ...

  7. 【Java EE 学习 83 上】【SpringMVC】【基本使用方法】

    一.SpringMVC框架概述 什么是SpringMVC?SpringMVC是一个和Struts2差不多的东西,他们的作用和性质几乎是相同的,甚至开发效率上也差不多,但是在运行效率上SpringMVC ...

  8. 使用vs2010创建MFC C++ Ribbon程序

    Your First MFC C++ Ribbon Application with Visual Studio 2010 Earlier this month, I put together my ...

  9. 继续Kanzi

    转眼间,Kanzi已经发展到3.3版本了,之前研究过的东西,今天有空下了个版本跟进更新看看有没有什么变化.新的引擎跟以前2.x版本有很大的差别.新引擎增加了很多新功能(包括局部刷新技术),也跟随大潮加 ...

随机推荐

  1. TensorFlow入门案例

    入门小案例,分别是回归模型建立和mnist数据集的模型建立 1.回归案例: import tensorflow as tf import numpy as np from tensorflow.exa ...

  2. java对redis的基本操作(一)

    一.server端安装 1.下载 https://github.com/MSOpenTech/redis 可看到当前可下载版本:redis2.6

  3. Delphi XE5 图解为Android应用制作签名

    http://redboy136.blog.163.com/blog/static/107188432201381872820132 Delphi XE5 图解为Android应用制作签名 2013- ...

  4. 读《深入理解Windows Phone 8.1 UI控件编程》1.4.3 框架的应用示例:自定义弹出窗口有感

    前些天买了园子里林政老师的两本 WP8.1 的书籍.毕竟想要学得深入的话,还是得弄本书跟着前辈走的. 今天读到 1.4.3 节——框架的应用示例:自定义弹出窗口这一小节.总的来说,就是弄一个像 Mes ...

  5. Elasticsearch 相关 api 操作

    A. es 操作 1. 检查 es 集群健康状态 2. 获取集群中的节点列表 3. 创建索引 4. 获取索引 5. 索引文档 6. 查询文档 7. 删除索引 8. 更新文档 9. 删除文档 10. 批 ...

  6. Word发表blog格式模板

    一级标题(黑体,二号,加粗) 二级标题(黑体,三号,加粗) 正文(宋体+Times New Roman,小四) 注意事项: 序号列表"不连续"时,不得使用自动序号 连续(word连 ...

  7. Android - "已安装了存在签名冲突的同名数据包",解决方法!

    错误提示:已安装了存在签名冲突的同名数据包. 解决方法:打开Android Studio,打开logcat,用usb线连接你出错的手机,识别出手机之后,在你的项目后面,点击“run”按钮,随后AS会提 ...

  8. CPU的寄存器结构

    计算机的硬件有三个基本要素,CPU.内存和I/O.CPU负责解释.执行程序,从内存或I/O输入数据,在内部进行运算,再把运算结果输出到内存或I/O.内存中存放着程序,程序是指令和数据的集合.I/O中临 ...

  9. 用xshell ssh连接测试服务器时候出的问题

    问题还原:用ssh连接测试服务器 给我结结实实报了个错 FBIwarning: ------------------------------------------------------------ ...

  10. Java 反射机制系列

    http://www.cnblogs.com/KingIceMou/category/1034898.html