By Martin Prikryl

https://stackoverflow.com/questions/42625626/inno-setup-how-to-create-a-outernotebook-welcome-page-in-the-uninstaller

You create the page as any other, except that its parent will be the UninstallProgressForm.OuterNotebook, not the .InnerNotebook.

Tricky part is not how to create the page, but how to implement the Next/Back buttons.

The Next button on the "welcome" page must change the page of the OuterNotebook from the "welcome" page to the UninstallProgressForm.InnerPage. And of course make sure the active page on the .InnerNotebook is the first normal/inner page.

Conversely, the Back button on the first normal/inner page must change the page of the OuterNotebook from the UninstallProgressForm.InnerPage to the "welcome" page.

So modifying my answer to the Custom Uninstall page (not MsgBox) to cater for the above, you will get:

[Files]
Source: "compiler:WizModernImage-IS.bmp"; DestDir: {app} [Code] var
UninstallWelcomePage: TNewNotebookPage;
UninstallFirstPage: TNewNotebookPage;
UninstallSecondPage: TNewNotebookPage;
UninstallBackButton: TNewButton;
UninstallNextButton: TNewButton; procedure UpdateUninstallWizard;
begin
if UninstallProgressForm.InnerNotebook.ActivePage = UninstallFirstPage then
begin
UninstallProgressForm.PageNameLabel.Caption := 'First uninstall wizard page';
UninstallProgressForm.PageDescriptionLabel.Caption :=
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
end
else
if UninstallProgressForm.InnerNotebook.ActivePage = UninstallSecondPage then
begin
UninstallProgressForm.PageNameLabel.Caption := 'Second uninstall wizard page';
UninstallProgressForm.PageDescriptionLabel.Caption :=
'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
end; UninstallBackButton.Visible :=
(UninstallProgressForm.OuterNotebook.ActivePage <> UninstallWelcomePage); if UninstallProgressForm.InnerNotebook.ActivePage <> UninstallSecondPage then
begin
UninstallNextButton.Caption := SetupMessage(msgButtonNext);
UninstallNextButton.ModalResult := mrNone;
end
else
begin
UninstallNextButton.Caption := 'Uninstall';
{ Make the "Uninstall" button break the ShowModal loop }
UninstallNextButton.ModalResult := mrOK;
end;
end; procedure UninstallNextButtonClick(Sender: TObject);
begin
if UninstallProgressForm.OuterNotebook.ActivePage = UninstallWelcomePage then
begin
UninstallProgressForm.OuterNotebook.ActivePage := UninstallProgressForm.InnerPage;
UninstallProgressForm.InnerNotebook.ActivePage := UninstallFirstPage;
UpdateUninstallWizard;
end
else
begin
if UninstallProgressForm.InnerNotebook.ActivePage <> UninstallSecondPage then
begin
if UninstallProgressForm.InnerNotebook.ActivePage = UninstallFirstPage then
begin
UninstallProgressForm.InnerNotebook.ActivePage := UninstallSecondPage;
end;
UpdateUninstallWizard;
end
else
begin
UninstallNextButton.Visible := False;
UninstallBackButton.Visible := False;
end;
end;
end; procedure UninstallBackButtonClick(Sender: TObject);
begin
if UninstallProgressForm.InnerNotebook.ActivePage = UninstallFirstPage then
begin
UninstallProgressForm.OuterNotebook.ActivePage := UninstallWelcomePage;
end
else
if UninstallProgressForm.InnerNotebook.ActivePage = UninstallSecondPage then
begin
UninstallProgressForm.InnerNotebook.ActivePage := UninstallFirstPage;
end; UpdateUninstallWizard;
end; procedure InitializeUninstallProgressForm();
var
PageText: TNewStaticText;
UninstallWizardBitmapImage: TBitmapImage;
PageNameLabel: string;
PageDescriptionLabel: string;
CancelButtonEnabled: Boolean;
CancelButtonModalResult: Integer;
begin
if not UninstallSilent then
begin
PageNameLabel := UninstallProgressForm.PageNameLabel.Caption;
PageDescriptionLabel := UninstallProgressForm.PageDescriptionLabel.Caption; { Create the Welcome page and make it active }
UninstallWelcomePage := TNewNotebookPage.Create(UninstallProgressForm);
UninstallWelcomePage.Notebook := UninstallProgressForm.OuterNotebook;
UninstallWelcomePage.Parent := UninstallProgressForm.OuterNotebook;
UninstallWelcomePage.Align := alClient;
UninstallWelcomePage.Color := clWindow; UninstallWizardBitmapImage := TBitmapImage.Create(UninstallProgressForm);
UninstallWizardBitmapImage.Parent := UninstallWelcomePage;
UninstallWizardBitmapImage.Width := ScaleX();
UninstallWizardBitmapImage.Height := ScaleX();
UninstallWizardBitmapImage.Bitmap.LoadFromFile(
ExpandConstant('{app}\WizModernImage-IS.bmp'));
UninstallWizardBitmapImage.Center := True;
UninstallWizardBitmapImage.Stretch := True; PageText := TNewStaticText.Create(UninstallProgressForm);
PageText.Parent := UninstallWelcomePage;
PageText.Left := ScaleX();
PageText.Top := ScaleX();
PageText.Width := ScaleX();
PageText.Height := ScaleX();
PageText.AutoSize := False;
PageText.Caption := 'Welcome to the My Program uninstall wizard';
PageText.ShowAccelChar := False;
PageText.WordWrap := True;
PageText.Font.Name := 'Verdana';
PageText.Font.Size := ;
PageText.Font.Style := [fsBold]; PageText := TNewStaticText.Create(UninstallProgressForm);
PageText.Parent := UninstallWelcomePage;
PageText.Left := ScaleX();
PageText.Top := ScaleX();
PageText.Width := ScaleX();
PageText.Height := ScaleX();
PageText.AutoSize := False;
PageText.Caption :=
'This will uninstall My Program 1.5 from your computer.'#### +
'It is recommended that your close all other applications before continuing.' +
#### +
'Click Next to continue, or Cancel to exit Uninstall.';
PageText.ShowAccelChar := False;
PageText.WordWrap := True; UninstallProgressForm.OuterNotebook.ActivePage := UninstallWelcomePage; { Create the first page }
UninstallFirstPage := TNewNotebookPage.Create(UninstallProgressForm);
UninstallFirstPage.Notebook := UninstallProgressForm.InnerNotebook;
UninstallFirstPage.Parent := UninstallProgressForm.InnerNotebook;
UninstallFirstPage.Align := alClient; PageText := TNewStaticText.Create(UninstallProgressForm);
PageText.Parent := UninstallFirstPage;
PageText.Top := UninstallProgressForm.StatusLabel.Top;
PageText.Left := UninstallProgressForm.StatusLabel.Left;
PageText.Width := UninstallProgressForm.StatusLabel.Width;
PageText.Height := UninstallProgressForm.StatusLabel.Height;
PageText.AutoSize := False;
PageText.ShowAccelChar := False;
PageText.Caption := 'Press Next to proceeed with uninstallation.'; { Create the second page }
UninstallSecondPage := TNewNotebookPage.Create(UninstallProgressForm);
UninstallSecondPage.Notebook := UninstallProgressForm.InnerNotebook;
UninstallSecondPage.Parent := UninstallProgressForm.InnerNotebook;
UninstallSecondPage.Align := alClient; PageText := TNewStaticText.Create(UninstallProgressForm);
PageText.Parent := UninstallSecondPage;
PageText.Top := UninstallProgressForm.StatusLabel.Top;
PageText.Left := UninstallProgressForm.StatusLabel.Left;
PageText.Width := UninstallProgressForm.StatusLabel.Width;
PageText.Height := UninstallProgressForm.StatusLabel.Height;
PageText.AutoSize := False;
PageText.ShowAccelChar := False;
PageText.Caption := 'Press Uninstall to proceeed with uninstallation.'; UninstallNextButton := TNewButton.Create(UninstallProgressForm);
UninstallNextButton.Parent := UninstallProgressForm;
UninstallNextButton.Left :=
UninstallProgressForm.CancelButton.Left -
UninstallProgressForm.CancelButton.Width -
ScaleX();
UninstallNextButton.Top := UninstallProgressForm.CancelButton.Top;
UninstallNextButton.Width := UninstallProgressForm.CancelButton.Width;
UninstallNextButton.Height := UninstallProgressForm.CancelButton.Height;
UninstallNextButton.OnClick := @UninstallNextButtonClick; UninstallBackButton := TNewButton.Create(UninstallProgressForm);
UninstallBackButton.Parent := UninstallProgressForm;
UninstallBackButton.Left :=
UninstallNextButton.Left - UninstallNextButton.Width - ScaleX();
UninstallBackButton.Top := UninstallProgressForm.CancelButton.Top;
UninstallBackButton.Width := UninstallProgressForm.CancelButton.Width;
UninstallBackButton.Height := UninstallProgressForm.CancelButton.Height;
UninstallBackButton.Caption := SetupMessage(msgButtonBack);
UninstallBackButton.OnClick := @UninstallBackButtonClick;
UninstallBackButton.TabOrder := UninstallProgressForm.CancelButton.TabOrder; UninstallNextButton.TabOrder := UninstallBackButton.TabOrder + ; UninstallProgressForm.CancelButton.TabOrder := UninstallNextButton.TabOrder + ; { Run our wizard pages }
UpdateUninstallWizard;
CancelButtonEnabled := UninstallProgressForm.CancelButton.Enabled
UninstallProgressForm.CancelButton.Enabled := True;
CancelButtonModalResult := UninstallProgressForm.CancelButton.ModalResult;
UninstallProgressForm.CancelButton.ModalResult := mrCancel; if UninstallProgressForm.ShowModal = mrCancel then Abort; { Restore the standard page payout }
UninstallProgressForm.CancelButton.Enabled := CancelButtonEnabled;
UninstallProgressForm.CancelButton.ModalResult := CancelButtonModalResult; UninstallProgressForm.PageNameLabel.Caption := PageNameLabel;
UninstallProgressForm.PageDescriptionLabel.Caption := PageDescriptionLabel; UninstallProgressForm.InnerNotebook.ActivePage :=
UninstallProgressForm.InstallingPage;
end;
end;

