new documentation

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1957 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2002-12-15 20:29:28 +00:00
parent d82951674b
commit 92029c8558
3 changed files with 604 additions and 429 deletions

View file

@ -0,0 +1,81 @@
DLL version 2.0 (12/14/2002)
* Supports custom font and DPI settings (by Joost Verburg)
* INI files should contain dialog units now, no pixels (by Joost Verburg)
* RESIZETOFIT flag for Bitmap control (by Amir Szekely)
* New documentation (by Joost Verburg)
DLL version 1.7 beta (11/2/2002)
* Added initDialog and show DLL functions
DLL version 1.6 beta (9/30/2002)
* CancelConfirmIcon becomes CancelConfirmFlags and can now take the other common MessageBox flags
DLL version 1.5 beta (9/26/2002)
* Made close [x] button behave like Cancel (thanks brainsucker)
DLL version 1.4 beta (9/4/2002)
* Added Icon and Bitmap controls (by Amir Szekely)
DLL version 1.3 beta (8/15/2002)
* Added CancelShow (by ORTIM)
* Added pixel transformation for widgets (by ORTIM)
DLL version 1.2 beta (7/31/2002)
* Added CancelEnabled (by ORTIM)
* Added CancelConfirmCaption and CancelConfirmIcon (by Amir Szekely)
DLL version 1.1 beta (7/22/2002)
* Font is now taken from the main NSIS window (by Amir Szekely)
DLL version 1.0 beta (12/16/2001)
* Moved to DLL, no longer need parentwnd ini writing
* Tons of changes - no longer fully compatible (see source for a big list)
* removed support for silent installers (it seems the old version would bring up it's own dialog)
version 1.4 (11/18/2001)
* Added Listbox controls.
* Added MULTISELECT flag.
* Made the HWND list for the parent window controls dynamically allocated. This prevents a crash if NSIS ever gets more than 150 controls on it's main window.
* The TEXT property of DirRequest control can be used to specify an initial directory. The current directory is automatically selected when clicking the browse button of the DirRequest control.
* Added ROOT property to DirRequest which can be used to set the root directory (mostly due to felfert)
* Edit controls will now auto scroll (thanks felfert)
* Fixed a problem where the window wouldn't draw properly on some systems (thanks felfert)
version 1.3 (11/03/2001)
* Got rid of the call to RedrawWindow() because it's no longer needed with the WS_CLIPCHILDREN flag for NSIS.
* Removed a few hardcoded limits of buffer sizes
* Added Checkbox and RadioButton controls
* Added RIGHT and CHECKED flags
version 1.2.2 (10/30/2001)
* Additional size reductions. Further reduced the size down to 8k.
* The text parameter to a combobox can now be used to specify the initial value
* Changed from InvalidateRect() to RedrawWindow() to force a redraw after a browse dialog
* On startup, set the flags of the NSIS window to include WS_CLIPCHILDREN. Otherwise, our controls don't get drawn right.
version 1.2.1 (10/28/2001)
* Bug fix. ControlID for the caption and the OK button were reused by the first two controls. (Thanks Schultz)
version 1.2j (10/28/2001)
* 8.5kb from 44kb. heh. (by Justin Frankel)
version 1.2 (10/28/2001)
* Still 44k
* Added the "FileRequest" and "DirRequest" control types (thanks Schultz)
* Added "MinLen", "MaxLen", and "ValidateText" properties to fields
* Added "Flags" as a way to specifiy additional parameters for controls
* Few more changes to the documentation
* Cleaned the code in a few places...still trying to make it smaller
version 1.1 (10/27/2001)
* Added the "Title" option (thanks Alex)
* Moved the OK button so it is in the same location as the buttons on the main NSIS window (thanks Alex)
* Pressing "ENTER" will now automatically select the OK button (thanks Alex)
* Slightly improved the documentation
version 1.01 (10/25/2001)
* Fixed the SetFocus loop so it exits after the first control like it was supposed to
* Added the license to the documentation
version 1.0 (10/25/2001)
* Barely qualifies as a distribution

View file

@ -1,429 +0,0 @@
<HTML><HEAD><TITLE>Install Options/DLL Documentation</TITLE></HEAD>
<BODY bgColor=#ffffff>
<CENTER><FONT size=+2><A
href="http://installoptions.sourceforge.net/"><B>Install
Options</B></A> (/DLL)</FONT><BR><FONT size=-1>Copyright © 2001 <A
href="mailto:mbishop@bytealliance.com?subject=Installer Options">Michael
Bishop</A> (original version) and Nullsoft, Inc. (DLL conversion and integration)
</FONT></CENTER>
<UL><B>Table of Contents</B>
<LI><A href="#introduction">Introduction</A></LI>
<LI><A href="#ini">Settings</A></LI>
<LI><A href="#ui">Fonts and colors</A></LI>
<LI><A href="#history">Version History</A></LI>
<LI><A href="#license">License</A></LI>
</UL>
<HR>
<A name=introduction><B>Introduction:</B><BR><I>Installer Options</I> was a quick
application Michael Bishop threw together so he could prompt the user for some information
during the install process. This version is a highly modified version of it that is designed
as a NSIS extension DLL for the <A
href="http://www.nullsoft.com/free/nsis/">NSIS</A> installer. Installer Options will create a
dialog box which will be displayed inside of the NSIS window. The dialog box is
defined by an INI file, which allows you to define the layout of controls by
changing the INI file.
<P>Using the new NSIS 2 plugin system, you don't have to worry about extracting and removing
the DLL anymore. You can also use the Plugins directory to store the INI files. The contents
of the directory will be removed when the installer is being closed.
Example: <PRE>
;Extract INI File to Plugins directory
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini test.ini
InstallOptions::dialog $PLUGINSDIR\test.ini
Pop $0
; ($0 would be "success" "cancel" "back" or some other value on error)
ReadINIStr $1 $R0 "Field 1" State ; $1 = Field #1's state
</PRE>
It is often very useful to call InstallOptions from a NSIS custom page callback function.
<HR>
<A name=ini><B>INI File Settings:</B>
<P>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.
<P>The required section is named "<I>Settings</I>". It will contain the
following values:
<UL>
<TABLE border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#cccccc><B>NumFields</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(required)</I></TD>
<TD vAlign=top bgColor=#eeeeee>The number of control elements to be
displayed on the dialog window.</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Title</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>If specified, gives the text to set the
titlebar to. Otherwise, the titlebar text is not changed.</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>CancelEnabled</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>If specified, overrides NSIS settings and enables or disables the cancel button. If set to 1, the cancel button will be enabled. If set to 0, the cancel button will be disabled.</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>CancelShow</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>If specified, overrides NSIS settings and shows or hides the cancel button. If set to 1, the cancel button will be shown. If set to 0, the cancel button will be hidden.</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>BackEnabled</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>If specified, overrides NSIS settings and enables or disables the back button. If set to 1, the back button will be enabled. If set to 0, the back button will be disabled.</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>CancelButtonText</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Overrides the text for the cancel button. If not specified, the cancel button text will not be changed. Recommended value: "Cancel"</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>NextButtonText</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Overrides the text for the next button. If not specified, the next button text will not be changed. Recommended value: "Next >"</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>BackButtonText</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Overrides the text for the back button. If not specified, the back button text will not be changed. Recommended value: "< Back"</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Rect</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Overrides the default rect ID to run over. This will make IO resize itself according to a different rect than NSIS's dialogs rect.</TD></TR>
</TBODY></TABLE></UL>
<P>Each field section has the heading "Field #" where # must be sequential
numbers from 1 to NumFields. Each Field section contains the following values:
<UL>
<TABLE border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Type</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(required)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Type of control to be created. Valid
values are "<I>Label</I>", "<I>Text</I>", "<I>Password</I>",
"<I>Combobox</I>", "<I>DropList</I>", "<I>Listbox</I>", "<I>CheckBox</I>",
"<I>RadioButton</I>",
"<I>FileRequest</I>", or "<I>DirRequest</I>".<BR><FONT size=-1>A
"<I>label</I>" is used to display static text. (i.e. a caption for a
textbox)<BR>A "<I>textbox</I>" and "<I>password</I>" accept text input
from the user. "<I>password</I>" masks the input with * characters.<BR>A
"<I>combobox</I>" allows the user to type text not in the popup list, a
"<I>droplist</I>" only allows selection of items in the list.<BR>A
"<I>listbox</I>" shows multiple items and can optionally allow the user
to select more than one item.<BR>
A "<I>CheckBox</I>" control displays a check box with label.<BR>
A "<I>RadioButton</I>" control displays a radio button with label.<BR>
A "<I>FileRequest</I>" control displays
a textbox and a browse button. Clicking the browse button will display a
file requester where the user can browse for a file.<BR>A
"<I>DirRequest</I>" control displays a textbox and a browse button.
Clicking the browse button will display a directory requester where the
user can browse for a directory.<BR>
"<I>Icon</I>" control displays an icon. Use no Text to use the installer icon.<BR>
"<I>Bitmap</I>" control displays a bitmap.<BR></FONT></TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Text</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Specifies the caption of a label, checkbox, or radio button control.
For icon and bitmaps control this specifies the path to the image.
</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>State</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Specifies the state of the control. This is updated when the user closes the window,
so you can read from it from NSIS. For edit texts and dir and file request boxes, this is the string that is
specified. For radio button and check boxes, this can be '0' or '1' (for unchecked or checked).
</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>ListItems</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>A list of items to display in a combobox,
droplist, or listbox.<BR>This is a single line of text with each item
separated by a pipe character '<B>|</B>'</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>MaxLen</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Causes validation on the selected control
to limit the maximum length of text.<BR>If the user specifies more text
than this, a message box will appear when they click "OK" and the dialog
will not be dismissed.<BR><FONT size=-1>You should not use this on a
"<I>combobox</I>" since the user can not control what is
selected.</FONT><BR><FONT size=-1>This should be set to a maximum of 260
for "<I>FileRequest</I>" and "<I>DirRequest</I>"
controls.</FONT><BR><FONT size=-1>Ignored on "<I>label</I>"
controls.</FONT></TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>MinLen</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Causes validation on the selected control
to force the user to enter a minimum amount of text.<BR>If the user
specifies less text than this, a message box will appear when they click
"OK" and the dialog will not be dismissed.<BR>Unlike MaxLen, this is
useful for "<I>Combobox</I>" controls. By setting this to a value of "1"
the program will force the user to select an item.<BR><FONT
size=-1>Ignored on "<I>label</I>" controls.</FONT></TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>ValidateText</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>If a particular field fails the test for
"<I>MinLen</I>" or "<I>MaxLen</I>", a messagebox will be displayed with
this text.<BR><FONT size=-1>NOTE: The only formatting performed on this
text is "\n" will be replaced with a newline in the
messagebox.</FONT></TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Left<BR>Right<BR>Top<BR>Bottom</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(required)</I></TD>
<TD vAlign=top bgColor=#eeeeee>The position on the dialog where this
control appears.<BR>Sorry, no GUI here to help you.<BR><FONT color=red
size=-1>NOTE: For combobox or droplist, the "<I>bottom</I>" value is not
used in the same way.<BR>In this case, the bottom value is the maximum
size of the window when the pop-up list is being displayed. All other
times, the combobox is automatically szed to be one element tall. If you
have trouble where you can not see the combobox drop-down, then check
the bottom value and ensure it is large enough. <BR>NOTE (2):
FileRequest and DirRequest controls will allocate 20 pixels to the
browse button. Make this control wide enough the contents of the textbox
can be seen. Note that you can specify negative coordinates to specify the
distance from the right or bottom edge.</FONT></TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Filter</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Specifies the filter to be used in the
"<I>FileRequest</I>" control.<BR>This is constructed by putting pairs of
entries together, each item seperated by a | character.<BR>The first
value in each pair is the text to display for the filter.<BR>The second
value is the pattern to use to match files.<BR>For example, you might
specify:<BR>
<UL>Filter=Text Files|*.txt|Programs|*.exe;*.com|All Files|*.*
</UL><FONT size=-1>If not specified, then the filter defaults to All
Files|*.*</FONT><BR><FONT size=-1>NOTE: you should not put any extra
spaces around the | characters.</FONT> </TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Root</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>Used by <I>DirRequest</I> controls to
specify the root directory of the search. By default, this allows the
user to browse any directory on the computer. This will limit the search
to a particular directory on the system.</TD></TR>
<TR>
<TD vAlign=top bgColor=#cccccc><B>Flags</B></TD>
<TD vAlign=top bgColor=#cccccc><I>(optional)</I></TD>
<TD vAlign=top bgColor=#eeeeee>This specifies additional flags for the
display of different controls. Each value should be seperated by a |
character, and you should be careful not to put any spaces around the |
character.<BR>
<TABLE border=0>
<TBODY>
<TR>
<TD vAlign=top><B>Value</B></TD>
<TD vAlign=top><B>Meaning</B></TD></TR>
<TR>
<TD vAlign=top>REQ_SAVE</TD>
<TD vAlign=top>This causes the "<I>FileRequest</I>" to dislpay a
Save As dialog. If not specified, an Open dialog is used.</TD></TR>
<TR>
<TD vAlign=top>FILE_MUST_EXIST</TD>
<TD vAlign=top>Used by "<I>FileRequest</I>" to determine if the
selected file must exist.<BR>This only applies if an "Open" dialog
is being displayed.<BR><FONT size=-1>This currently does not force
the file to exist other than through the browse
button.</FONT></TD></TR>
<TR>
<TD vAlign=top>FILE_EXPLORER</TD>
<TD vAlign=top>Used by "<I>FileRequest</I>", enables new file request look (recommended)</FONT></TD></TR>
<TR>
<TD vAlign=top>FILE_HIDEREADONLY</TD>
<TD vAlign=top>Used by "<I>FileRequest</I>", hides "open read only" checkbox in open dialog.</FONT></TD></TR>
<TR>
<TD vAlign=top>WARN_IF_EXIST</TD>
<TD vAlign=top>Used by "<I>FileRequest</I>" to display a warning
message if the selected file already exists.<BR><FONT size=-1>The
warning message is only displayed for files selected with the
browse button.</FONT></TD></TR>
<TR>
<TD vAlign=top>PATH_MUST_EXIST</TD>
<TD vAlign=top>Used by "<I>FileRequest</I>" to force the path to
exist. Prevents the user from typing a non-existant path into the
browse dialog window.<BR><FONT size=-1>This only validates path's
selected with the browse button.</FONT></TD></TR>
<TR>
<TD vAlign=top>PROMPT_CREATE</TD>
<TD vAlign=top>Used by "<I>FileRequest</I>" to display a warning
if the selected file does not exist. However, it still allows the
user to select the file.<BR><FONT size=-1>This only displays the
warning for files selected with the browse button.</FONT></TD></TR>
<TR>
<TD vAlign=top>RIGHT</TD>
<TD vAlign=top>Used by "<I>Checkbox</I>" and "<I>Radiobutton</I>"
controls to specify you want the checkbox to the right of the text
instead of the left as is the default. </TD></TR>
<TR>
<TD vAlign=top>MULTISELECT</TD>
<TD vAlign=top>Used by "<I>Listbox</I>" controls to specify if
more than item may be selected. If this flag is not specified,
then only one item may be selected from the
list.</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></UL>
<HR>
<A name="ui"><B>Fonts and colors:</B>
<P>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:<BR><BR>
<PRE> GetDlgItem (output var) (hwnd of the custom dialog) (1200 + field number - 1)</PRE>
To finally show the tweaked dialog use the show function.
Here is a little example:
<PRE>
# we don't want the DLL to unload so it will remember
# our ini file when we are trying to show it
InstallOptions::initDialog /NOUNLOAD file.ini
Pop $0
IntCmp $0 0 error
; $0 is now the IO dialog HWND
; use getdlgitem with it and sendmessage
GetDlgItem $1 $0 1200 ; 1200 + 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
Pop $0
StrCmp $0 "success" done
StrCmp $0 "back" done
StrCmp $0 "cancel" done
error:
MessageBox MB_OK|MB_ICONSTOP "IO error: $0"
Quit
done:</PRE>
<HR>
<A name=history><A name=top><B>History:</B>
<P>
<UL>
<LI><a name=DLL2.0>DLL version 2.0 (12/14/2002) Changes by Joost Verburg
<UL>
<li>Works with custom font and DPI settings
<li>INI files should contain dialog units now, no pixels
</UL>
<LI><a name=DLL1.7>DLL version 1.7 beta (11/2/2002)
<UL>
<li>Added initDialog and show DLL functions
</UL>
<LI><a name=DLL1.6>DLL version 1.6 beta (9/30/2002)
<UL>
<li>CancelConfirmIcon becomes CancelConfirmFlags and can now take the other common MessageBox flags
</UL>
<LI><a name=DLL1.5>DLL version 1.5 beta (9/26/2002)
<UL>
<li>Made close [x] button behave like Cancel (thanks brainsucker)
</UL>
<LI><a name=DLL1.4>DLL version 1.4 beta (9/4/2002)
<UL>
<li>Added Icon and Bitmap controls (by Amir Szekely)
</UL>
<LI><a name=DLL1.3>DLL version 1.3 beta (8/15/2002)
<UL>
<li>Added CancelShow (by ORTIM)
<li>Added pixel transformation for widgets (by ORTIM)
</UL>
<LI><a name=DLL1.2>DLL version 1.2 beta (7/31/2002)
<UL>
<li>Added CancelEnabled (by ORTIM)
<li>Added CancelConfirmCaption and CancelConfirmIcon (by Amir Szekely)
</UL>
<LI><a name=DLL1.1>DLL version 1.1 beta (7/22/2002)
<UL>
<li>Font is now taken from the main NSIS window (by Amir Szekely)
</UL>
<LI><a name=DLL1.0>DLL version 1.0 beta (12/16/2001)
<UL>
<LI>Moved to DLL, no longer need parentwnd ini writing
<li>Tons of changes - no longer fully compatible (see source for a big list)
<LI>removed support for silent installers (it seems the old version would bring up it's own dialog)
</UL>
<LI><A name=1.4>version 1.4 (11/18/2001)
<UL>
<LI>Added <I>Listbox</I> controls.
<UL>
<LI>Added <I>MULTISELECT</I> flag. </LI></UL>
<LI>Made the HWND list for the parent window controls dynamically allocated.
This prevents a crash if NSIS ever gets more than 150 controls on it's main
window.
<LI>The <I>TEXT</I> property of DirRequest control can be used to specify an
initial directory. The current directory is automatically selected when
clicking the browse button of the DirRequest control.
<LI>Added <I>ROOT</I> property to DirRequest which can be used to set the
root directory. (mostly due to felfert)
<LI>Edit controls will now auto scroll. (thanks felfert)
<LI>Fixed a problem where the window wouldn't draw properly on some systems.
(thanks felfert) </LI></UL>
<LI><A name=1.3>version 1.3 (11/03/2001)
<UL>
<LI>Got rid of the call to RedrawWindow() because it's no longer needed with
the WS_CLIPCHILDREN flag for NSIS.
<LI>Removed a few hardcoded limits of buffer sizes.
<LI>Added <I>Checkbox</I> and <I>RadioButton</I> controls.
<UL>
<LI>Added <I>RIGHT</I> and <I>CHECKED</I> flags. </LI></UL></LI></UL>
<LI><A name=1.2.2>version 1.2.2 (10/30/2001)
<UL>
<LI>Additional size reductions. Further reduced the size down to 8k.
<LI>The text parameter to a combobox can now be used to specify the initial
value.
<LI>Changed from InvalidateRect() to RedrawWindow() to force a redraw after
a browse dialog.
<LI>On startup, set the flags of the NSIS window to include WS_CLIPCHILDREN.
Otherwise, our controls don't get drawn right. </LI></UL>
<LI><A name=1.2.1>version 1.2.1 (10/28/2001)
<UL>
<LI>Bug fix. ControlID for the caption and the OK button were reused by the
first two controls. (Thanks Schultz) </LI></UL>
<LI><A name=1.2j>version 1.2j (10/28/2001) (justin frankel's modifications)
<UL>
<LI>8.5kb from 44kb. heh. </LI></UL>
<LI><A name=1.2>version 1.2 (10/28/2001)
<UL><FONT size=-1>(Thanks to Schultz for requesting the first
item.)</FONT><BR><FONT size=-1>Still 44k, but would like to make it smaller.
All of NSIS only amounts to 35.5k</FONT>
<LI>Added the "<I>FileRequest</I>" and "<I>DirRequest</I>" control
types.<BR><FONT size=-1>NOTE: Please let me know if this is going to require
any DLL's which might not be on the target machine.<BR>Keep in mind that
although we are using system DLL's, the program will exit before NSIS tries
to copy any files.</FONT>
<LI>Added "<I>MinLen</I>", "<I>MaxLen</I>", and "<I>ValidateText</I>"
properties to fields.
<LI>Added "<I>Flags</I>" as a way to specifiy additional parameters for
controls.
<LI>Few more changes to the documentation.
<LI>Cleaned the code in a few places...still trying to make it smaller.
</LI></UL>
<LI><A name=1.1>version 1.1 (10/27/2001)
<UL><FONT size=-1>(Thanks to Alex ??? for requesting the first
three.)</FONT>
<LI>Added the "<I>Title</I>" option.
<LI>Moved the OK button so it is in the same location as the buttons on the
main NSIS window.
<LI>Pressing "ENTER" will now automatically select the OK butt/FONT&gt;
<LI>Slightly improved the documentation. </LI></UL>
<LI><A name=1.01>version 1.01: (10/25/2001)
<UL>
<LI>Fixed the SetFocus loop so it exits after the first control like it was
supposed to.
<LI>Added the license to the documentation. </LI></UL>
<LI><A name=1.0>version 1.0: (10/25/2001)
<UL>
<LI>Barely qualifies as a distribution. </LI></UL></LI></UL>
<HR>
<A name=license><PRE> Copyright &copy; 2001 Michael Bishop
Portions Copyright &copy; 2001 Nullsoft, Inc.
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
</PRE></A></BODY></HTML>

View file

@ -0,0 +1,523 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>InstallOptions 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body
{
padding: 10px;
background-color: #F0F0F0;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
font-weight: normal;
}
center
{
text-align: center;
}
table
{
margin: auto;
text-align: left;
background-color: #FFFFFF;
}
.maintable
{
border: 2px solid #376EAB;
}
.margin
{
margin: 20px;
}
.text
{
margin: 20px;
}
.bold
{
font-weight: bold;
}
.italic
{
font-style: italic;
}
.changelog
{
}
.bigheader
{
margin: 10px;
font-size: 24pt;
color: #333333;
text-align: center;
}
.header
{
font-size: 14pt;
color: #7A7272;
}
.subheader
{
margin: 20px;
font-size: 11pt;
font-weight: bold;
color: #303030;
}
.footer
{
margin: 5px 5px 5px 5px;
text-align: right;
font-size: 8pt;
color: #909090;
}
a:link, a:visited, a:active
{
color: #294F75;
text-decoration: none;
}
a:hover
{
color: #182634;
text-decoration: none;
}
.subtable
{
margin: 20px;
border: 0px;
}
.lefttable
{
background-color: #CCCCCC;
vertical-align: top;
}
.righttable
{
background-color: #EEEEEE;
vertical-align: top;
}
</style>
</head>
<body>
<div class="center">
<table width="750" class="maintable" cellspacing="0" cellpadding="0">
<tr><td>
<table cellspacing="0" cellpadding="0">
<tr>
<td><p class="bigheader">InstallOptions 2</p></td>
</tr>
<tr>
<td><div class="margin">
<p class="header">Introduction</p>
<p class="text">InstallOptions is a NSIS plugin which allows you to create custom
pages for NSIS installers, to prompt the user for extra information.</p>
<p class="text">InstallerOptions will create a dialog which will be displayed inside
the NSIS window. The controls on the dialog can be defined in an INI file.</p>
<p class="text">NSIS 2 has a new page system, which allows you to add custom pages
to your installer without messing with Prev/Next functions. With the new plugin
system, you also don't have to worry anymore about extracting and deleting the DLL
file. When you store the INI files in the plugins directory, NSIS will also delete
them automatically.</p>
<p class="text">This new version of InstallOptions has been designed for NSIS 2.
It supports customized user interfaces and custom font and DPI settings.</p>
<p class="header">INI File</p>
<p class="text">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.</p>
<p class="text">The required section is named "<span class="italic">Settings</span>".
It can contain the following values:</p>
<table class="subtable">
<tr>
<td class="lefttable"><span class="bold">NumFields</span></td>
<td class="lefttable"><span class="italic">(required)</span></td>
<td class="righttable">The number of control elements to be
displayed on the dialog window.</td></tr>
<tr>
<td class="lefttable"><span class="bold">Title</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">If specified, gives the text to set the
titlebar to. Otherwise, the titlebar text is not changed.</td></tr>
<tr>
<td class="lefttable"><span class="bold">CancelEnabled</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">If specified, overrides NSIS settings and enables or disables the cancel button.
If set to 1, the cancel button will be enabled. If set to 0, the cancel button will be disabled.</td></tr>
<tr>
<td class="lefttable"><span class="bold">CancelShow</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">If specified, overrides NSIS settings and shows or hides the cancel button
If set to 1, the cancel button will be shown. If set to 0, the cancel button will be hidden.</td></tr>
<tr>
<td class="lefttable"><span class="bold">BackEnabled</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">If specified, overrides NSIS settings and enables or disables the back button.
If set to 1, the back button will be enabled. If set to 0, the back button will be disabled.</td></tr>
<tr>
<td class="lefttable"><span class="bold">CancelButtonText</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Overrides the text for the cancel button. If not specified, the cancel button
text will not be changed. Recommended value: "Cancel"</td></tr>
<tr>
<td class="lefttable"><span class="bold">NextButtonText</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Overrides the text for the next button. If not specified, the next button text
will not be changed. Recommended value: "Next >"</td></tr>
<tr>
<td class="lefttable"><span class="bold">BackButtonText</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Overrides the text for the back button. If not specified, the back button text
will not be changed. Recommended value: "< Back"</td></tr>
<tr>
<td class="lefttable"><span class="bold">Rect</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Overrides the default rect ID to run over. This will make IO resize itself
according to a different rect than NSIS's dialogs rect.</td></tr>
</table>
<p class="text">Each field section has the heading "Field #" where # must be sequential
numbers from 1 to NumFields. Each Field section can contain the following values:</p>
<table class="subtable">
<tr>
<td class="lefttable"><span class="bold">Type</span></td>
<td class="lefttable"><span class="italic">(required)</span></td>
<td class="righttable">Type of control to be created. Valid
values are "<span class="italic">Label</span>", "<span class="italic">Text</span>",
"<span class="italic">Password</span>", "<span class="italic">Combobox</span>",
"<span class="italic">DropList</span>", "<span class="italic">Listbox</span>",
"<span class="italic">CheckBox</span>", "<span class="italic">RadioButton</span>",
"<span class="italic">FileRequest</span>", "<span class="italic">DirRequest</span>"
"<span class="italic">Icon</span>" or "<span class="italic">Bitmap</span>",.<br><br>A
"<span class="italic">Label</span>" is used to display static text. (i.e. a caption for a
textbox)<br>A "<span class="italic">Textbox</span>" and "<span class="italic">Password</span>"
accept text input from the user. "<span class="italic">Password</span>" masks the input
with * characters.<br>A "<span class="italic">Combobox</span>" allows the user to type text
not in the popup list, a "<span class="italic">Droplist</span>" only allows selection of
items in the list.<br>A "<span class="italic">listbox</span>" shows multiple items and can
optionally allow the user to select more than one item.<br>A
"<span class="italic">CheckBox</span>" control displays a check box with label.<br>
A "<span class="italic">RadioButton</span>" control displays a radio button with label.<br>
A "<span class="italic">FileRequest</span>" control displays
a textbox and a browse button. Clicking the browse button will display a
file requester where the user can browse for a file.<br>A
"<span class="italic">DirRequest</span>" control displays a textbox and a browse button.
Clicking the browse button will display a directory requester where the
user can browse for a directory.<br>
"<span class="italic">Icon</span>" control displays an icon.
Use no Text to use the installer icon.<br>
"<span class="italic">Bitmap</span>" control displays a bitmap.<br></td></tr>
<tr>
<td class="lefttable"><span class="bold">Text</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Specifies the caption of a label, checkbox, or radio button control.
For icon and bitmaps control this specifies the path to the image.<br><br>
<span class="bold">Note:</span> \r\n will be replaced by a newline.
</td></tr>
<tr>
<td class="lefttable"><span class="bold">State</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Specifies the state of the control. This is updated when the user
closes the window, so you can read from it from NSIS. For edit texts and dir and file
request boxes, this is the string that is specified. For radio button and check boxes,
this can be '0' or '1' (for unchecked or checked).
</td></tr>
<tr>
<td class="lefttable"><span class="bold">ListItems</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">A list of items to display in a combobox,
droplist, or listbox.<br>This is a single line of text with each item
separated by a pipe character '|'</td></tr>
<tr>
<td class="lefttable"><span class="bold">MaxLen</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Causes validation on the selected control
to limit the maximum length of text.<br>If the user specifies more text
than this, a message box will appear when they click "OK" and the dialog
will not be dismissed.<br>You should not use this on a
"<span class="italic">combobox</span>" since the user can not control what is
selected.<br>This should be set to a maximum of 260
for "<span class="italic">FileRequest</span>" and "<span class="italic">DirRequest</span>"
controls.<br>Ignored on "<span class="italic">label</span>"
controls.</td></tr>
<tr>
<td class="lefttable"><span class="bold">MinLen</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Causes validation on the selected control
to force the user to enter a minimum amount of text.<br>If the user
specifies less text than this, a message box will appear when they click
"OK" and the dialog will not be dismissed.<br>Unlike MaxLen, this is
useful for "<span class="italic">Combobox</span>" controls.
By setting this to a value of "1" the program will force the user to
select an item.<br>Ignored on "<span class="italic">Label</span>"
controls.</td></tr>
<tr>
<td class="lefttable"><span class="bold">ValidateText</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">If a particular field fails the test for
"<span class="italic">MinLen</span>" or "<span class="italic">MaxLen</span>",
a messagebox will be displayed with this text.<br><br><span class="bold">
Note:</span> The only formatting performed on this text is "\n" will be
replaced with a newline in the messagebox.</td></tr>
<tr>
<td class="lefttable"><span class="bold">Left<br>Right<br>Top<br>Bottom</span></td>
<td class="lefttable"><span class="italic">(required)</span></td>
<td class="righttable">The position on the dialog where this
control appears.<br>Sorry, no GUI here to help you.<br><br>
<span class="bold">Note:</span> For combobox or droplist, the
"<span class="italic">bottom</span>" value is not used in the
same way.<br>In this case, the bottom value is the maximum
size of the window when the pop-up list is being displayed. All other
times, the combobox is automatically szed to be one element tall. If you
have trouble where you can not see the combobox drop-down, then check
the bottom value and ensure it is large enough.<br><br>
<span class="bold">Note (2):</span>
FileRequest and DirRequest controls will allocate 20 pixels to the
browse button. Make this control wide enough the contents of the textbox
can be seen. Note that you can specify negative coordinates to specify the
distance from the right or bottom edge.</td></tr>
<tr>
<td class="lefttable"><span class="bold">Filter</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Specifies the filter to be used in the
"<span class="italic">FileRequest</span>" control.<br>This is constructed
by putting pairs of entries together, each item seperated by a | character.
<br>The first value in each pair is the text to display for the filter.
<br>The second value is the pattern to use to match files.<br>
For example, you might specify:<br>
Filter=Text Files|*.txt|Programs|*.exe;*.com|All Files|*.*<br>
If not specified, then the filter defaults to All
Files|*.*<br><br><span class="bold">Note:</span> you should not put
any extra spaces around the | characters. </td></tr>
<tr>
<td class="lefttable"><span class="bold">Root</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Used by <span class="italic">DirRequest</span> controls to
specify the root directory of the search. By default, this allows the
user to browse any directory on the computer. This will limit the search
to a particular directory on the system.</td></tr>
<tr>
<td class="lefttable"><span class="bold">Flags</span></td>
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">This specifies additional flags for the
display of different controls. Each value should be seperated by a |
character, and you should be careful not to put any spaces around the |
character.<br>
<table class="righttable">
<tr>
<td class="righttable"><span class="bold">Value</span></td>
<td class="righttable"><span class="bold">Meaning</span></td></tr>
<tr>
<td class="righttable">REQ_SAVE</td>
<td class="righttable">This causes "<span class="italic">FileRequest</span>"
controls to display a Save As dialog. If not specified, an Open dialog
is used.</td></tr>
<tr>
<td class="righttable">FILE_MUST_EXIST</td>
<td class="righttable">Used by "<span class="italic">FileRequest</span>" to
determine if the selected file must exist.<br>This only applies
if an "Open" dialog is being displayed.<br>This currently does not force
the file to exist other than through the browse button.</td></tr>
<tr>
<td class="righttable">FILE_EXPLORER</td>
<td class="righttable">Used by "<span class="italic">FileRequest</span>",
enables new file request look (recommended)</td></tr>
<tr>
<td class="righttable">FILE_HIDEREADONLY</td>
<td class="righttable">Used by "<span class="italic">FileRequest</span>",
hides "open read only" checkbox in open dialog.</td></tr>
<tr>
<td class="righttable">WARN_IF_EXIST</td>
<td class="righttable">Used by "<span class="italic">FileRequest</span>"
to display a warning message if the selected file already exists.<br>
The warning message is only displayed for files selected with the
browse button.</td></tr>
<tr>
<td class="righttable">PATH_MUST_EXIST</td>
<td class="righttable">Used by "<span class="italic">FileRequest</span>"
to force the path to
exist. Prevents the user from typing a non-existant path into the
browse dialog window.<br>This only validates path's
selected with the browse button.</td></tr>
<tr>
<td class="righttable">PROMPT_CREATE</td>
<td class="righttable">Used by "<span class="italic">FileRequest</span>"
to display a warning
if the selected file does not exist. However, it still allows the
user to select the file.<br>This only displays the
warning for files selected with the browse button.</td></tr>
<tr>
<td class="righttable">RIGHT</td>
<td class="righttable">Used by "<span class="italic">Checkbox</span>"
and "<span class="italic">Radiobutton</span>" controls to specify you
want the checkbox to the right of the text instead of the left as is
the default.</td></tr>
<tr>
<td class="righttable">MULTISELECT</td>
<td class="righttable">Used by "<span class="italic">Listbox</span>"
controls to specify if more than item may be selected. If this flag
is not specified,only one item may be selected from the list.</td></tr>
<tr>
<td class="righttable">RESIZETOFIT</td>
<td class="righttable">This causes "<span class="italic">Bitmap</span>"
controls to resize the image to the size of the control.
Also useful to support custom DPI settings.</td></tr>
</table></table>
<p class="header">How to use</p>
<p class="subheader">Modern UI</p>
<p class="text">For information about using InstallOptions with
the Modern UI, have a look at the <a href="..\Modern UI\Readme.html#customPages">
Modern UI documentation</a>.</p>
<p class="subheader">Extract the INI File</p>
<p class="text">First, you have to extract the INI files for the dialogs
in the .onInit function:
<pre class="margin">
Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini test.ini
FunctionEnd
</pre>
<p class="subheader">Call the DLL</p>
<p class="text">You can call InstallOptions in a page function,
check the <a href="..\..\Docs\Chapter3.html#3.5">NSIS documentation</a>
for information about the page system.
<p class="text">The InstallOptions DLL has three functions:</p>
<ul>
<li>dialog - Creates the dialog immidiately
<li>initDialog - Creates the in dialog memory, does not show it
<li>show - Shows a dialog created in memory
</ul>
<p class="text">Usually, you only need to use the dialog function:</p>
<pre class="margin">
Function FunctionName ;FunctionName defined with Page command
;Display the Install Options dialog
Push $R0
InstallOptions::dialog $PLUGINSDIR\test.ini
Pop $R0
FunctionEnd
</pre>
<p class="subheader">Get the output</p>
<p class="text">In most cases, you will need the output from the INI File
in a section. Get it using ReadINIStr:</p>
<pre class="margin">
ReadINIStr $R0 "$PLUGINSDIR\test.ini" "Field 1" "State"
</pre>
<p class="header">Fonts and colors</p>
<p class="text">If you want to use custom fonts or colors on your InstallOptions
dialogs, you should use the initDialog and show functions. initDialog creates the
dialog in memory, but does not show it. After calling initDialog, you can set
the fonts and colors, and call show to show the dialog.
initDialog pushes the HWND of the custom dialog to the stack. To get the HWND
of the controls use:</p>
<pre class="margin">
GetDlgItem (output var) (hwnd of the custom dialog) (1200 + Field number - 1)
</pre>
<p class="text">Example of using a custom font:</p>
<pre class="margin">
Function FunctionName ;FunctionName defined with Page command
;Display the Install Options dialog
Push $R0
Push $R1
Push $R2
InstallOptions::initDialog $PLUGINSDIR\test.ini
Pop $R0
GetDlgItem $R1 $R0 1200 ;1200 + Field number - 1
;$R1 contains the HWND of the first field
CreateFont $R2 "Tahoma" 10 700
SendMessage $R1 ${WM_SETFONT} $R2 0
InstallOptions::show
Pop $R1
Pop $R1
Pop $R0
FunctionEnd
</pre>
<p class="header">Version history</p>
<ul>
<li>DLL version 2.0 (12/14/2002)
<ul>
<li>Supports custom font and DPI settings (by Joost Verburg)</li>
<li>INI files should contain dialog units now, no pixels (by Joost Verburg)</li>
<li>RESIZETOFIT flag for Bitmap control (by Amir Szekely)</li>
<li>New documentation (by Joost Verburg)</li>
</ul>
</li>
</ul>
<p class="text"><a href="Changelog.txt">Complete version history</a></p>
<p class="header">Credits</p>
<p class="text">Original version by Michael Bishop<br>
DLL version by Nullsoft, Inc.<br>
DLL version 2 by Amir Szekely, ORTIM, Joost Verburg<br>
New documentation by Joost Verburg</p>
<p class="header">License</p>
<pre class="margin">Copyright &copy; 2002 Michael Bishop
Portions Copyright &copy 2002:
- Nullsoft, Inc.
- Amir Szekely
- ORTIM
- Joost Verburg
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute
it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented;
you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment in the
product documentation would be appreciated but is not required.
2. Altered versions must be plainly marked as such,
and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any distribution.
</pre>
</div></td>
</tr>
</table>
</td></tr>
</table>
</div>
</body>
</html>