Old 3rd February 2011, 09:59   #1
starfighter5
Member
 
starfighter5's Avatar
 
Join Date: Sep 2010
Posts: 66
Custom page not displaying

I am trying to allow a user to select to install one of two versions, if they select version 1 then a certain custom page is displayed, version 2 and another custom page is displayed. My code is below..........

code:
;Page1
Page custom intropage
Function intropage
#Display the page
!insertmacro INSTALLOPTIONS_DISPLAY "intropage"
FunctionEnd

;TypeSelect
Page custom typeselect typeselectleave
Function typeselect
#Display the page
!insertmacro INSTALLOPTIONS_DISPLAY "typeselect"
FunctionEnd

Function typeselectleave
!insertmacro INSTALLOPTIONS_READ $R1 "typeselect" "Field 3" "State"
!insertmacro INSTALLOPTIONS_READ $R2 "typeselect" "Field 4" "State"
${If} $R1 == 1
!insertmacro INSTALLOPTIONS_DISPLAY "version1"
${EndIf}
${If} $R2 == 1
!insertmacro INSTALLOPTIONS_DISPLAY "version2"
${EndIf}
FunctionEnd



For some reason the custom page isnt being displayed when the user selects the option. I know the process is working because if I throw a message box in instead of the INSTALLOPTIONS_DISPLAY it works.

How come my custom page call isnt working within the if statement?
starfighter5 is offline   Reply With Quote
Old 3rd February 2011, 11:26   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
I think you need to point to the ini file, not the name of the page. But InstallOptions has been deprecated for a very long time, you really should switch to nsDialogs as soon as possible.
MSG is offline   Reply With Quote
Old 3rd February 2011, 12:23   #3
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
Besides the comments from MSG, you can only call INSTALLOPTIONS_DISPLAY from the page show function.
So you need to move the code from the typeselectleave function to the show function of the pages 'version1' and 'version2':
code:
Page custom version1
Page custom version2

Function version1
!insertmacro INSTALLOPTIONS_READ $R1 "typeselect" "Field 3" "State"
${If} $R1 == 1
!insertmacro INSTALLOPTIONS_DISPLAY "version1"
${EndIf}
FunctionEnd

Function version2
!insertmacro INSTALLOPTIONS_READ $R1 "typeselect" "Field 4" "State"
${If} $R1 == 0
!insertmacro INSTALLOPTIONS_DISPLAY "version2"
${EndIf}
FunctionEnd

jpderuiter is offline   Reply With Quote
Old 3rd February 2011, 14:47   #4
starfighter5
Member
 
starfighter5's Avatar
 
Join Date: Sep 2010
Posts: 66
Thank for the input, I didn't realise you couldnt call the macro in a leave function.

This is my last project using installoptions! I promise

Learning nsDialogs for my next one!
starfighter5 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