Show License Agreement link in Inno Setup while in

2019-02-14 01:50发布

I am using Inno Setup for my application. I want to show a link (License Agreement) in Inno Setup while installation (except separate License Agreement Wizard). I want combine this link with some task. When user clicks that link it will navigate to particular URL.

标签: inno-setup
2条回答
狗以群分
2楼-- · 2019-02-14 02:02

I know I'm quite late here... The following code script creates the License Agreement link label in the bottom left part of the wizard form. That label has a blue underlined font and a hand cursor on hover so it looks and feels like a common web page link. On its click event a specified URL is opened in a default web browser. This label is then visible on all wizard pages except the license page one:

[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;

And the result (click to enlarge):

Click to enlarge Click to enlarge

查看更多
别忘想泡老子
3楼-- · 2019-02-14 02:07

Create an RTF formatted license text (with Wordpad for very small file size) and type the hyperlink in the text as pure text, no extra functions needed (eg. 'http://stackoverflow.com'). InnoSetup will display this URL and make it clickable. Be aware that e-mail links do not work properly.

Wanna try? Save this entire text Wordpad, save as RTF and link it to InnoSetup.

Dutch

查看更多
登录 后发表回答