diff --git a/Contrib/InstallOptions/Install Options.html b/Contrib/InstallOptions/Install Options.html index 74174246..8466a6a0 100644 --- a/Contrib/InstallOptions/Install Options.html +++ b/Contrib/InstallOptions/Install Options.html @@ -7,15 +7,12 @@ href="mailto:mbishop@bytealliance.com?subject=Installer Options">Michael Bishop (original version) and Nullsoft, Inc. (DLL conversion and integration) +
  • Introduction
  • +
  • Settings
  • +
  • Fonts and colors
  • +
  • Version History
  • +
  • License
  • +
    Introduction:
    Installer Options was a quick application Michael Bishop threw together so he could prompt the user for some information @@ -29,23 +26,20 @@ changing the INI file. Extract it to known location (probably $TEMP), and then load it using CallInstDLL, passing one parameter on the stack. The one parameter is a name of an .ini file that defines the window. Example:
    -	SetOutPath $TEMP
    -	File inst.ini
    -	File InstallOptions.dll
    -	Push $TEMP\inst.ini
    - 	CallInstDLL $TEMP\InstallOptions.dll dialog
    -        Pop $0
    -        ;  ($0 would be "success" "cancel" "back" or some other value on error.
    +	GetTempFileName $R0
    +	File /oname=$R0 inst.ini
    +	InstallOptions::dialog $R0
    +	Pop $0
    +	; ($0 would be "success" "cancel" "back" or some other value on error.
     
    -	ReadINIStr $1 $TEMP\inst.ini "Field 1" State ; $1 = field #1's state
    +	ReadINIStr $1 $R0 "Field 1" State ; $1 = field #1's state
     
    -	Delete $TEMP\inst.nsi
    -	Delete $TEMP\InstallOptions.dll
    +	Delete $R0
     
    -It is often very useful to call InstallOptions from the NSIS callback functions .onNextPage and .onPrevPage. -

    The INI file has one required section. This section includes the number of controls to be created as well as general window attributes. The INI file also -includes a variable number of Field sections which are used to create the -controls to be displayed. +It is often very useful to call InstallOptions from a NSIS custom page callback function. +


    +
    INI File Settings: +

    The INI file has one required section. This section includes the number of controls to be created as well as general window attributes. The INI file also includes a variable number of Field sections which are used to create the controls to be displayed.

    The required section is named "Settings". It will contain the following values:


    +
    Fonts and colors: +

    InstallOptions supports the new UI enhancements in the new NSIS 2. To support them, InstallOptions now has two new functions, initDialog, and show. The first creates the dialog but doesn't show it. It pushes the HWND of the custom dialog to the stack. To get the HWND of any of the controls use:

    +

    	GetDlgItem (output var) (hwnd of the custom dialog) (12000 + field number - 1)
    +To finally show the tweaked dialog use the show function. + +Here is a little example: +
    +	InstallOptions::initDialog file.ini
    +	Pop $0
    +	IntCmp $0 0 error
    +		; $0 is now the IO dialog HWND
    +		; use getdlgitem with it and sendmessage
    +		GetDlgItem $1 $0 12000 ; 12000 + field number - 1
    +		; $1 is now the HWND of the first field
    +		CreateFont $2 "Tahoma" 10 700 
    +		SendMessage $1 ${WM_SETFONT} $2 0
    +		InstallOptions::show
    +		Goto done
    +	error:
    +		MessageBox MB_OK "IO error: $0"
    +	done:
    +
    History: