Show License Agreement link in Inno Setup while installation

久未见 提交于 2020-01-11 03:08:26

问题


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.


回答1:


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):




回答2:


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



来源:https://stackoverflow.com/questions/9238698/show-license-agreement-link-in-inno-setup-while-installation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!