Archive: Autodetect SectionIn


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 :)


You have to add your own detection method.


i know how to detect my files, the question is, how i can let the installer dynamically decide which sections are enabled


Use the macros in Section.nsh to select or unselect sections based on whatever you detected.


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?

1) Set a define name for your section:

Section "bla" blaname

2) Use ${blaname} as section identifier


thanks a lot!


It's not a string.

!insertmacro SelectSection "ConvolutionFilter"

should be

!insertmacro SelectSection ${ConvolutionFilter}


Also, use labels instead of "+2": SelectSection may be made up of more than one command.


yeah, just used "+2" for the example i pasted. thanks anyway!