开发者

nsis installer autoexits/ closes automatically , i am using pre and show functions to show a directory MUI page

开发者 https://www.devze.com 2023-03-02 17:22 出处:网络
i am building an installer using nsis. i have added 5 buttons using resource hacker on the Directory Page Dialog of the installer. also i have defined these functions:

i am building an installer using nsis. i have added 5 buttons using resource hacker on the Directory Page Dialog of the installer. 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,i.e. 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. 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,i.e. when i remove the lines--LINE 1,2,3,4, then, the installer runs properly.

I want all the handlers for these five buttons. i dont want to remove any of them.

FOLLOWING IS MY DIRECTORY PAGE DIALOG:---------

nsis installer autoexits/ closes automatically , i am using pre and show functions to show a directory MUI page


Use ComboBox or ListBox which will be filled with all drives letters to save space.

ComboBox created with nsDialogs:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消