Skip to content
⌘ NSIS Forum Archive

NSIS2 + Modern UI + Control 'back' button

6 posts

kikolo#

NSIS2 + Modern UI + Control 'back' button

Hi,
I have an installer that have 3 custom pages w/ io, and i do some operations before and after and when the user clicks back, i want to do nothing after displaying.
note: i cant do before display the next custom page.
not using the modern ui i will try the next
Function CP_SetDBEngine
;if the section is checked continue else exit
SectionGetFlags ${SecEnvironment} $0
IntCmp $0 1 lbl_SetDBSetup_Continue
Goto lbl_SetDBSetup_Exit

lbl_SetDBSetup_Continue:

;some instructions

installoptions::show "ioDBSetup.ini"
Pop $0

StrCmp $0 "success" "" lbl_SetDBSetup_Exit

;some instructions

messagebox mb_ok "hey! it continues!"

lbl_SetDBSetup_Exit:
FunctionEnd
trying with modern ui, this code always goes lbl_SetDBSetup_Exit
Function CP_SetDBEngine
;if the section is checked continue else exit
SectionGetFlags ${SecEnvironment} $0
IntCmp $0 1 lbl_SetDBSetup_Continue
Abort
lbl_SetDBSetup_Continue:

;some instructions

!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioDBSetup.ini"
Pop $0

StrCmp $0 "success" "" lbl_SetDBSetup_Exit

;some instructions

messagebox mb_ok "hey! it continues!"

lbl_SetDBSetup_Exit:
FunctionEnd
someone knows how can i do this?
thanks & sorry about my poor english 🙄
kichik#
The Modern UI macro MUI_INSTALLOPTIONS_DISPLAY "eats" the return value of InstallOptions for you. The macro only calls InstallOptions and "eats" the return value so you can use the normal InstallOptions::show.

BTW, welcome to the forums 😁
kikolo#
dark_boy: y eso? a que viene?
kichik: thanks. 😁 it works with next code:

; some instructions
Push $0
InstallOptions::dialog "$PLUGINSDIR\ioDBSetup.ini"
Pop $0
StrCmp "$0" "success" lbl_DBSetup_Display_Success
Abort

lbl_DBSetup_Display_Success:
;next instructions
kichik#
This is an English forum. Please speak English only, and if you don't at least add a translation so everyone can understand.
Joel#
OOPS, sorry !!!!

Lo siento 😁, fue importante saber que hay personas en este
foro que hablen mi propio idioma

Sorry 😁, was important to know that are people in this forum that
speak my language....

I'll never happen again...sorry, dudes 😁 😛