Old 7th October 2006, 14:57   #1
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
Question custom page won't show

I'm stuck on a problem. I have an installer that works fine if you run it normally, but when it gets run by another process, it fails at the point where it tries to show the first page, which is a custom page.

If I make the first page a MUI page, everything works fine. Or if I display a MessageBox before I try to show the custom page, the custom page will appear.

Here's what I've tried:
-verify custom page init works by writing its HWND to registry
-verify custom page ini file is valid (looks fine and works fine if there's a MB before init)
-system calls ShowWindow and SetWinowPos don't help and their return values indicate success even though the window is not visible

The process just sits there. The command line parameters don't contain '/S.' I am using !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS.

I can't attach my script, but does anyone have ideas from my description?

Thanks.
dienjd is offline   Reply With Quote
Old 7th October 2006, 14:56   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Code snippet would help.

-Stu
Afrow UK is offline   Reply With Quote
Old 7th October 2006, 15:09   #3
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
My company is strict about this, so here's the best I can do.

code:

WriteRegStr HKLM "Software\Poop" "cmdline" "$CMDLINE"

!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "file.ini"

Pop $MUI_HWND

;...
;irrelevant page formatting code

WriteRegStr HKLM "Software\Poop" "preshow" "show"
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW

WriteRegStr HKLM "Software\Poop" "hwnd" "$MUI_HWND"
ShowWindow $MUI_HWND 1
System::Call 'user32::SetWindowPos(i $HWNDPARENT, i -1, i 0, i 0, i 0, i 0, i 0x02|0x01) i.r1'
WriteRegStr HKLM "Software\Poop" "return" "$1"
System::Call 'user32::ShowWindow(i $MUI_HWND, i 1) i .r0'

!insertmacro MUI_INSTALLOPTIONS_SHOW
WriteRegStr HKLM "Software\Poop" "postshow" "show"



"postshow" never gets written to the registry. It does when I manually launch the installer though, which tells me the problem probably isn't in the custom page code. I guess I should look more at the interaction between the launching process and the installer.
dienjd is offline   Reply With Quote
Old 7th October 2006, 15:24   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I'm not sure what you're trying to do.
What's wrong with this?

code:
Page Custom CustomShow

Function CustomShow
!insertmacro MUI_INSTALLOPTIONS_DIALOG file.ini
FunctionEnd



-Stu
Afrow UK is offline   Reply With Quote
Old 7th October 2006, 15:32   #5
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
arghhhhhhhhhh!!!!

Just found out that this is only happening for me on a virtual machine. When I try on my own machine, it works ok. Should have thought of that sooner.

Stu, thanks for your suggestions. To answer your question, I was initializing my custom page, then formatting some text, and then showing it.
dienjd is offline   Reply With Quote
Old 7th October 2006, 15:38   #6
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
Let me also say that I'm impressed you were able to post your first response a minute before I even opened the thread

Please use your psychic powers for good and not evil!
dienjd is offline   Reply With Quote
Old 8th October 2006, 09:31   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
On the machine that it doesn't show, does the file.ini file get extracted?

-Stu
Afrow UK 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