- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个带有自定义 WelcomeLabel2
消息的 Inno Setup 程序。
[Messages]
WelcomeLabel2=Lorem ipsum dolor sit amet CLICK_HERE consectetur adipiscing elit.
我正在尝试将 CLICK_HERE
设为可点击的网站链接。
我想知道的另一件事是如何使此 CLICK_HERE
文本粗体。
我怎样才能实现这个目标?
最佳答案
这并不容易。
要创建一个整体可点击的标签,您可以使用如下代码:
procedure OpenBrowser(Url: string);
var
ErrorCode: Integer;
begin
ShellExec('open', Url, '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure LinkClick(Sender: TObject);
begin
OpenBrowser('https://www.example.com/');
end;
procedure InitializeWizard;
var
Link: TLabel;
begin
Link := TLabel.Create(WizardForm);
Link.Left := ???;
Link.Top := ???;
Link.Parent := WizardForm.WelcomePage;
Link.Caption := 'CLICK_HERE';
Link.OnClick := @LinkClick;
Link.ParentFont := True;
Link.Font.Style := Link.Font.Style + [fsUnderline, fsBold];
Link.Font.Color := clBlue;
Link.Cursor := crHand;
end;
另请参阅Show License Agreement link in Inno Setup while installation .
<小时/>尽管创建一个只有部分文本可点击的标签要困难得多。如果文本适合一行,则可以通过将三个标签彼此相邻堆叠(首先是前导静态文本,然后是链接,然后是尾随静态文本)来实现。但是,如果文本无法容纳在一行中,则这是不可行的,因为标签会相互重叠。
<小时/>或者,您可以创建带有链接的 RTF 文档,并使用只读 TRichEditViewer
来呈现它:
procedure InitializeWizard;
var
RichViewer: TRichEditViewer;
begin
RichViewer := TRichEditViewer.Create(WizardForm);
RichViewer.Left := WizardForm.WelcomeLabel2.Left;
RichViewer.Top := WizardForm.WelcomeLabel2.Top;
RichViewer.Width := WizardForm.WelcomeLabel2.Width;
RichViewer.Height := WizardForm.WelcomeLabel2.Height;
RichViewer.Parent := WizardForm.WelcomeLabel2.Parent;
RichViewer.BorderStyle := bsNone;
RichViewer.TabStop := False;
RichViewer.ReadOnly := True;
WizardForm.WelcomeLabel2.Visible := False;
RichViewer.RTFText :=
'{\rtf1 Lorem ipsum dolor sit amet ' +
'{\b {\field{\*\fldinst{HYPERLINK "https://www.example.com/" }}' +
'{\fldrslt{CLICK_HERE}}}} ' +
'consectetur adipiscing elit.}';
end;
为此,您需要 Unicode 版本(从 Inno Setup 6 开始的唯一版本),请参阅 How to add clickable links to custom page in Inno Setup using RichEditViewer?
要更改链接颜色,请参阅 Inno Setup - How to change the color of the hyperlink in RTF text?
<小时/>正如 @Bill_Stewart 评论的那样,您应该避免以提升的权限启动浏览器。如需解决方案,请参阅How to open a web site after uninstallation in non-elevated mode?
关于inno-setup - 如何向自定义 Inno Setup WelcomeLabel 添加可点击链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37154573/
我需要编辑或替换 About Setup 中的文本Inno Setup 的对话框文本。 这是一张图片: 在互联网上查看我得到了这个代码: [Files] Source: CallbackCtrl.dl
我最近发现一些旧的 PC 游戏可以在我的 Windows 10 64 位计算机上玩。我查看了各种在线资源以使游戏正常运行。现在我有兴趣为使游戏正常运行所采取的所有各种步骤创建一个自定义安装程序。我成功
是否可以获得用于 Inno Setup 安装程序的 Inno Setup 版本号? 我找不到记录的开关来返回其版本号(例如 5.5.6),而且似乎没有暴露给 Inno Setup 脚本的预定义版本常量
如何更改 setup-*.bin(Inno Setup 内部压缩存档文件)的名称、扩展名和位置 默认存档位置:{src} 我要的位置:{src}\Data(Data是一个文件夹。) 最佳答案 有很多方
这是用于 Inno Setup 的 [Setup] 部分中的 LicenseFile 属性的标准 RTF 文档: 是否可以向此页面添加打印按钮以触发打印许可协议(protocol)? 我看到了一个类似
我有一个 Inno Setup 脚本可以将我的应用程序变成一个 exe。 当我使用 Inno Setup 版本 6 编译代码时,输出文件大小为 110MB(如 Windows Explorer 大
编译了 Inno Setup 脚本 (IS v5.4.2),但是当运行生成的 Setup.exe 时,出现了一个错误对话框,内容如下: 内部错误:ExtractTemporaryFile:找不到文件“
Inno Setup - 我想创建一个类似于屏幕截图的安装程序。 安装程序应在左侧突出显示当前步骤。 如何实现? 最佳答案 @Bill_Stewart 是正确的,普通的 Inno Setup 不提供如
图像作为安装程序背景。如何使用 inno 5.5.9 做到这一点? 最佳答案 我认为这在 Inno Setup 中是不可能的。也许是一些 Inno Setup 克隆。 问题是Inno Setup中的所
这个问题在这里已经有了答案: Inno Setup - Signing fails with "Sign Tool failed with exit code 0x1" (2 个答案) 关闭 3 年
如何获取有关安装程序中包含的文件的信息(最后修改时间戳、文件大小)?通过使用文件的路径,很容易引用磁盘上的文件。但是当文件没有路径时,如何在安装程序中引用它呢? 当安装程序初始化时,我想检查磁盘上是否
Inno Setup 中的单词补全是如何工作的? 如果我在代码中的任何标识符或单词的中间或末尾按 Alt+Right,则没有任何反应。 我找不到任何要安装的扩展,也找不到该主题的 Internet 答
从这里开始:Inno Setup Placing image/control on custom page . 这是做我需要的: CustomPage := CreateCustomPage(wpLi
我的安装程序在组件页面中有一个可视错误。在您开始向下滚动页面之前看起来还不错,但开始看起来一团糟。 我认为问题出在代码中的某个地方,但仅在绝对干净的脚本上重新创建了组件部分,问题仍然存在。尝试更改缩放
如何在 Inno Setup 编译器中为我们的设置提供背景全屏图像。 喜欢下面这张图。 最佳答案 不要那样做。这违反了 Windows 设计指南。 无论如何,如果必须,请使用 WindowVisibl
如何在代码中使用 [Setup] 部分的值? 我怀疑我没有正确使用该工具;也许我应该以完全不同的方式来做这件事。 [Setup] MyValue=some value [code] function
如何自定义 Inno Setup 安装程序的欢迎页面? 我想创建一个类似于 Skype 安装程序的安装程序,只有 3 个页面: 带有一些选项的自定义欢迎页面 进度页 使用“运行程序”选项完成页面 但是
我已经为我想更新的程序创建了文件。 我希望在安装之前,检查程序是否也在标准目录中,如果不是,则正确的目录可以选择程序所在的位置。 我试过这个: [Files] Source: "C:\Data"; D
我想在您选择安装位置的页面之后创建一个自定义向导页面。 我已经在 InitializeWizard 中看到了如何创建自定义页面并将它们添加到向导中。程序。 我的问题是,当我创建自定义页面时,安装位置选
我已经安装了我的程序。但是如果我尝试再次安装它,它会安装并且程序被替换。 我看到这个问题 Inno Setup - How to display notifying message while ins
我是一名优秀的程序员,十分优秀!