Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clickable banner/ header image in Setup program

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?

like image 233
fweigl Avatar asked Nov 29 '12 10:11

fweigl


2 Answers

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;
like image 74
TLama Avatar answered Sep 23 '22 17:09

TLama


....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
like image 34
Anders Avatar answered Sep 26 '22 17:09

Anders