ginglese
20th November 2006 17:05 UTC
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
kichik
21st November 2006 18:36 UTC
Simply use BackEnabled in the SETTINGS section of the INI file.
ginglese
23rd November 2006 09:33 UTC
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
kichik
23rd November 2006 17:46 UTC
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
ginglese
27th November 2006 08:49 UTC
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
kichik
27th November 2006 12:38 UTC
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.
ginglese
27th November 2006 16:17 UTC
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.
jackkoho
26th April 2007 18:48 UTC
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.