Archive: Show CustomPage


Show CustomPage
Hi everybody, i think you can Help me.
I have a custom page, which only should be shown if a RegKey exists. When the key exists i call the function of the custom page, but the page was not displayed.

Code:
!insertmacro IfKeyExists "HKLM" "blabla" "blabla"
Pop $R0
strCmp $R0 1 keyexists keynotexists
keyexists:
Call Update
keynotexists:
[...]
Function Update
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE3)" "$(TEXT_IO_SUBTITLE3)"
!insertmacro MUI_INSTALLOPTIONS_write "Update.ini" "Field 1" "State" "Update"
!insertmacro MUI_INSTALLOPTIONS_write "Update.ini" "Field 2" "State" "Löschen"
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $HWNDPARENT 2 ; bouton précédent
ShowWindow $1 ${SW_HIDE}
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "Update.ini"

Messagebox MB_OK "Update"
Functionend

*-----
the only thing that is visible is the Messagebox

pls help


does not work this way :)

it's other way round. once the page is displayed, it calls the show function where you can now modify the page. the show function itself will NOT make the page visible.

you'll need to do the check directly in the show function of the page:


Function Update
!insertmacro IfKeyExists "HKLM" "blabla" "blabla"
Pop $R0
strCmp $R0 1 keyexists
Abort
...

FunctionEnd

You shouldn't call that function, you should point to it with the Page command. See Examples\InstallOptions for code examples. See the following for an example of conditionally displaying a custom page:

http://nsis.sourceforge.net/Show_cus..._been_selected