Utilisez le .onSelChange callback.
Dans NSIS 3 l'id de la section modifiée est stockée dans $ 0:
Page Components
Page InstFiles
Section /o "Foo" SID_FOO
SectionEnd
Section "Bar"
SectionEnd
!include LogicLib.nsh
Function .onSelChange
${If} ${SectionIsSelected} ${SID_FOO}
${AndIf} $0 = ${SID_FOO}
MessageBox MB_ICONEXCLAMATION "Warning, section Foo selected!"
${EndIf}
FunctionEnd
Vous devez suivre l'état-vous dans NSIS 2:
Page Components
Page InstFiles
Section /o "Foo" SID_FOO
SectionEnd
Section "Bar"
SectionEnd
!include LogicLib.nsh
Var hasWarned
Function .onSelChange
${If} ${SectionIsSelected} ${SID_FOO}
${AndIf} $hasWarned = 0
StrCpy $hasWarned 1
MessageBox MB_ICONEXCLAMATION "Warning, section Foo selected!"
${EndIf}
/* Uncomment this to display the warning every time it is selected
${IfNot} ${SectionIsSelected} ${SID_FOO}
StrCpy $hasWarned 0
${EndIf}
*/
FunctionEnd
Avez-vous regardé la page de documentation? http://nsis.sourceforge.net/Reference/MessageBox Vous voudrez probablement utiliser 'MB_ICONEXCLAMATION' – MateoConLechuga
@MateoConLechuga Je veux dire vérifier l'événement (cliquez sur le contrôle case à cocher), ne pas afficher un message – user2455111