Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show a hyperlink in Inno Setup?

I'm making a validation in my Inno Setup installer to check whether or not a Microsoft update is installed on the machine, if not, I'm showing a simple message box telling the user that the update is required, this is the message code:

MsgBox(
  'Your system requires an update supplied by Microsoft. ' +
  'Please follow this link to install it: ' + 
  'http://www.microsoft.com/downloads/details.aspx?FamilyID=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en',
  mbInformation, MB_OK);

I want to make the URL an hyperlink to the web page, but I haven't been able to figure it out how, it is possible in Inno Setup to add text as an hyperlink?

Thanks.

like image 879
Vic Avatar asked Sep 29 '09 15:09

Vic


People also ask

How do I add a checkbox in Inno?

[Code] procedure ExitProcess(uExitCode: UINT); external '[email protected] stdcall'; var MainPage : TWizardPage; FolderToInstall : TEdit; InstallLocation : String; procedure CancelClick(Sender: TObject); begin if ExitSetupMsgBox then begin ExitProcess(0); end; end; procedure BrowseClick(Sender : TObject); var ...

How do I change the icon on my Inno?

As you know the application icon is built into the .exe file. The Inno Setup cannot modify the .exe files. And there's no other way to override the application icon by an external one. You have to edit the .exe file yourself, before building the installer.

How do I Setup Inno Setup?

Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly. Innosetup offers an awesome alternative to create great looking Installers for free.


1 Answers

The MsgBox() function in Inno Setup is a wrapper for the standard Windows MessageBox() function, which AFAIK doesn't support embedded links, so it's not possible to simply show the link there.

What you could do however is to notify the user that the update is required, and ask them whether to open the link in the default browser. Something like:

function InitializeSetup(): Boolean;
var
  ErrCode: integer;
begin
  if MsgBox('Your system requires an update supplied by Microsoft. Would you like to visit the download page now?', mbConfirmation, MB_YESNO) = IDYES
  then begin
    ShellExec('open', 'http://www.microsoft.com/downloads/details.aspx?FamilyID=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en',
      '', '', SW_SHOW, ewNoWait, ErrCode);
  end;
  Result := False;
end;

This code will abort the installation, but you could create a custom page instead which checks whether the update has been installed, and otherwise prevents navigation to the next page. This would only work if the update can be installed without a system restart, though.

like image 187
mghie Avatar answered Nov 16 '22 02:11

mghie