- NSIS Discussion
- CustomPage depending on section selection
Archive: CustomPage depending on section selection
Mosestycoon
29th March 2003 19:24 UTC
CustomPage depending on section selection
I am looking for a solution to show a custompage only when a specific section is checked at MUI_COMPONENTSPAGE.
I know there was a thread a few days agon but I can't find it anymore. By the way the solution there was not that understandable for me ;)
Could somebody re-explain?
Thx
Chris
deguix
29th March 2003 19:44 UTC
I found the post, and I put the code here!
define SF_SELECTED 1
Page custom CustomPageName
>Function CustomPageName
SectionGetFlags$0 ${SectionDefineName}
StrCmp $0 ${SF_SELECTED} 0 skipPage
# show page here ...
# InstallOptions::dialog....
skipPage:
>FunctionEnd
>
Mosestycoon
29th March 2003 19:47 UTC
Could you also post the link to the thread deguix?
kichik
29th March 2003 19:57 UTC
Will be better to IntOp $0 $0 & ${SF_SELECTED} before you compare.
Mosestycoon
29th March 2003 20:01 UTC
:igor:
???
KichiK, sorry can't interpret your post
:igor:
Chris
Mosestycoon
29th March 2003 20:02 UTC
By the way,
integration of deguix-solution forces the following compiler output:
"SetCustomA"
>!define: "SF_SELECTED"="1"
>Usage: SectionGetFlags section_index $(user_var: output flags)
>Error in script "C:\NSIS\TSW\tsw.nsi" on line 1152 -- aborting creation process
>
with that function:
SetCustomA
;; TEST
!define SF_SELECTED 1
SectionGetFlags$0 ${secMySQL4}
StrCmp $0 ${SF_SELECTED} 0 skipPage
;;
!
insertmacro MUI_HEADER_TEXT "$(PAGE_TITLE_MYSQL)" "$(PAGE_SUBTITLE_MYSQL)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
;; TEST
skipPage:
>FunctionEnd
>
deguix
29th March 2003 20:02 UTC
Kichik said this (that I understand):
define SF_SELECTED 1
Page custom CustomPageName
>Function CustomPageName
SectionGetFlags$0 ${SectionDefineName}
IntOp $0 $0 & ${SF_SELECTED}
StrCmp $0 ${SF_SELECTED} 0 skipPage
# show page here ...
# InstallOptions::dialog....
skipPage:
>FunctionEnd
>
virtlink
29th March 2003 20:04 UTC
I'm sorry KiCHiK. I don't question your NSIS knowledge. Not at all...
But I think that you mean this:
IntOp $0 $0 | ${SF_SELECTED}
According to
this thread, I think.
kichik
29th March 2003 20:06 UTC
You're wrong.
kichik
29th March 2003 20:08 UTC
deguix you've got it backwards again... It's SectionGetFlags ${SectionDefineName} $0.
!include "Sections.nsh"
Page custom CustomPageName
Function CustomPageName
SectionGetFlags ${SectionDefineName} $0
IntOp $0 $0 & ${SF_SELECTED}
StrCmp $0 ${SF_SELECTED} 0 skipPage
# show page here ...
# InstallOptions::dialog....
skipPage:
FunctionEnd
Mosestycoon
29th March 2003 21:05 UTC
Thx guys -
it works now
Chris