empezar
24th July 2007 08:45 UTC
finish page questions
I'm having some problems with the finish page:
1. I added a custom page that sometimes does not get displayed AFTER the instpage. This causes the finish page to have an ENABLED Back button, which will make the installer go back to the instpage if this custom page does not get shown (if there are no errors during the installation). How do I make the finish page disable the Back button when there were no errors (Unless $ERRORS > 0)?
2. My installer automatically becomes an offline installer, customizing all the pages to suit such an installer. However, the finish page still has a checkbox with "Visit the community site", which I want to remove IF the installer goes offline. How do I modify the finishpage's appearance "on the fly". So if you click "Yes, I am offline" during the initialization of the installation, the installer removes the community site link on the finish page?
Here's a picture of my finish page:
http://f.nu/nquake/finishpage.png
Afrow UK
24th July 2007 10:29 UTC
1.
StrCmp $ERRORS 0 +3
GetDlgItem $R0 $HWNDPARENT 3
EnableWindow $R0 0
2.
Use the dialer plug-in to check the internet connection status and then you can hide the control in the finish page's show function:
!include WinMessages.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinishShow
!insertmacro MUI_PAGE_FINISH
...
Function FinishShow
...
!insertmacro MUI_INSTALLOPTIONS_READ $R0 ioSpecial.ini "Field #" "HWND"
ShowWindow $R0 ${SW_HIDE}
skip:
FunctionEnd
Stu
empezar
24th July 2007 18:36 UTC
where do I put all this stuff?
empezar
24th July 2007 22:07 UTC
and what is winmessages.nsh?
ioSpecial.ini?
i have no clue whatsoever how to incorporate your code into my installer.
i've tried putting it in but no cigar.
Afrow UK
24th July 2007 23:52 UTC
The first code snippet will disable the back button depending on the value of $ERRORS. You want to call it like so:
!define MUI_PAGE_CUSTOMFUNCTION_SHOW InstFilesShow
!insertmacro MUI_PAGE_INSTFILES
Function InstFilesShow
StrCmp $ERRORS 0 +3
GetDlgItem $R0 $HWNDPARENT 3
EnableWindow $R0 0
FunctionEnd
As for the second code snippet, WinMessages.nsh contains exactly that, definitions for control window messages (the code snippet uses SW_HIDE). The MUI finish page is actually an InstallOptions page and ioSpecial.ini is the InstallOptions INI file that it uses. If you give it the correct # for Field # then you can hide the check box if the user is not connected. Look at the dialer plug-in readme.
I'm not sure why I'm telling you so much you could do some homework :p
Stu
empezar
25th July 2007 09:35 UTC
I'm extremely grateful, you are saving me a lot of work that I can put into school instead.
empezar
25th July 2007 10:05 UTC
this worked awesomely!
now one last question if you don't mind :)
how do I modify the text on the first page during the installation? the welcome page. it says "this is an online installer", but when an internet connection is missing - it's not!
empezar
25th July 2007 10:55 UTC
solved it myself this time!
this is how i did it:
!define MUI_PAGE_CUSTOMFUNCTION_PRE "WelcomeShow"
!insertmacro MUI_PAGE_WELCOME
...
Function WelcomeShow
StrCmp $OFFLINE 0 +2
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "This is an offline installer..."
FunctionEnd