- NSIS Discussion
- Custom Install Page
Archive: Custom Install Page
hypheni9
4th August 2010 08:36 UTC
Custom Install Page
I'm using a custom install page and I need to put a cancel button on that page and triggering that button the installation ends and rollback all changes it has done so far.. here is my script sample.
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
Page instfiles "" showInstFiles
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Function showInstFiles
!insertmacro MUI_HEADER_TEXT "Installing Application" "Please wait.."
titprog::Start //titprog is the plugin
FunctionEnd
/* rest of the sections here */
hypheni9
5th August 2010 13:59 UTC
Anyone ?
MSG
5th August 2010 17:10 UTC
Rollback behavior you'll have to create by yourself.
Search these forums for information on how to add a button below a page. If you want to create it on the page itself, just use nsDialogs.
hypheni9
6th August 2010 14:11 UTC
I could not find any sample. Can anyone give me such one.
MSG
6th August 2010 17:12 UTC
It would help if you'd tell us what it is you want, exactly.
hypheni9
6th August 2010 17:13 UTC
Just wanted to crate a button on the install page. And have a control over that button.
MSG
6th August 2010 17:16 UTC
Maybe this is what you want?
http://forums.winamp.com/showthread....ght=add+button
(I searched the forums for 'add button'.)
orecchionebruno
6th August 2010 17:20 UTC
if you want customize a page I found very useful starting from this example:
"..\NSIS\Examples\nsDialogs\welcome.nsi"
in that example you can see how create a button and to use it :D
hypheni9
8th August 2010 09:10 UTC
See, I checked some examples on how to add a custom button, now in my case I dont need to create any extra buttons just need to enable default cancel button on the custom install page. check my posted code
demiller9
8th August 2010 09:21 UTC
I was just about to show you the code to enable the buttons on the bottom of the main dialog, but after re-reading your original post I see that that won't do you any good. The cancel button should already be enabled on a custom page. And when the user clicks it, it will cancel the installer, not call your function to rollback the installation.
You might try putting the rollback code into the .onInstFailed callback function.
hypheni9
8th August 2010 09:25 UTC
Thanks for the .onInstFailed. I'm using TitleProgress plugin and thus using Page instfiles "" showInstFiles. Now in this install window by default the cancel button is disabled.
Im thinking about using FindWindow to find Cancel button then using nsDialog function EnableControlWindow to enable it, Am I going right ?
hypheni9
8th August 2010 10:22 UTC
Okay I have managed to enable the Cancel button by following codes.
GetDlgItem $CancelButtonHandle $HWNDPARENT 2
EnableWindow $CancelButtonHandle 1
>