Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show License Agreement link in Inno Setup while installation

Tags:

inno-setup

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.

like image 306
Udhayakumar M Avatar asked Feb 11 '12 07:02

Udhayakumar M


2 Answers

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

like image 84
TLama Avatar answered Nov 12 '22 01:11

TLama


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

like image 31
Dutch Gemini Avatar answered Nov 12 '22 01:11

Dutch Gemini