1 (edited by Antonio 2010-04-22 09:33:46)

Topic: problem whis XPUI_PAGE_CUSTOMFUNCTION_PRE in finish page

1. Why controls are not inserted on page Finish? For example, CheckBox.
name "exp"
outfile "exp.exe"
!include XPUI.nsh
!define XPUI_SKIN "windows xp"
!insertmacro XPUI_PAGE_WELCOME
!define XPUI_PAGE_CUSTOMFUNCTION_PRE finish_pre
!define XPUI_PAGE_CUSTOMFUNCTION_SHOW finish_show
!insertmacro XPUI_PAGE_FINISH
!insertmacro XPUI_LANGUAGE "English"
function finish_pre
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Settings" "Numfields" "6"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 5" "Top" "40"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 5" "Bottom" "70"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Type" "CheckBox"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Text" "Text"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "State" "1"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Left" "30"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Right" "200"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Top" "110"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Bottom" "120"
functionend

function finish_show
Push $0
GetDlgItem $0 $XPUI_HWND 1200
SetCtlColors $0 "000000" "transparent"
Pop $0
functionend
section
sectionend

2. If I insert function XPUI_PAGE_CUSTOMFUNCTION_PRE finish_pre before Welcome page, controls are inserted but the background color sets to defaults.
name "exp"
outfile "exp.exe"
!include XPUI.nsh
!define XPUI_SKIN "windows xp"
!define XPUI_PAGE_CUSTOMFUNCTION_PRE finish_pre
!insertmacro XPUI_PAGE_WELCOME

!define XPUI_PAGE_CUSTOMFUNCTION_SHOW finish_show
!insertmacro XPUI_PAGE_FINISH
!insertmacro XPUI_LANGUAGE "English"
function finish_pre
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Settings" "Numfields" "6"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 5" "Top" "40"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 5" "Bottom" "70"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Type" "CheckBox"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Text" "Text"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "State" "1"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Left" "30"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Right" "200"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Top" "110"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "finish.ini" "Field 6" "Bottom" "120"
functionend

function finish_show
Push $0
GetDlgItem $0 $XPUI_HWND 1200
SetCtlColors $0 "000000" "transparent"
Pop $0
functionend
section
sectionend
3. Do you speak Russian?

Re: problem whis XPUI_PAGE_CUSTOMFUNCTION_PRE in finish page

I suspect that you're using SetCtlColors incorrectly. Did you try using the XPUI_SKIN_CONTROL macros? I'll try to build an installer using the above code later today to see if it works.

Sorry, I don't speak any Russian. Want to teach me? ^_^

Re: problem whis XPUI_PAGE_CUSTOMFUNCTION_PRE in finish page

I didn't found any information about XPUI_SKIN_CONTROL macros.
Do you have information or examples where XPUI_SKIN_CONTROL is used?=)

Re: problem whis XPUI_PAGE_CUSTOMFUNCTION_PRE in finish page

Make that XPUI_CONTROL_SKIN{,_PAGE}. Can't remember my own API. :-]

The short version:

GetDlgItem $0 $hwnd control_id(int)
!insertmacro XPUI_CONTROL_SKIN_PAGE $0

XPUI_CONTROL_SKIN is only used internally; use XPUI_CONTROL_SKIN_PAGE, as it determines which macro to call based on your settings (namely XPUI_BGIMAGE).

Dan

There's also XPUI_CONTROL_SKIN_LIGHT (for an alternate color) and XPUI_CONTROL_SKIN_TRANS (to force transparency).

Re: problem whis XPUI_PAGE_CUSTOMFUNCTION_PRE in finish page

Thanks, but "GetDlgItem $0 $hwnd control_id(int)" doesn't work on page FINISH.
Working variant:
!insertmacro XPUI_INSTALLOPTIONS_READ $HWND "finish.ini" "Field 6" "HWND"
!insertmacro XPUI_CONTROL_SKIN_PAGE $HWND