如何使用RichEditViewer在Inno Setup中向自定义页面添加可点击链接? [英] How to add clickable links to custom page in Inno Setup using RichEditViewer?

查看:227
本文介绍了如何使用RichEditViewer在Inno Setup中向自定义页面添加可点击链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Inno Setup中将可点击链接添加到RichEditViewer?我尝试过此解决方案如何将可点击链接添加到自定义Inno设置WelcomeLabel?

How to add clickable link to RichEditViewer in Inno Setup? I tried this solution How to add clickable links to custom Inno Setup WelcomeLabel?

在下面使用此代码:

[Code]

var
  Page: TWizardPage;

procedure CreateTheWizardPages;
var
  RichViewer1 : TRichEditViewer;
begin
  Page := CreateCustomPage(wpReady, 'Custom', 'Page');

  RichViewer1 := TRichEditViewer.Create(Page);
  RichViewer1.Left := 0;
  RichViewer1.Top := 30;
  RichViewer1.width:=400;
  RichViewer1.WordWrap := True;
  RichViewer1.BorderStyle := bsNone;
  RichViewer1.TabStop := False;
  RichViewer1.ReadOnly := True;
  RichViewer1.Parent := Page.Surface;
  RichViewer1.ParentColor := true; 
  RichViewer1.RTFText :=  '{\rtf1 ' +
    '{\colortbl ;\red238\green0\blue0;}' +
    'Lorem ipsum dolor sit amet ' +
    '{\b {\field{\*\fldinst{HYPERLINK "https://www.example.com/" }}' +
    '{\fldrslt{\cf1 CLICK_HERE\cf0 }}}} ' +
    'consectetur adipiscing elit.}';
end;

procedure InitializeWizard();
begin 
  CreateTheWizardPages;
end;

在自定义页面上我得到了这样的东西:

I got something like this on the custom page:

我希望只有一个可点击的链接"CLICK_HERE"

I would like to have ony one clickable link "CLICK_HERE"

我正在使用Inno Setup 5.6.1,Windows 10 Pro 1909.

I'm using Inno Setup 5.6.1, Windows 10 Pro 1909.

推荐答案

我已经针对各种版本的Inno Setup编译器测试了代码.

I've tested the code against various versions of Inno Setup compiler.

似乎在Ansi版本中不起作用.它适用于Unicode版本. Unicode版本是使用较新版本的Delphi构建的,这可能就是原因.

It looks like it does not work in Ansi version. It works in Unicode version. Unicode version is built using a newer version of Delp that's probably the reason.

在任何情况下,您都应切换到Unicode .然后,您应该升级到最新版本的Inno Setup(仅具有Unicode版本).

You should switch to Unicode in any case. And once you do that, you should upgrade to the latest version of Inno Setup (which has the Unicode version only).

这篇关于如何使用RichEditViewer在Inno Setup中向自定义页面添加可点击链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