Archive: Check section by rule


Check section by rule
Could you give someone exaple how check section if I find some string in registry?
Eg. I have a lot of version program for which is make this setup. I recognize in registry that progam is install, but how automatic activate checbox with relevant section of files?

Thanks for reply


Name "My Application"
OutFile 'test.exe'
LicenseData '${NSISDIR}\License.txt'
InstallDir '$PROGRAMFILES\$(^name)'
ShowInstDetails show

Page License
Page Components comp_pre
Page Directory
Page InstFiles

Section "!Required Section" sec1
SetOutPath "$INSTDIR"
detailprint "Required Section: Always installed"
SectionEnd

section /o "Install NSIS Plugin" sec2
Setoutpath "$0"
detailprint "Section: Install NSIS Plugin"
sectionend

section /o "Install Dummy Plugin" sec3
Setoutpath "$1"
detailprint "Section: Install Dummy Plugin"
sectionend

function comp_pre
ReadRegStr $0 HKLM "Software\NSIS" ""
Iferrors 0 +3
sectionsettext ${sec2} ""
goto +2
sectionsetflags ${sec2} 1
clearerrors
ReadRegStr $1 HKLM "Software\Dummy" ""
Iferrors 0 +3
sectionsettext ${sec3} ""
goto +2
sectionsetflags ${sec3} 1
functionend