简体   繁体   English

按钮插件在 MUI NSIS 安装程序中不能用于多个按钮

[英]button plugin not working for more than one button in MUI NSIS Installer

In GetButtonID function, when more than one button event handler is given,then it autoexits before showing the Directory MUI page dialog.在 GetButtonID function 中,当给出多个按钮事件处理程序时,它会在显示目录 MUI 页面对话框之前自动退出。 But, when only one button event handler is given, then the Directory page is displayed without any problems.但是,当只给出一个按钮事件处理程序时,目录页面显示没有任何问题。

!include "MUI2.nsh"

!define IDC_BUTTON_CDRIVEPATH 1200
!define IDC_BUTTON_DDRIVEPATH 1201

;---------------------------------------
;Name and file
Name Remove_ERROR
OutFile solve_error.exe
; -------------------------------

!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\setup.ico" ;
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\icon.bmp" 
!define MUI_WELCOMEFINISHPAGE_BITMAP"${NSISDIR}\Contrib\Graphics\Wizard\img.bmp" 
!define MUI_ABORTWARNING

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\licensefile.txt"

!define MUI_PAGE_CUSTOMFUNCTION_SHOW GetButtonID **    <---in this function only one button event handler works, if two handlers are given , then installer crashes**

!insertmacro MUI_PAGE_DIRECTORY

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

Function **CDRIVEPATH**
   MessageBox MB_OK|MB_ICONEXCLAMATION "The Software will be installed in : C Drive"
FunctionEnd

Function **DDRIVEPATH**
   MessageBox MB_OK|MB_ICONEXCLAMATION "The Software will be installed in : D Drive"
FunctionEnd
;--------------------------------

Function **GetButtonID** 

GetFunctionAddress $R2 CDRIVEPATH 
ButtonEvent::AddEventHandler ${IDC_BUTTON_CDRIVEPATH} $R2 

;when this second button handler is given ,then installer autoexits as soon as it has to show the Directory MUI Page dialog:

GetFunctionAddress $R3 DDRIVEPATH 
ButtonEvent::AddEventHandler ${IDC_BUTTON_DDRIVEPATH} $R3

FunctionEnd

;------------------------------------------------------------------
Section "INSTALL MAIN SOFTWARE" 

SetOutPath $INSTDIR

File /r "myfolder\*.*"

SectionEnd
;------------------------------------------------------------------

在此处输入图像描述

This behaviour is caused by bug in ButtonEvent.dll plugin.此行为是由 ButtonEvent.dll 插件中的错误引起的。 Get new version of this plugin to resolve it.获取这个插件的新版本来解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NSIS 安装程序 MUI_HEADER_TEXT - 这一部分可以是粗体吗? - NSIS Installer MUI_HEADER_TEXT - Can part of this be bold font? 在 MUI NSI 安装程序中单击按钮时填充目录文本框,使用 ButtonEvent 插件 - fill directory textbox on button click in MUI NSI Installer , using ButtonEvent plug-in nsis 安装程序 autoexits/ 自动关闭,我正在使用 pre 和 show 函数来显示目录 MUI 页面 - nsis installer autoexits/ closes automatically , i am using pre and show functions to show a directory MUI page NSIS - 如何使“安装”按钮始终处于启用状态 - NSIS - How to make "Install" button always to be enabled wix,InnoSetup,nsis的安装程序开销 - Installer overhead of wix, InnoSetup, nsis 为什么即使只选中了一个应用程序复选框,NSIS 安装程序也会为两个应用程序安装运行两次? - Why does NSIS installer run twice for two application installation even if only one app checkbox is selected? NSIS:如何获得完成和下一步按钮? - NSIS: How to get a finish- and a next-button? nsis-加载插件dll - nsis - load plugin dll NSIS安装程序访问引擎检查是否已安装 - NSIS installer access engine check if installed 根据选择的单选按钮有条件地隐藏 nsis 安装程序中的部分 - hide section in nsis installer conditionally on choice of radiobuttons
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM