5

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?

fweigl
  • 21,278
  • 20
  • 114
  • 205
  • 1
    Well, speaking about InnoSetup, those dialogs would have been to be replaced by custom ones (since they're Windows') and that is from script impossible. On wizard pages it's not a problem. Animated GIFs, no support without some extension. – TLama Nov 29 '12 at 10:27
  • Could you provide me a link or a small example on how to make the banner image clickable? I can't find anything on Google. – fweigl Nov 29 '12 at 10:46
  • Depends on what you mean by banner image. Rather post a screenshot of how would you imagine that banner. For instance [`the top area`](http://i.imgur.com/qskGJ.png) ? – TLama Nov 29 '12 at 10:53
  • I thought about the banner on the left of the first page http://tinypic.com/r/vrsm11/6 but an example for the top area would be nice too :) – fweigl Nov 29 '12 at 11:01
  • 1
    mmmm, breakfast burger... :) – Deanna Nov 29 '12 at 11:26

3 Answers3

5

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;
TLama
  • 75,147
  • 17
  • 214
  • 392
3

....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
Anders
  • 97,548
  • 12
  • 110
  • 164
2

If you want to implement a gif image, you can use this extension:

GifCTRL 2.1

It's Chinese but the example Inno script shows everything you need.

user1662035
  • 363
  • 4
  • 13