I was forced to use labels in my installer like this:
IfFileExists "$INSTDIR\XX\*.*" XX_Found 0
!insertmacro UnselectSection ${Section_XX}
XX_Found:
IfFileExists "$INSTDIR\YY\*.*" YY_Found 0
!insertmacro UnselectSection ${Section_YY}
YY_Found:
because these does not work:
IfFileExists "$INSTDIR\XX\*.*" +2 0
!insertmacro UnselectSection ${Section_XX}
IfFileExists "$INSTDIR\YY\*.*" +2 0
!insertmacro UnselectSection ${Section_YY}
Any proposal why? I think its because of !insertmacro statement but i could not find any information or workaround on the internet.