Old 13th July 2007, 22:43   #1
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
async Leave callback for MUI page causing evilness

I have a verification function as a callback when you leave the Components Page, i.e.:
code:

!define MUI_PAGE_CUSTOMFUNCTION_LEAVE verifyComponentReqs
!insertmacro MUI_PAGE_COMPONENTS


Unfortunately during this process you can still click on the Components Page. You can select/deselect components, click install again, which can lead to corrupt installer messages and installer crashes.

I display a banner in the method, but it takes 1-2 seconds to load the DLL so you can still click on the buttons. I disable the Install button, but you can still select components. Is there a way to lock the dialog? I have a few ideas on workarounds:

A) Load the banner DLL earlier. Is there a way to load a plugin DLL explicitly without calling a plugin function? I suppose I can do "Banner::destroy /NOUNLOAD" but that seem really hacky.

B) Use the next page's PRE callback instead, and then go back to the Components Page if the conditions aren't met. But this isn't ideal from a usability standpoint because it will seem to the user that they're already in the install progress, which they're not.

I'd appreciate any suggestions/corrections.

Thanks,
bobics
bobics is offline   Reply With Quote
Old 14th July 2007, 01:02   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,358
why not just disable the component list aswell?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 14th July 2007, 07:54   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I cannot reproduce this. Please attach a complete example.

As for loading the Banner faster, it's probably due to the solid compression. Simply ReserveFile it on the top of the script.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 16th July 2007, 19:17   #4
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
I spent some time stripping down my installer and discovered that it has something to do with the FindProcDLL I'm using, http://nsis.sourceforge.net/FindProcDLL_plug-in (although it may not be *specific* to that DLL). If you double-click on "install" very quickly, you should see the error. I've included the repro script below, and attached a screenshot of the error.

code:

SetCompressor /solid lzma

;---- MUI ------------------
!include "MUI.nsh"

; Component selection page
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE verifyComponentReqs
!insertmacro MUI_PAGE_COMPONENTS
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES

;--- Project Settings --------
OutFile "Stripped_Installer.exe"

Section
SetOutPath "C:\test_comp_page_click"
SetOverwrite on
File /r "C:\Program Files\NSIS\*"
SectionEnd

Function verifyComponentReqs
FindProcDLL::FindProc "does_not_exist.exe"
FunctionEnd

Attached Images
File Type: png corrupted_installer.png (11.7 KB, 479 views)
bobics is offline   Reply With Quote
Old 16th July 2007, 19:28   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I still can't reproduce. Which version of NSIS are you using?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 16th July 2007, 19:38   #6
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
NSIS 2.28 - I am using several other plugins (but as I understand it, they won't be include if they aren't used).

Otherwise the only file that's different from a stock install is the Banner.dll (due to the banner hanging bug, forums.winamp.com/showthread.php?s=&threadid=270838&highlight=banner)

You have to double-click very quickly in this sample... perhaps your computer is too fast? In my production script you can wait a few seconds before the second click and still see the error.
bobics is offline   Reply With Quote
Old 16th July 2007, 22:20   #7
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
Anders - thanks for you suggestion. In case anyone else might find it useful, I used the following:

code:

FindWindow $1 "#32770" "" $HWNDPARENT
FindWindow $1 "SysTreeView32" "" $1
EnableWindow $1 0



kichik - Since I'm using the above workaround, I think our installer is okay for now but it's still probably better to figure out why the dialog is not blocking. Would it help if I performed a clean install of NSIS and try to repro?
bobics is offline   Reply With Quote
Old 16th July 2007, 22:25   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Please attach your script.

Stu
Afrow UK is offline   Reply With Quote
Old 16th July 2007, 22:38   #9
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
Hi Stu - I pasted the script in its entirety above, but here it is again as an attachment.

Thanks - Andy
Attached Files
File Type: nsi test.nsi (527 Bytes, 551 views)
bobics is offline   Reply With Quote
Old 17th July 2007, 11:43   #10
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Not that one
I mean your actual script because we cannot reproduce the problem with that one.

Stu
Afrow UK is offline   Reply With Quote
Old 17th July 2007, 20:02   #11
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
Unfortunately I don't think my company would allow me to post my script in it's entirety... what I can do is try to come up with a more reproducible case. I'll post again when I do. Also if it helps I can make available a compiled setup.
bobics is offline   Reply With Quote
Old 3rd October 2007, 22:08   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Thanks, fixed. The decompression function messed with the message loop when it shouldn't have.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 4th October 2007, 01:00   #13
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
Thanks for the fix and update!
bobics is offline   Reply With Quote
Old 17th October 2007, 22:23   #14
bobics
Junior Member
 
Join Date: May 2006
Location: San Francisco, CA
Posts: 25
Hmm, I just added a custom dialog using nsDialogs.nsh and I saw the same type of installer crash when clicking on the "Next" button really quickly twice. So I think this bug still exists.

I'm using the same workaround of disabling the next button in the leave callback of the custom dialog.
bobics is offline   Reply With Quote
Old 9th November 2007, 17:46   #15
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
I can't reproduce. I'll need an example again.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump