Archive: disable Back button on welcome page


disable Back button on welcome page
Hi all,

i have create a custom page to make test on user system and configuration before installation my program. this page is not visible and it's for test purpose.

This page is the declare first and i quit the program if requirements are not ok.
I do that to have language specific message. i can't do test in .oninit function because language var is not set yet.

the problem is that on the welcome page i have the back button enabled. So i would like to disable this button.

how can i do that ?

page order :
Page custom testPage ""
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

testpage funstion :

function testPage
; abort if not NT or 2000
call IsWindowsNT
StrCmp $CSWAVEIsNT 0 0 lbl_continue
MessageBox MB_ICONSTOP|MB_OK $(CSWAVEDLG_Not_NT)
Quit
lbl_continue:

; abort if wacontrol has been install before
ReadRegStr $0 HKLM "${PRODUCT_WACONTROL_REGKEY}" "AppPath"
strcmp $0 "" lbl_testpage_ok 0
MessageBox MB_ICONSTOP|MB_OK $(CSWAVEDLG_WaControl_Already_Install)
Quit
lbl_testpage_ok:
functionEnd


Simply use BackEnabled in the SETTINGS section of the INI file.


ok. thanks for the tips.

this means that a INI file is mandatory to disable back button, even if my test page is not shown to the user...

guillaume


No, you can also use GetDlgItem and EnableWindow to do that. But I don't see why you'd want to prevent the user from going back.

GetDlgItem $0 $HWNDPARENT 3
EnableWindow $0 0

i want to prevent user for going back because there is no visible page before, and if they clic back button setup program close without any messsage.

where should i put this code ? in my testPage function ? i suppose this must be in the welcome page function, no ? bu t i can't find how to add custom function to the welcome page.

code:GetDlgItem $0 $HWNDPARENT 3
EnableWindow $0 0


Use that code in the show callback function of the welcome page or modify the INI using WriteINIStr in the pre callback function of the welcome page.

But a better overall solution would be doing these tests in .onInit or .onGUIInit instead of creating a dummy empty page for them.


great, i don't understand why i can't find help for the .onGUIInit function ...

your right it's better to do that in this function.

thanks.


I found this thread helpful. I wanted to get rid of the back button in my license page and I had a custom page before it with a couple dialouge boxes in it.

I just put the dialouge boxes in the .oninit function instead of the custom page and now theres no back button on my license page.