我需要使用NSIS或InnoSetup制作Windows安装程序。客户希望在安装程序对话框/向导页面中显示图像,并且图像需要是可点击的,例如,单击时打开浏览器窗口。 这可能吗?如果是,是否也可以使用GIF动画?
答案 0 :(得分:5)
要使欢迎页面的左侧图像可点击,您可以使用以下内容:
[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;
答案 1 :(得分:3)
....和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
答案 2 :(得分:2)