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)
- 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. +
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:
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:+