[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的更多相关文章
- 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 ...
- Inno Setup自定义安装界面脚本
; 脚本由 Inno Setup 脚本向导 生成! ; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档! #define MyAppName "RemoteCard&quo ...
- 一个简单的inno setup模板
一.模板代码 基本功能包括多路径安装.多语言.自定义图标. [Setup] ShowLanguageDialog=yes AppCopyright=Copyright Reserved(C) , 36 ...
- Inno Setup怎样创建一个自动申请管理员身份运行的快捷
如果你使用的是 Unicode 版本的 Inno Setup,那么以下是更为专业的解决方法. 这是 mlaan 提及的再一种方法. QUOTE( CodeAutomation3.iss) ...
- 以前编写的inno setup脚本,涵盖了自定义安装界面,调用dll等等应用 (转)
以前编写的inno setup脚本,涵盖了自定义安装界面,调用dll等等应用 (转) ; Script generated by the Inno Setup 脚本向导. ; SEE THE DOCU ...
- Inno Setup使用技巧
一.关于Inno Setup如何在安装时播放音乐 方法(1): 在脚本编译里的[Code]与[Files]段处添加以下代码: [Code] Function mciSendString(lpszCom ...
- 用inno Setup做应用程序安装包的示例脚本(.iss文件)(
用innoSetup做应用程序安装包的示例脚本(.iss文件),具体要看innoSetup附带的文档,好象是pascal语言写的脚本. 示例1(应用程序.exe,客户端安装): ;{089D6802- ...
- inno setup介绍及官方网站地址
使 用 笔 记 1.Inno Setup 是什么?Inno Setup 是一个免费的 Windows 安装程序制作软件.第一次发表是在 1997 年,Inno Setup 今天在功能设置和稳定性上的竞 ...
- Inno Setup的常用脚本
Inno Setup的常用脚本 分类: VC++神奇理论 2012-12-06 10:07 3234人阅读 评论(2) 收藏 举报 安装不同的目录: [Files] Source: "我的程 ...
随机推荐
- E2. String Coloring (hard version)(贪心)
E2. String Coloring (hard version) time limit per test 1 second memory limit per test 256 megabytes ...
- git本地新建分支推送到远程
$ git checkout -b “分支名称”: 新建本地分支 $ git branch: 查看是否创建成功以及目前在哪个分支 $ gi ...
- 掌握使用gitlab ci构建Android包的正确方式
最近公司在做移动端的项目,自然而然的需要搭建打包的环境.本来计划用Jenkins的,但是发现在gitlab上创建完项目后,提示去配置pipeline,于是决定用gitlab去尝试下,毕竟我觉得Jenk ...
- java中封装,继承,多态,接口学习总结
### 一:封装java中封装是指一种将抽象性函式接口的实现细节部分包装.隐藏起来的方法. 封装可以被认为是一个保护屏障,防止该类的代码和数据被外部类定义的代码随机访问.要访问该类的代码和数据,必须通 ...
- 命令行工具nslookup查域名DNS服务器
在使用的操作系统里进入终端, 1.输入 nslookup 回车 2.输入 set type=ns 回车 3.输入域名(不带WWW的),如:baidu.com 回车 操作过程如下, > set t ...
- openlayers-统计图显示(中国区域高亮)
openlayers版本: v3.19.1-dist 统计图效果: 案例下载地址:https://gitee.com/kawhileonardfans/openlayers-examp ...
- C#使用HTML文件中的file文件上传,用C#代码接收上传文件
单独做图片上传很简单,如果要客户端要上传头像保存到服务器就要稍微麻烦一点点了. 不多说了,直接上源码: private void Upload() { string jsonInfo = string ...
- MySQL学习之路5-数据表的常用操作
排序 :order by desc select * from <tablename> order by <字段名> desc:order by默认升序 desc 降序 分组 ...
- 数据结构和算法(Golang实现)(19)排序算法-冒泡排序
冒泡排序 冒泡排序是大多数人学的第一种排序算法,在面试中,也是问的最多的一种,有时候还要求手写排序代码,因为比较简单. 冒泡排序属于交换类的排序算法. 一.算法介绍 现在有一堆乱序的数,比如:5 9 ...
- Xray安装与使用
0×00 Xray简介 xray是从长亭洞鉴核心引擎中提取出的社区版漏洞扫描神器,支持主动.被动多种扫描方式,自备盲打平台.可以灵活定义 POC,功能丰富,调用简单,支持 Windows / macO ...