我正在为我的应用程序使用Inno Setup.我想在安装时在Inno Setup中显示链接(许可协议)(单独的许可协议向导除外).我希望将此链接与某个任务相结合.当用户单击该链接时,它将导航到特定URL.
TLa*_*ama 10
我知道我已经很晚了......下面的代码脚本License Agreement在向导表单的左下角创建了链接标签.该标签有一个蓝色下划线字体和一个悬停的手形光标,因此它看起来和感觉就像一个常见的网页链接.在其单击事件上,将在默认Web浏览器中打开指定的URL.然后,除了许可证页面1之外,所有向导页面上都会显示此标签:
[Code]
var
LicenseLinkLabel: TLabel;
procedure LicenseLinkClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('', 'http://www.stackoverflow.com', '', '', SW_SHOW, ewNoWait,
ErrorCode);
end;
procedure InitializeWizard;
begin
LicenseLinkLabel := TLabel.Create(WizardForm);
LicenseLinkLabel.Parent := WizardForm;
LicenseLinkLabel.Left := 8;
LicenseLinkLabel.Top := WizardForm.ClientHeight -
LicenseLinkLabel.ClientHeight - 8;
LicenseLinkLabel.Cursor := crHand;
LicenseLinkLabel.Font.Color := clBlue;
LicenseLinkLabel.Font.Style := [fsUnderline];
LicenseLinkLabel.Caption := 'License Agreement';
LicenseLinkLabel.OnClick := @LicenseLinkClick;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
LicenseLinkLabel.Visible := CurPageID <> wpLicense;
end;
Run Code Online (Sandbox Code Playgroud)
结果(点击放大):
小智 3
创建 RTF 格式的许可证文本(使用写字板实现非常小的文件大小)并以纯文本形式在文本中键入超链接,无需额外的功能(例如“http://stackoverflow.com”)。InnoSetup 将显示此 URL 并使其可单击。请注意,电子邮件链接无法正常工作。
要尝试它,请将整个文本添加到写字板,另存为 RTF 并将其链接到 InnoSetup。
| 归档时间: |
|
| 查看次数: |
2850 次 |
| 最近记录: |