I need to make an Windows installer either with NSIS or InnoSetup. The customer wants an image to be displayed in the installer dialogues/ wizard pages and the image needs to be clickable, e.g. open a browser window when clicked. Is this possible? If yes, is it also possible to use animated gifs?
To make the welcome page's left image clickable, you can use the following:
[Code]
procedure OnBannerClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('', 'http://www.stackoverflow.com', '', '', SW_SHOW, ewNoWait,
ErrorCode);
end;
procedure InitializeWizard;
begin
WizardForm.WizardBitmapImage.Cursor := crHand;
WizardForm.WizardBitmapImage.OnClick := @OnBannerClick;
end;
....and the same thing for NSIS:
!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MakeClickableWizardImage
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MakeClickableWizardImage
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
Function OnWizardClick
ExecShell "" "http://example.com"
FunctionEnd
Function MakeClickableWizardImage
StrCpy $0 $mui.WelcomePage.Image
${If} $mui.FinishPage.Image <> 0
StrCpy $0 $mui.FinishPage.Image
${EndIf}
${NSD_OnClick} $0 OnWizardClick
FunctionEnd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With