[英]nsis installer autoexits/ closes automatically , i am using pre and show functions to show a directory MUI page
i am building an installer using nsis.我正在使用 nsis 构建安装程序。 i have added 5 buttons using resource hacker on the Directory Page Dialog of the installer.
我在安装程序的目录页面对话框中使用资源黑客添加了 5 个按钮。 also i have defined these functions:
我也定义了这些功能:
!define IDC_BUTTON_CDRIVEPATH 1200
!define IDC_BUTTON_DDRIVEPATH 1201
!define IDC_BUTTON_EDRIVEPATH 1202
!define IDC_BUTTON_FDRIVEPATH 1203
!define IDC_BUTTON_GDRIVEPATH 1204
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\licensefile.txt"
!define MUI_PAGE_CUSTOMFUNCTION_PRE DirectoryPre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW DirectoryShow
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
Function DirectoryShow
GetFunctionAddress $R0 DDRIVEPATH
ButtonEvent::AddEventHandler ${IDC_BUTTON_DDRIVEPATH} $R0
FunctionEnd
Function DirectoryPre
GetFunctionAddress $R6 EDRIVEPATH
ButtonEvent::AddEventHandler ${IDC_BUTTON_EDRIVEPATH} $R6
line 1-- GetFunctionAddress $R7 FDRIVEPATH
line 2-- ButtonEvent::AddEventHandler ${IDC_BUTTON_FDRIVEPATH} $R7
line 3-- GetFunctionAddress $R8 GDRIVEPATH
line 4-- ButtonEvent::AddEventHandler ${IDC_BUTTON_GDRIVEPATH} $R8
FunctionEnd
When i do not remove the two handlers FDRIVEPATH & GDRIVEPATH ,ie when i do not remove the lines--LINE 1,2,3,4, then,-------------when i goto COMPONENTS page, and press the BACK button to go back to the DIRECTORY page, then the installer exits automatically.当我不删除两个处理程序FDRIVEPATH和GDRIVEPATH时,即当我不删除行时--LINE 1,2,3,4,然后,-------------当我转到 COMPONENTS页面,然后按 BACK 按钮 go 回到 DIRECTORY 页面,然后安装程序自动退出。 i don't know why its happening.?
我不知道为什么会这样。? please help?
请帮忙? am stuck with it since two days.
我坚持了两天。
BUT, when i remove the two handlers FDRIVEPATH & GDRIVEPATH ,ie when i remove the lines--LINE 1,2,3,4, then, the installer runs properly.但是,当我删除两个处理程序FDRIVEPATH和GDRIVEPATH时,即当我删除行 1、2、3、4 时,安装程序运行正常。
I want all the handlers for these five buttons.我想要这五个按钮的所有处理程序。 i dont want to remove any of them.
我不想删除它们中的任何一个。
FOLLOWING IS MY DIRECTORY PAGE DIALOG:---------以下是我的目录页面对话框:---------
Use ComboBox or ListBox which will be filled with all drives letters to save space.使用 ComboBox 或 ListBox 将填充所有驱动器号以节省空间。
ComboBox created with nsDialogs:使用 nsDialogs 创建的 ComboBox:
Var CB_Buttons
${NSD_CreateComboBox} 0 20 32% 100 ""
Pop $CB_Buttons
${NSD_CB_AddString} $CB_Buttons "A:\"
${NSD_CB_AddString} $CB_Buttons "B:\"
${NSD_CB_AddString} $CB_Buttons "C:\"
etc.
THE BUTTON EVENT PLUGIN WAS HAVING A BUG, WHICH HAS BEEN FIXED BY THE PLUG-IN DEVELOPER, Mr. Afrow UK.按钮事件插件有一个错误,该错误已由插件开发人员 Afrow UK 先生修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.