简体   繁体   English

nsis 安装程序 autoexits/ 自动关闭,我正在使用 pre 和 show 函数来显示目录 MUI 页面

[英]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.当我不删除两个处理程序FDRIVEPATHGDRIVEPATH时,即当我不删除行时--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.但是,当我删除两个处理程序FDRIVEPATHGDRIVEPATH时,即当我删除行 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.

相关问题 将 MUI2 用于 NSIS 时,如何修改 MUI_WELCOME_PAGE 中的文本? - How can I modify the text in the MUI_WELCOME_PAGE when using MUI2 for NSIS? NSIS安装程序:安装前在目录页面上运行功能 - NSIS Installer: Run a function at the directory page before installation 按钮插件在 MUI NSIS 安装程序中不能用于多个按钮 - button plugin not working for more than one button in MUI NSIS Installer NSIS 安装程序 MUI_HEADER_TEXT - 这一部分可以是粗体吗? - NSIS Installer MUI_HEADER_TEXT - Can part of this be bold font? 更改 NSIS MUI2 页面上窗口的 z-index - Alter the z-index of windows on a NSIS MUI2 Page 在 MUI NSI 安装程序中单击按钮时填充目录文本框,使用 ButtonEvent 插件 - fill directory textbox on button click in MUI NSI Installer , using ButtonEvent plug-in Inno Setup 安装程序中的嵌入式 CMD(在自定义页面上显示命令输出) - Embedded CMD in Inno Setup installer (show command output on a custom page) 在 NSIS 对话框页面中添加自定义标签,有条件地在 NSIS MUI 目录页面中显示和隐藏标签,如何获取标签的 id - Adding custom labels in NSIS dialog pages, showing and hiding labels in NSIS MUI Directory pages conditionally, how to get the ids of labels 如果使用 NSIS 安装程序在 xml 中为空,则无法更新特定元素的值 - Unable to update value of particular element if it is empty in xml using NSIS installer Nsis 脚本:尝试编写一个脚本,从 zip 文件中提取特定目录并将其添加为安装程序的一部分(可执行文件) - Nsis script: Trying to write a script which extracts specific directory from a zip file and adds it as a part of installer(executable)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM