[Solved] Cant understand why ${NSD_GetState} $Checkbox is not working


There is so much unrelated code in your example that it is a bit hard to understand what you really want to do.

If you want to retrieve the state of a checkbox on another page then you must save the state because the checkbox control is destroyed when you leave the page.

!include nsDialogs.nsh

Var hwndCheckbox
Var CheckboxState
Page Custom myPageWithCombobox myPageWithComboboxLeaveCallback
Page Custom myPageWithComboState



Function .onInit
StrCpy $CheckboxState ${BST_CHECKED} ; Set the initial state. This is optional but useful if you use $CheckboxState in a section when the installer is silent
FunctionEnd

Function myPageWithCombobox
nsDialogs::Create 1018
Pop $0

${NSD_CreateCheckbox} 80 203 100% 10u $(DrivePage_Text2)
Pop $hwndCheckbox
${NSD_SetState} $hwndCheckbox $CheckboxState ; Reuse the existing state so it is correct when the back button is used

nsDialogs::Show
FunctionEnd

Function myPageWithComboboxLeaveCallback
${NSD_GetState} $hwndCheckbox $CheckboxState ; Save the state so we can retrieve it on the next page
FunctionEnd



Function myPageWithComboState
nsDialogs::Create 1018
Pop $0

${NSD_CreateLabel} 0 0 100% 160 CheckboxState=$CheckboxState
Pop $0

nsDialogs::Show
FunctionEnd

0

solved Cant understand why ${NSD_GetState} $Checkbox is not working