Note that there's no way to use the built-in images from the installer in the uninstaller. In my simple code above, I install the "welcome" page image to the {app} and load it from there.

If you want to avoid this, see my answer to the How keep uninstall files inside uninstaller?

[Inno Setup] How to create a OuterNotebook/welcome page in the uninstaller的更多相关文章

  1. Inno Setup connection to the database and create

    原文 Inno Setup connection to the database and create Description: the first half of this program in I ...

  2. Inno Setup自定义安装界面脚本

    ; 脚本由 Inno Setup 脚本向导 生成! ; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "RemoteCard&quo ...

  3. 一个简单的inno setup模板

    一.模板代码 基本功能包括多路径安装.多语言.自定义图标. [Setup] ShowLanguageDialog=yes AppCopyright=Copyright Reserved(C) , 36 ...

  4. Inno Setup怎样创建一个自动申请管理员身份运行的快捷

    如果你使用的是 Unicode 版本的 Inno Setup,那么以下是更为专业的解决方法.    这是 mlaan 提及的再一种方法. QUOTE(     CodeAutomation3.iss) ...

  5. 以前编写的inno setup脚本,涵盖了自定义安装界面,调用dll等等应用 (转)

    以前编写的inno setup脚本,涵盖了自定义安装界面,调用dll等等应用 (转) ; Script generated by the Inno Setup 脚本向导. ; SEE THE DOCU ...

  6. Inno Setup使用技巧

    一.关于Inno Setup如何在安装时播放音乐 方法(1): 在脚本编译里的[Code]与[Files]段处添加以下代码: [Code] Function mciSendString(lpszCom ...

  7. 用inno Setup做应用程序安装包的示例脚本(.iss文件)(

    用innoSetup做应用程序安装包的示例脚本(.iss文件),具体要看innoSetup附带的文档,好象是pascal语言写的脚本. 示例1(应用程序.exe,客户端安装): ;{089D6802- ...

  8. inno setup介绍及官方网站地址

    使 用 笔 记 1.Inno Setup 是什么?Inno Setup 是一个免费的 Windows 安装程序制作软件.第一次发表是在 1997 年,Inno Setup 今天在功能设置和稳定性上的竞 ...

  9. Inno Setup的常用脚本

    Inno Setup的常用脚本 分类: VC++神奇理论 2012-12-06 10:07 3234人阅读 评论(2) 收藏 举报 安装不同的目录: [Files] Source: "我的程 ...

随机推荐

  1. html前端之基础篇

      HTML介绍 Web服务本质 import socket sk = socket.socket() sk.bind(("127.0.0.1", 8080)) sk.listen ...

  2. JS去除字符串内的空白字符方法

    有时我们需要对用户的输入进行一些处理,比如用户输入的密码或者用户名我们就需要去除前后空格,下面写一个去除空白字符的方法 function trim(string = '') { return stri ...

  3. SpringBoot 入门:项目属性配置

    开发一个SpringBoot 项目,首当其冲,必然是配置项目 一.项目属性配置 1. SpringBoot自带了Tomcat服务器,通过使用项目配置文件来修改项目的配置,如图配置了部署在80端口,目录 ...

  4. 《Three.js 入门指南》3.0 - 代码构建的最基本结构。

    3.0 代码构建的最基本结构 说明: 我们必需首先知道,Three.js 的一些入门级概念: 我们需要知道,OpenGL 是一套三维实现的标准,为什么说是标准,因为它是跨平台,跨语言的.甚至CAD以及 ...

  5. jenkins登录信息无效,忘记密码

    1.使用admin账号登陆jenkins,提示登录信息无效,请重试 原因:启动了多个jenkins服务或者所开的Jenkins服务不对 2.jenkins账号密码忘记 修改C:\Users\ASUS- ...

  6. 【WPF学习】第六十六章 支持可视化状态

    上一章介绍的ColorPicker控件,是控件设计的最好示例.因为其行为和可视化外观是精心分离的,所以其他设计人员可开发动态改变其外观的新模板. ColorPicker控件如此简单的一个原因是不涉及状 ...

  7. MongoDB查询mgov2的聚合方法

    1.多条表数据累计相加. respCount := struct { Rebatescore int64 //变量命名必须要和查询的参数一样.}{} o := bson.M{"$match& ...

  8. TCP协议的安全性分析

    有算法就有破解法,因为它们都遵循了一定的数据结构和数学知识.所以网络安全是一个相对的概念,不可能出现绝对的安全!作为当今最流行的网络协议--TCP也是如此.那么TCP的安全问题究竟是哪些因素引起的呢? ...

  9. matplotlib中的基本概念

    有外语基础的朋友看这里: matplotlib官方文档 Figure(图像): 组成部分

  10. 刨根问底系列(2)——stdin、stdout、FILE结构体、缓冲区和fflush的理解

    stdin.stdout.FILE结构体.缓冲区和fflush理解 因为之前调试代码时, printf输出的字符串总是被截断了输出(先输出部分, 再输出剩余的), 当时调试了很久, 才知道问题所在, ...