NSIS v2.51 (updating to more recent would force me to rewrite some code and from memory, some things was not running in v3.x).
Install (custom, related with this post) path page is displayed before Components page (sections).
I'm trying to select or unselect a section if a specific file exists in the install path (defined at the previous page).
I tried some diffferent codes but I still get the same "unknown variable/constant ${SecDemo} detected" at compilation 🙁
Here is a a part of code:
How can I fix this error ?
Function OnChange_Path
${NSD_GetText} $Path $Path_State
Call TestNewInst
FunctionEnd
!macro SECOFF Sec
SectionSetFlags ${Sec} 0
!macroend
!macro SECON Sec
SectionSetFlags ${Sec} 1
!macroend
Function TestNewInst
IfFileExists "$Path_State\file.ini" iniyes inino
iniyes:
MessageBox MB_ICONEXCLAMATION "Exists"
!insertmacro SECOFF "${SecDemo}"
Goto afterini
inino:
!insertmacro SECON "${SecDemo}"
Goto afterini
afterini:
FunctionEnd
Thanks 🙂