Skip to content
⌘ NSIS Forum Archive

Autodetect SectionIn

10 posts

Yathosho#

Autodetect SectionIn

i was wondering if it's possible to let the installer decide, which of my sections are selected and which not (depending on files that are installed on the computer).

tried forum and archive search already 🙂
Yathosho#
i know how to detect my files, the question is, how i can let the installer dynamically decide which sections are enabled
Joost Verburg#
Use the macros in Section.nsh to select or unselect sections based on whatever you detected.
Yathosho#
i used this code in my .onInit section, but it doesn't work

IfFileExists "$WINAMP_DIRECTORY\Plugins\avs\convolution.ape" +1 +2
!insertmacro SelectSection "ConvolutionFilter"
anything wrong with my syntax?
Joost Verburg#
1) Set a define name for your section:

Section "bla" blaname

2) Use ${blaname} as section identifier
Joost Verburg#
It's not a string.

!insertmacro SelectSection "ConvolutionFilter"

should be

!insertmacro SelectSection ${ConvolutionFilter}