Archive: Installer just quits running?


Installer just quits running?
Has anybody seen this type of problem? What appears to be happening is that while running the executable, it just quits with no error messages at all.

I have traced it down to trying to display an MUI custom user input page with this statement:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "GMCEIPAddrGet.Ini"

This is being run from a function that is being called from an MUI user input custom page "Leave" function. Are there any restrictions when writing functions from a custom page "leave" function?

I am using NSIS v2.11.

Thanks for any help or suggestions anybody can provide.

Regards
Lane


Instead of using the leave function, try the pre function.


But, what I am trying to do, is to analyse the user's inputs to the custom input page. Based on what the user has entered, I then start doing other stuff.

I read that custom pages don't have a "Pre" callback function?

I'm fairly new to NSIS, so it's all a learning experience for me.


What I tried, was to comment out the line:
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "GMCEIPAddrGet.Ini"
and the installer run further, but eventually dies a bit later on. I must be doing something BAD with the script??

What is the easiest way to debug these kinds of faults?

Thanks


Example:

page custom prefunction "" leavefunction

Function prefunction
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "GMCEIPAddrGet.Ini"
FunctionEnd

Function leavefunction
!insertmacro MUI_INSTALLOPTIONS_READ $0 "GMCEIPAddrGet.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $1 "GMCEIPAddrGet.ini" "Field 3" "State"

; the following line compares the variable $0 to 1,
; if the same, it goes to the next line. If not,
; goes to nofile.
strcmp $0 1 +1 nofile
file "license.txt"
nofile:
strcmp $0 1 installfile nofile1
installfile:
file "history.txt"
nofile1:
FunctionEnd

Edit: please attach a script so I can debug it.


Ok, I tried this. Changed the page line to:
; Select Firmware Downloads Page:
Page custom FirmwareDownloadsSelectPage "" FirmwareDownloadsSelect_LeavePage

But when compiling the script, it warns me that the "Leave" function is not used:
install function "FirmwareDownloadsSelect_LeavePage" not referenced - zeroing code (488-515) out

I did not think that custom pages could have a "Pre" call-back function as well as a "Leave" call-back function?


Duh, I made a stupid mistake. Remove the double quotes in the page command, eg.
page custom pre leave


Yes, this is what I have in the script now.
I have the "Pre" call-back function" (FirmwareDownloadsSelectPage) and the "Leave" call-back function: FirmwareDownloadsSelect_LeavePage.

This is what is not working. maybe there is a bug in the compiler? I initially tried this with NSIS v2.10, and then upgraded to NSIS v2.11, hoping it was a bug that might have been fixed in the newer release.


From earlier post:

Edit: please attach a script so I can debug it.

Ok, I will try to attach a script that shows the problem tommorrow. (Have to leave right now). Thanks for you help so far.

Lane


OK, it I have attached a small NSIS script that show the problem. It looks like you cannot do what I was trying to do; which was to try to display another user input dialog box for the user to enter additional inputs, from a custom page "Leave" call-back function. If I comment out the line:

InstallOptions::dialog "$PLUGINSDIR\test2.ini"
Pop ${TEMP1}

In the function "xxx", then the script/installer runs OK. If I leave it in, then it quits part way through without properly running to completion.

My assumption is then that you need to perform a "limited" amount of processing in a custom page "Leave" call-back function. (and any called functions from it)

If anybody could compile and run this sample, and let me know if you have the same results.

Thanks

Lane


And here is the test.ini file contents:

[Settings]
NumFields=8

[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-5
Text=" This is a group box... "

[Field 2]
Type=checkbox
Text=Install support for X
Left=10
Right=-10
Top=17
Bottom=25
State=0
Flags=GROUP

[Field 3]
Type=checkbox
Text=Install support for Y
Left=10
Right=-10
Top=30
Bottom=38
State=1
Flags=NOTABSTOP

[Field 4]
Type=checkbox
Text=Install support for Z
Left=10
Right=-10
Top=43
Bottom=51
State=0
Flags=NOTABSTOP

[Field 5]
Type=FileRequest
State=C:\poop.poop
Left=10
Right=-10
Top=56
Bottom=68
Filter=Poop Files|*.poop|All files|*.*
Flags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY

[Field 6]
Type=DirRequest
Left=10
Right=-10
Top=73
Bottom=85
Text=Select a directory...
State=C:\Program Files\NSIS

[Field 7]
Type=Label
Left=10
Right=-10
Top=90
Bottom=98
Text=This is a label...

[Field 8]
Type=Text
Left=10
Right=-10
Top=98
Bottom=120
State="Multiline\r\nedit..."
Flags=MULTILINE|VSCROLL|WANTRETURN


And here is the test2.ini file contents:

[Settings]
NumFields=8

[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-4
Text=" This is a group box... "

[Field 2]
Type=checkbox
Text=Install support for X2
Left=10
Right=-10
Top=17
Bottom=25
State=0
Flags=GROUP

[Field 3]
Type=checkbox
Text=Install support for Y2
Left=10
Right=-10
Top=30
Bottom=38
State=1
Flags=NOTABSTOP

[Field 4]
Type=checkbox
Text=Install support for Z2
Left=10
Right=-10
Top=43
Bottom=51
State=0
Flags=NOTABSTOP

[Field 5]
Type=FileRequest
State=*.*
Left=10
Right=-10
Top=56
Bottom=68
Filter=Poop Files|*.poop|All files|*.*
Flags=GROUP|FILE_MUST_EXIST|FILE_EXPLORER|FILE_HIDEREADONLY

[Field 6]
Type=DirRequest
Left=10
Right=-10
Top=73
Bottom=84
Text=Select a directory...
State=C:\Program Files\NSIS

[Field 7]
Type=Label
Left=10
Right=-10
Top=89
Bottom=97
Text=This is a label...

[Field 8]
Type=Text
Left=10
Right=-10
Top=97
Bottom=120
State="Multiline\r\nedit..."
Flags=MULTILINE|VSCROLL|WANTRETURN


Why put it in the Leave function in the first place?
You just need to use another Page Custom instruction along with your existing one.

-Stu


You mean to just use another (or the next one in line) custom page to process and validate the user's input from the previous custom page?

If you do that, won't you have to create another user input page?


OK, Afrow UK's suggestion works.

If I just use another custom page "normal" call-back function it now works properly.

There must be some restrictions as to what you can do in a "Leave" call-back function for custom pages..

Thanks for you help..!!

Lane