Question

Comment une section cachée sous condition à cocher ou décocher des boutons radio dans MUI NSIS installation des composants de dialogue page.

J'ai ajouté 2 RadioButtons, DEMO & BACKUP.

Lorsque l'utilisateur choisit, DEMO RadioButton, puis la section affichée sera « INSTALLER DES DONNÉES OU NON », il peut être cochée ou décochée par l'utilisateur, et la section « DONNÉES DE SAUVEGARDE OU NON » serait caché.

Lorsque l'utilisateur choisit, BACKUP RadioButton, puis la section affichée sera « DONNÉES DE SAUVEGARDE OU NON », il peut être cochée ou décochée par l'utilisateur, et la section « INSTALLATION DE DONNÉES OU NON » serait caché.

Si je utilise le signe -, puis la section « INSTALLATION DE DONNÉES OU NON » est caché pour les deux choix de radioButton, à savoir pour DEMO aussi et UPDATE aussi, s'il vous plaît aider.

En outre, il existe des caractéristiques de SelectSection ou UnSelectSection, mais ils ne cachent pas la section, qui est ce que je veux, que la Section doit être caché et sans contrôle.

Était-ce utile?

La solution

Une section cachée n'a pas de nom si vous devez lui donner un nom pour qu'elle devienne visible à nouveau:

!include Logiclib.nsh
!include Sections.nsh

page Components InitComponentsPage

!define INSTALLSECTIONNAME "Install"
section "" SEC_INSTALL
sectionend

!define BACKUPSECTIONNAME "Backup"
section "" SEC_BACKUP
sectionend

Function InitComponentsPage
${If} $InstallType == BACKUP
    SectionSetText ${SEC_BACKUP} "${BACKUPSECTIONNAME}"
    !insertmacro UnSelectSection ${SEC_INSTALL}
    SectionSetText ${SEC_INSTALL} ""
${Else}
    SectionSetText ${SEC_INSTALL} "${INSTALLSECTIONNAME}"
    !insertmacro UnSelectSection ${SEC_BACKUP}
    SectionSetText ${SEC_BACKUP} ""
${EndIf}
Functionend
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top