Archive: Custom Install Page


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 */

Anyone ?


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.


I could not find any sample. Can anyone give me such one.


It would help if you'd tell us what it is you want, exactly.


Just wanted to crate a button on the install page. And have a control over that button.


Maybe this is what you want?
http://forums.winamp.com/showthread....ght=add+button

(I searched the forums for 'add button'.)


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


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


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.


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 ?


Okay I have managed to enable the Cancel button by following codes.


GetDlgItem $CancelButtonHandle $HWNDPARENT 2
EnableWindow $CancelButtonHandle 1
>