NSIS/Contrib/Modern UI/Readme.html
2003-09-23 18:34:01 +00:00

758 lines
36 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>NSIS Modern User Interface</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;
}
p
{
font-size: 10pt;
}
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;
color: #303030;
}
.parameter
{
font-weight: bold;
color: #6586AC;
}
.header
{
font-size: 14pt;
color: #7A7272;
}
.subheader
{
margin: 20px;
font-size: 12pt;
font-weight: bold;
color: #303030;
}
.sub2header
{
margin: 20px;
font-size: 11pt;
font-weight: bold;
color: #2B5885;
}
.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;
}
</style>
</head>
<body>
<div class="center">
<table width="750" class="maintable" cellspacing="0" cellpadding="0">
<tr><td>
<table cellspacing="0" cellpadding="0">
<tr>
<td><img src="Readme.jpg" width="750" height="80" alt="" /></td>
</tr>
<tr>
<td><div class="margin">
<p class="header">Introduction</p>
<p class="text">NSIS 2 makes it is possible to create installers
with a custom user interface. The Modern UI is an interface with a
style like the wizards of recent Windows versions.</p>
<p class="text">This new interface also features new pages
(Welcome, Finish, Start Menu) and a description area on the components
page. The interface and the graphics can be customized using the
provided settings.</p>
<p class="text">Using the Modern UI macros and language files,
writing scripts with a modern interface is easy. This document contains
information about writing Modern UI scripts and a reference of all
settings.</p>
<p class="text"><span class="bold">Important: </span>Because the Modern
UI has its own macro system, its own default settings and a lot of
new features, the interface configuration works differently. So you
should not use commands like Icon, CheckBitmap, InstallColors etc.</p>
<p class="header">Screenshots</p>
<p class="text"><img src="Screenshot.png" width="503" height="393" alt="" /></p>
<p class="text"><img src="Screenshot2.png" width="503" height="393" alt="" /></p>
<p class="header">How to use</p>
<p class="text">The Modern UI has a macro system, so all the code to
control the interface has already been written for you.</p>
<p class="text">If you want to start a new Modern UI script or upgrade
an older script with the Classic UI, follow the steps below.</p>
<p class="text">Taking a look at the <a href="#examples">example</a> scripts
will also help you to learn more about the Modern UI.</p>
<p class="subheader">Syntax</p>
<p class="text">Most defines (i.e. MUI_COMPONENTSPAGE_SMALLDESC) don't need a value, they are true/false settings.
Others (i.e. MUI_FINISHPAGE_RUN) can be used to define a specific
value.</p>
<p class="text">Parameters are specified in this format:
<span class="parameter">required (option1 | option2)
[optional]</span></p>
<p class="text">You should put all parameters in one string for the define:</p>
<pre class="margin">
!define MUI_STARTMENUPAGE_NODISABLE ;No value
!define MUI_FINISHPAGE_RUN "$INSTDIR\Application.exe" ;Value
!define MUI_INSTALLCOLORS "FFFFFF 000000" ;Multiple settings
!define MUI_LICENSEPAGE_TEXT '"Text"' ;Text
!define MUI_LICENSEPAGE_TEXT '"Text" "Buttontext"' ;Multiple texts
</pre>
<p class="text">If you want a certain value (i.e. a text) to be language-specific, set a language string (using LangString)
and define $(LANGUAGESTRINGNAME) as value. Use a license language string (LicenseLangString) for the license text.</p>
<p class="text">When adding &quot; to a Modern UI string, you should always escape it ($\&quot;),
because the Modern UI macros use &quot; to separate parameters. If you want to set texts like above you have to
escape both &quot; and ' (using $\&quot; and $\').</p>
<p class="subheader">1. Include the header file</p>
<pre class="margin">!include "MUI.nsh"</pre>
<p class="text">MUI.nsh is in the Include directory, so you don't have
to specify a path.</p>
<p class="subheader">2. Pages</p>
<p class="text">Insert the following macros to set the pages you want to use.
The pages will appear in the order you insert them in your script.
You can also insert custom Page commands between the macros to add custom pages.
<a href="#customPages">More info about custom pages...</a></p>
<p class="text">You can add multiple pages of certain types (for example, if you
want the user to specify multiple folders).</p>
<p class="text">Examples:</p>
<pre class="margin">
!insertmacro MUI_PAGE_LICENSE "License.rtf"
!insertmacro MUI_PAGE_COMPONENTS</pre>
<p class="text">
<span class="bold">Installer Pages</span><br />
MUI_PAGE_WELCOME<br />
MUI_PAGE_LICENSE <span class="parameter">text/rtf_file</span><br />
MUI_PAGE_COMPONENTS<br />
MUI_PAGE_DIRECTORY<br />
MUI_PAGE_STARTMENU<br />
MUI_PAGE_INSTFILES<br />
MUI_PAGE_FINISH
</p>
<p class="text">
<span class="bold">Uninstaller Pages</span><br />
MUI_UNPAGE_CONFIRM<br />
MUI_UNPAGE_LICENSE <span class="parameter">text/rtf_file</span><br />
MUI_UNPAGE_COMPONENTS<br />
MUI_UNPAGE_DIRECTORY<br />
MUI_UNPAGE_INSTFILES<br />
</p>
<p class="sub2header">Page Settings</p>
<div class="margin">
<p class="text">To configure a page, you can define the page settings before inserting a page macro.</p>
<p class="sub2header">General Page Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_PAGE_HEADER_TEXT </span><span class="parameter">text </span><br />
Custom text to display on the header of the page.</p>
<p class="text"><span class="bold">MUI_PAGE_HEADER_SUBTEXT </span><span class="parameter">text </span><br />
Custom subtext to display on the header of the page.</p>
</div>
<p class="sub2header">Welcome Page Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_WELCOMEPAGE_TITLE </span><span class="parameter">title </span><br />
Title to display on the welcome page.</p>
<p class="text"><span class="bold">MUI_WELCOMEPAGE_TEXT </span><span class="parameter">text </span><br />
Texts to display on the welcome page. Use \r\n for a newline.</p>
</div>
<p class="sub2header">License Page Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_LICENSEPAGE_TEXT </span><span class="parameter">text [buttontext]</span><br />
Texts to display on the inner dialog of the license page. See syntax information about setting multiple texts.</p>
<p class="text"><span class="bold">MUI_LICENSEPAGE_TEXT_TOP </span><span class="parameter">text</span><br />
Text to display on the top of the inner dialog of the license page.</p>
<p class="text"><span class="bold">MUI_LICENSEPAGE_CHECKBOX</span><br />
Display a checkbox the user has to check to agree with the license terms.</p>
<p class="text"><span class="bold">MUI_LICENSEPAGE_RADIOBUTTONS</span><br />
Display two radiobuttons to allow the user to choose between accepting the
license terms or not.</p>
</div>
<p class="sub2header">Components Page Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_COMPONENTSPAGE_TEXT </span><span class="parameter">text [subtext] [subtext2]</span><br />
Texts to display on the inner dialog of the components page. See syntax information about setting multiple texts.</p>
</div>
<p class="sub2header">Directory Page Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_DIRECTORYPAGE_TEXT </span><span class="parameter">text [subtext]</span><br />
Texts to display on the inner dialog of the directory page. See syntax information about setting multiple texts.</p>
<p class="text"><span class="bold">MUI_DIRECTORYPAGE_VARIABLE </span><span class="parameter">variable</span><br />
Variable in which to store the selected folder<br />
<i>Default: $INSTDIR</i></p>
</div>
<p class="sub2header">Start Menu Folder Page Settings</p>
<div class="margin">
<p class="text">Put the code to write the shortcuts (using CreateShortcut) between this macros:</p>
<pre class="margin">
!insertmacro MUI_STARTMENU_WRITE_BEGIN
...create the shortcuts...
!insertmacro MUI_STARTMENU_WRITE_END
</pre>
<p class="text">When using multiple Start Menu Folder pages, you should also undefine previous StartMenu page
defines and define the values of the page of which you want to write the value, before inserting the
MUI_STARTMENU_WRITE_BEGIN macro.</p>
<p class="text"><span class="bold">MUI_STARTMENUPAGE_VARIABLE </span><span class="parameter">variable</span><br />
Variable to store the current Start Menu Folder. Default is $MUI_STARTMENU_FOLDER.
You cannot use this variable in your script (or you should Push/Pop it).</p>
<p class="text"><span class="bold">MUI_STARTMENUPAGE_DEFAULTFOLDER </span><span class="parameter">folder</span><br />
The default Start Menu Folder.</p>
<p class="text"><span class="bold">MUI_STARTMENUPAGE_NODISABLE</span><br />
Do not display the checkbox to disable the creation of Start Menu
shortcuts.</p>
<p class="text"><span class="bold">MUI_STARTMENUPAGE_REGISTRY_ROOT </span><span class="parameter">root</span><br />
<span class="bold">MUI_STARTMENUPAGE_REGISTRY_KEY </span><span class="parameter">key</span><br />
<span class="bold">MUI_STARTMENUPAGE_REGISTRY_VALUENAME </span><span class="parameter">value_name</span><br />
The registry key to store the Start Menu folder. The page will use it to
remember the users preference. You should also use it in the uninstaller to
remove the Start Menu folders. Don't forget to remove this key in the
uninstaller.</p>
<p class="text">In the uninstaller, use the MUI_STARTMENU_GETFOLDER macro to get the Start Menu folder:</p>
<pre class="margin">
!insertmacro MUI_STARTMENU_GETFOLDER $R0 ;You can also use another var
Delete "$SMPROGRAMS\$R0\Your Shortcut.lnk"
</pre>
<p class="text">When using multiple Start Menu Folder pages, you should also undefine previous StartMenu page
defines and define the values of the page of which you want to get the value, before inserting the
MUI_STARTMENU_GETFOLDER macro.</p>
</div>
<p class="sub2header">Finish Page Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_FINISHPAGE_RUN </span><span class="parameter">exe_file</span><br />
Application which the user can select to run using a checkbox.
You don't need to put quotes around the filename when it contains spaces.</p>
<div class="margin">
<p class="text"><span class="bold">MUI_FINISHPAGE_RUN_PARAMETERS </span><span class="parameter">parameters</span><br />
Parameters for the application to run. Don't forget to escape double
quotes in the value (use $\&quot;).</p>
<p class="text"><span class="bold">MUI_FINISHPAGE_RUN_NOTCHECKED</span><br />
Do not check the 'Run program' checkbox by default</p>
<p class="text"><span class="bold">MUI_FINISHPAGE_RUN_FUNCTION </span><span class="parameter">function_name</span><br />
Call a function instead of executing an application (define MUI_FINISHPAGE_RUN without parameters).
You can use the function to exectute multiple applications or you can change the checkbox name and
use it for other things.</p>
</div>
<p class="text"><span class="bold">MUI_FINISHPAGE_SHOWREADME </span><span class="parameter">file/url</span><br />
File or website which the user can select to view using a checkbox.
You don't need to put quotes around the filename when it contains spaces.</p>
<div class="margin">
<p class="text"><span class="bold">MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</span><br />
Do not check the 'Show Readme' checkbox by default</p>
<p class="text"><span class="bold">MUI_FINISHPAGE_SHOWREADME_FUNCTION </span><span class="parameter">function_name</span><br />
Call a function instead of showing a file (define MUI_FINISHPAGE_SHOWREADME without parameters).
You can use the function to show multiple files or you can change the checkbox name and
use it for other things.</p>
</div>
<p class="text"><span class="bold">MUI_FINISHPAGE_LINK </span><span class="parameter">link_text</span><br />
Text for a link on the which the user can click to view a website or file.</p>
<div class="margin">
<p class="text"><span class="bold">MUI_FINISHPAGE_LINK_LOCATION </span><span class="parameter">file/url</span><br />
Website or file which the user can select to view using the link.
You don't need to put quotes around the filename when it contains spaces.</p>
</div>
<p class="text"><span class="bold">MUI_FINISHPAGE_NOAUTOCLOSE</span><br />
Do not automatically jump to the finish page, to allow the user to
check the log.</p>
<p class="text"><span class="bold">MUI_FINISHPAGE_NOREBOOTSUPPORT</span><br />
Disables support for the page that allows the user to reboot the system.
Define this option to save some space if you are not using the /REBOOTOK
flag or SetRebootFlag.</p>
</div>
<p class="sub2header">Advanced Page Settings</p>
<div class="margin">
<p class="text">You can add your custom code to the page functions of Modern UI pages.
<a href="#customFunctions">More info...</a></p>
</div>
</div>
<p class="subheader">3. Interface Settings</p>
<p class="text">Page interface settings apply to all pages of a certain type.</p>
<p class="sub2header">General Interface Settings</p>
<div class="margin">
<p class="text">For UI elements that are enabled by default, the default value will be used when a setting
has not been defined.</p>
<p class="text"><span class="bold">MUI_UI </span><span class="parameter">ui_file</span><br />
The interface file with the dialog resources. Change this if you have made your own customized UI.<br />
<i>Default: ${NSISDIR}\Contrib\UIs\modern.exe</i></p>
<p class="text"><span class="bold">MUI_UI_HEADERBITMAP </span><span class="parameter">ui_file</span><br />
<span class="bold">MUI_UI_HEADERBITMAP_RIGHT </span><span class="parameter">ui_file</span><br />
The interface files with the dialog resource IDD_INST that contains a bitmap control and space for
the header bitmap.<br /><i>Defaults: ${NSISDIR}\Contrib\UIs\modern-headerbmp.exe,
${NSISDIR}\Contrib\UIs\modern-headerbmpr.exe</i></p>
<p class="text"><span class="bold">MUI_UI_SMALLDESCRIPTION<br />MUI_UI_NODESCRIPTION</span><br />
The interface files with a customized dialog resource IDD_SELCOM for a small or no description area.<br />
<i>Defaults: {NSISDIR}\Contrib\UIs\modern-smalldesc.exe, {NSISDIR}\Contrib\UIs\modern-nodesc.exe</i></p>
<p class="text"><span class="bold">MUI_ICON </span><span class="parameter">icon_file</span><br />
The icon of the installer.<br /><i>Default: ${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico</i></p>
<p class="text"><span class="bold">MUI_UNICON </span><span class="parameter">icon_file</span><br />
The icon of the uninstaller.<br /><i>Default: ${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico</i></p>
<p class="text"><span class="bold">MUI_LICENSEBKCOLOR </span><span class="parameter">
(/windows | /grey | (color: RRGGBB hexadecimal))</span><br />
The background color for the license textbox. Use /windows for the default text background (usually white).
Use the /grey for the standard window background (usually grey).<br /><i>Default: /windows</i></p>
<p class="text"><span class="bold">MUI_CHECKBITMAP </span><span class="parameter">bitmap_file</span><br />
The bitmap with images for the checks of the component select treeview.<br />
<i>Default: ${NSISDIR}\Contrib\Graphics\Checks\modern.bmp</i></p>
<p class="text"><span class="bold">MUI_INSTALLCOLORS </span><span class="parameter">(/windows |
(foreground color: RRGGBB hexadecimal) (background color: RRGGBB hexadecimal))</span><br />
The colors of the details screen. Use /windows for the default colors.</p>
<p class="text"><span class="bold">MUI_PROGRESSBAR </span><span class="parameter">("" | colored | smooth)</span><br />
The style of the progress bar. Colored makes it use the MUI_INSTALLCOLORS.<br /><i>Default: smooth</i></p>
<p class="text"><span class="bold">MUI_HEADERBITMAP </span><span class="parameter">bmp_file</span><br />
Bitmap to display in the white header (recommended size: 150x57 pixels). The NSIS Setup uses the bitmap
${NSISDIR}\Contrib\Graphics\Header\nsis.bmp, but can also make one with your own logo.</p>
<div class="margin">
<p class="text"><span class="bold">MUI_HEADERBITMAP_RIGHT</span><br />
Display the header image on the right side instead of the left side.</p>
<p class="text"><span class="bold">MUI_HEADERBITMAP_NOSTRETCH</span><br />
Do not stretch the header bitmap to fit the size of the field. Use this option only if you have an
image that does not use the whole space. If you have a full size bitmap that fits exactly, you should
not use this option because the size of the field will be different if the user has a custom DPI setting.</p>
</div>
<p class="text"><span class="bold">MUI_SPECIALINI </span><span class="parameter">ini_file</span><br />
InstallOptions INI file for the Welcome and Finish page.<br />
<i>Default: ${NSISDIR}\Contrib\Modern UI\ioSpecial.ini</i></p>
<p class="text"><span class="bold">MUI_SPECIALBITMAP </span><span class="parameter">bmp_file</span><br />
Bitmap for the Welcome and Finish page (recommended size: 164x314 pixels).<br />
<i>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</i></p>
<div class="margin">
<p class="text"><span class="bold">MUI_SPECIALBITMAP_NOSTRETCH</span><br />
Do not stretch the bitmap for the Welcome and Finish page to fit the size of the field.
Use this option only if you have an image that does not use the whole space. If you have a full size
bitmap that fits exactly, you should not use this option because the size of the field will be different
if the user has a custom DPI setting.</p>
</div>
<p class="text"><span class="bold">MUI_BGCOLOR </span><span class="parameter">(color: RRGGBBR hexadecimal)</span><br />
Background color for the header, Welcome- and Finish page.<br /><i>Default: FFFFFF</i></p>
<p class="text"><span class="bold">MUI_FINISHPAGE_LINK_COLOR </span><span class="parameter">(color: 0xBBGGRR hexadecimal)</span><br />
Text color for the link on the Finish page.<br /><i>Default: 0x800000</i></p>
<p class="text"><span class="bold">MUI_RTL_UI</span><br />
Right-to-left interface.</p>
</div>
<p class="sub2header">Components Page Interface Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_COMPONENTSPAGE_SMALLDESC</span><br />
A small description area on the bottom of the page. Use this layout
if you have a lot of sections and don't need large descriptions.</p>
<p class="text"><span class="bold">MUI_COMPONENTSPAGE_NODESC</span><br />
No description area.</p>
</div>
<p class="sub2header">Message Settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_ABORTWARNING</span><br />
Show a message box with a warning when the user wants to close the installer.</p>
</div>
<p class="subheader">4. Define custom functions (optional)</p>
<p class="text">If you want add your own code to functions inserted by the
Modern UI (i.e. the .onGUIInit function and the page functions), create your
own function and let the Modern UI functions call them.</p>
<p class="text"><a href="#customFunctions">More info...</a></p>
<p class="subheader">5. Insert language files</p>
<p class="text">Insert the Modern UI language files for the languages you are using:</p>
<pre class="margin">!insertmacro MUI_LANGUAGE "English"</pre>
<p class="text">The Modern UI language files load the NLF language files,
so you should not use LoadLanguageFile.</p>
<p class="sub2header">Customize Modern UI text</p>
<div class="margin">
<p class="text">You don't need to edit the language files if you want to customize
some strings. Use defines before you insert the language file:</p>
<pre class="margin">
!define MUI_TEXT_COMPONENTS_TITLE "Your text"
!insertmacro MUI_LANGUAGE "English"
</pre>
<p class="text">Have a look at the language files for a complete list of all the
string names.</p>
<p class="text">You only have to escape &quot; (using $\&quot;).</p>
<p class="text"><span class="bold">Note: </span>When using different product name (MUI_PRODUCT)
for different languges, !undef MUI_PRODUCT after inserting a language file (or use a language
string).</p>
</div>
<p class="sub2header">Customize fonts</p>
<div class="margin">
<p class="text">You can customize the fonts for a language using the following defines before inserting
a language:</p>
<p class="text"><span class="bold">MUI_FONT_HEADER </span><span class="parameter">font_name</span><br />
<span class="bold">MUI_FONTSIZE_HEADER </span><span class="parameter">font_size</span><br />
<span class="bold">MUI_FONTSTYLE_HEADER </span><span class="parameter">weight [/ITALIC] [/UNDERLINE] [/STRIKE]</span><br />
The font for the title in the header.</p>
<p class="text"><span class="bold">MUI_FONT_TITLE </span><span class="parameter">font_name</span><br />
<span class="bold">MUI_FONTSIZE_TITLE </span><span class="parameter">font_size</span><br />
<span class="bold">MUI_FONTSTYLE_TITLE </span><span class="parameter">weight [/ITALIC] [/UNDERLINE] [/STRIKE]</span><br />
The font for the title on the Welcome and Finish page.</p>
<p class="text"><span class="bold">Note: </span>Page texts can be changed using page settings.</p>
</div>
<p class="sub2header">Language selection dialog</p>
<div class="margin">
<p class="text">If you want the installer to display a language selection dialog
(have a look at the <a href="../../Examples/Modern UI/MultiLanguage.nsi">
MultiLanguage.nsi</a> example), insert the MUI_LANGDLL_DISPLAY macro in .onInit:</p>
<pre class="margin">
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
</pre>
<p class="text">To customize the language selection dialog, use these defines:</p>
<p class="text"><span class="bold">MUI_LANGDLL_WINDOWTITLE </span><span class="parameter">text</span><br />
The window title of the language selection dialog.</p>
<p class="text"><span class="bold">MUI_LANGDLL_INFO </span><span class="parameter">text</span><br />
The text on the language selection dialog.</p>
<p class="text"><span class="bold">MUI_LANGDLL_REGISTRY_ROOT </span><span class="parameter">root</span><br />
<span class="bold">MUI_LANGDLL_REGISTRY_KEY </span><span class="parameter">key</span><br />
<span class="bold">MUI_LANGDLL_REGISTRY_VALUENAME </span><span class="parameter">value_name</span><br />
The registry key to store the language. The users preference will be remembered.
You can also use it in the uninstaller to display the right language. Don't forget
to remove this key in the uninstaller.</p>
<p class="text">In the uninstaller, insert the MUI_UNGETLANGUAGE macro in un.onInit to get the stored language
preference:</p>
<pre class="margin">
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
</pre>
<p class="text"><span class="bold">MUI_LANGDLL_ALWAYSSHOW</span><br />
Always show the language selection dialog, even if a language has been stored in the registry.
The language stored in the registry will be selected by default.</p>
</div>
<p class="subheader">6. Set the descriptions for the sections</p>
<p class="text">The descriptions of sections will be displayed on the
components page, when the user hovers the mouse over a section.
If you don't want to use descriptions, use the MUI_COMPONENTSPAGE_NODESC
setting.</p>
<p class="text">To set a description for a section, you have to add an
additional parameter to the Section commmand with a name for the define
that should contain the section number:</p>
<pre class="margin">
Section "Section Name 1" Section1
...
SectionEnd
</pre>
<p class="text">Use these macros to set the descriptions:</p>
<pre class="margin">
LangString DESC_Section1 ${LANG_ENGLISH} "Description of section 1."
LangString DESC_Section2 ${LANG_ENGLISH} "Description of section 2."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} $(DESC_Section1)
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} $(DESC_Section2)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
</pre>
<p class="text">For the uninstaller, use the MUI_UNFUNCTION_DESCRIPTION_BEGIN
and MUI_UNFUNCTIONS_DESCRIPTION_END macros</p>
<p class="subheader">7. Reserve Files</p>
<p class="text">If you are using BZIP2 compression, you might need to
insert ReserveFile commands. <a href="#ReserveFile">More info...</a></p>
<p class="header"><a name="customPages">Custom pages</a></p>
<p class="subheader">Custom page commands</p>
<p class="text">If you want add custom pages to your installer, you should insert your
own page commands between the page macros:</p>
<pre class="margin">
!insertmacro MUI_PAGE_WELCOME
Page custom FunctionName ;Custom page
!insertmacro MUI_PAGE_COMPONENTS
</pre>
<p class="text">For the uninstaller:</p>
<pre class="margin">
!insertmacro MUI_UNPAGE_CONFIRM
UninstPage custom un.FunctionName ;Custom page
!insertmacro MUI_UNPAGE_INSTFILES
</pre>
<p class="subheader">Call InstallOptions</p>
<p class="text">InstallOptions is a plug-in that displays custom pages that you can create
using INI files.</p>
<p class="text">Have a look at the <a href="..\InstallOptions\Readme.html">
InstallOptions documentation</a> for info about creating InstallOptions INI files.</p>
<p class="text">First, you need to extract your InstallOptions INI
File in the .onInit function (un.onInit for the uninstaller) using
the MUI_INSTALLOPTIONS_EXTRACT macro:</p>
<pre class="margin">
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioFile.ini"
FunctionEnd
</pre>
<p class="text">If your INI File is located in another directory, use
MUI_INSTALLOPTIONS_EXTRACT_AS. The second parameter is the filename for
the Plugins directory. Use this name when inserting the other InstallOptions
macros:</p>
<pre class="margin">
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "..\ioFile.ini" "ioFile.ini"
FunctionEnd
</pre>
<p class="text">You can call Instal Options in the function defined with the Page
or UninstPage command using the MUI_INSTALLOPTIONS_DISPLAY macro.
Use the MUI_HEADER_TEXT macro to set the text in the white box:</p>
<pre class="margin">
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Install Options Page Title"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "A subtitle"
Function FunctionName ;FunctionName defined with Page command
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioFile.ini"
FunctionEnd
</pre>
<p class="text">For custom fonts and colors, macros for the initDialog and show
functions of InstallOptions are also available:</p>
<pre class="margin">
Var HWND
Var DLGITEM
Var FONT
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Install Options Page Title"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "A subtitle"
Function FunctionName ;FunctionName defined with Page command
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioFile.ini"
Pop $HWND ;HWND of dialog
GetDlgItem $DLGITEM $HWND 1200 ;1200 + Field number - 1
;$DLGITEM contains the HWND of the first field
CreateFont $FONT "Tahoma" 10 700
SendMessage $DLGITEM ${WM_SETFONT} $FONT 0
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
</pre>
<p class="text">If you need the InstallOptions return value (success, back, cancel, error),
use the MUI_INSTALLOPTIONS_DISPLAY_RETURN or MUI_INSTALLOPTIONS_SHOW_RETURN macro. The
return value will be added to the stack, so you can use the Pop command to get it.</p>
<p class="text">To read or write INI file values use these macros:</p>
<pre class="margin">
!insertmacro MUI_INSTALLOPTIONS_READ $VAR "ioFile.ini" "Field #" "Value Name"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioFile.ini" "Field #" "Value Name" "Value"
</pre>
<p class="text">For example, you can use the MUI_INSTALLOPTIONS_READ macro in a section
to get the user input:</p>
<pre class="margin">!insertmacro MUI_INSTALLOPTIONS_READ $R0 "ioFile.ini" "Field 1" "State"</pre>
<p class="text">For more details about InstallOptions, validation of user input etc., check the
<a href="..\InstallOptions\Readme.html">InstallOptions documentation</a>.</p>
<p class="header"><a name="ReserveFile">Reserve files</a></p>
<p class="text">If you are using BZIP2 compression, it's important that
files which are being extracted in init- or page functions functions are first in
the data block, because this will make your installer start faster.</p>
<p class="text">If there are File commands in your script above Modern UI settings
or above your own init- or page functions, you have to reserve files:</p>
<pre class="margin">
ReserveFile "ioFile.ini" ;Your own InstallOptions INI files
ReserveFile "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ;Your header bitmap
!insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE ;Welcome- or Finish page
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions
!insertmacro MUI_RESERVEFILE_LANGDLL ;LangDLL (language selection dialog)
!insertmacro MUI_RESERVEFILE_STARTMENU ;Start Menu Folder page
</pre>
<p class="header"><a name="examples">Examples</a></p>
<p class="text">Basic: <a href="../../Examples/Modern UI/Basic.nsi">Basic.nsi</a><br />
Welcome/Finish page: <a href="../../Examples/Modern UI/WelcomeFinish.nsi">WelcomeFinish.nsi</a><br />
Multilanguage: <a href="../../Examples/Modern UI/MultiLanguage.nsi">MultiLanguage.nsi</a><br />
Header bitmap: <a href="../../Examples/Modern UI/HeaderBitmap.nsi">HeaderBitmap.nsi</a><br />
Custom pages: <a href="../../Examples/Modern UI/InstallOptions.nsi">InstallOptions.nsi</a><br />
Start Menu Folder page: <a href="../../Examples/Modern UI/StartMenu.nsi">StartMenu.nsi</a><br />
</p>
<p class="header">Customize the dialogs</p>
<p class="text">To change elements on the dialogs, modify the
resource files Contrib\UIs directory using a resource editor such as
<a href="http://www.users.on.net/johnson/resourcehacker/">Resource Hacker</a>
and use the interface setting to define to filename use your customized UI.</p>
<p class="text">The 'Please wait while Setup is loading...' text
on the splash screen which is being displayed when the installer
is starting (Verifying installer, Unpacking data) cannot be changed
by the script, because the installer is not started yet when this
dialog is being displayed. If you want to change this text, modify
dialog 111 of modern.exe.<br />
The 'Verifying installer' and 'Unpacking data' texts are defined in
the language header file of the NSIS exehead (Source\exehead\lang.h).
To change them, you need to edit this file and recompile NSIS.</p>
<p class="text">To modify the Welcome and Finish dialog, edit the Install
Options INI File ioSpecial.ini in the 'Contrib\Modern UI' directory.</p>
<p class="header"><a name="customFunctions">Customize Modern UI Functions</a></p>
<p class="text">If you want add your own code to functions
inserted by the Modern UI, such as the .onGUIInit function and the Page functions,
create your own function and let the Modern UI functions call them. Use the defines
to define the name of your functions.</p>
<p class="text">Example:</p>
<pre class="text">
!define MUI_CUSTOMFUNCTION_GUIINIT myGuiInit
Function myGUIInit
...your own code...
FunctionEnd
</pre>
<p class="sub2header">General Custom Functions</p>
<div class="margin">
<p class="text">These defines should be set before inserting a the language macros.</p>
<p class="text"><span class="bold">MUI_CUSTOMFUNCTION_GUIINIT </span><span class="parameter">function </span><br />
<span class="bold">MUI_CUSTOMFUNCTION_UNGUIINIT </span><span class="parameter">function </span><br />
<span class="bold">MUI_CUSTOMFUNCTION_ABORT </span><span class="parameter">function </span></p>
</div>
<p class="sub2header">Page Custom Functions</p>
<div class="margin">
<p class="text">These defines should be set before inserting a page macro.</p>
<p class="text"><span class="bold">MUI_PAGE_CUSTOMFUNCTION_PRE </span><span class="parameter">function </span><br />
<span class="bold">MUI_PAGE_CUSTOMFUNCTION_SHOW </span><span class="parameter">function </span><br />
<span class="bold">MUI_PAGE_CUSTOMFUNCTION_LEAVE </span><span class="parameter">function </span></p>
<p class="text"><span class="bold">Notes:</span></p>
<ul>
<li>The StartMenu page does not have a Show function</li>
<li>In the Pre function of the Welcome- and Finish page, you can write to the InstallOptions INI file
of the page (ioSpecial.ini)</li>
<li>In the Show function of Welcome- and Finish page, $MUI_HWND contains the HWND of the inner dialog.</li>
</ul>
</div>
<p class="header">Version history</p>
<ul>
<li>1.66 - September 9, 2003
<ul>
<li>New system for page settings and custom pages</li>
<li>Support for uninstaller components page</li>
<li>Support for multiple pages of the same type</li>
<li>Changed macro names</li>
<li>Updated langauge system, new language files</li>
<li>Removed MUI_PRODUCT and MUI VERSION. Use Name command now.</li>
<li>Removed MUI_BRANDINGTEXT. Use BrandingText command now.</li>
</ul></li>
</ul>
<ul>
<li>1.65 - August 12, 2003
<ul>
<li>New page configuration system, no different system for installers
with custom pages</li>
<li>Default windows color for the license text background</li>
<li>Example script updates (new format, user variables)</li>
<li>Improved registry storage for Start Menu folder</li>
<li>ReserveFile macro for StartMenu plug-in</li>
<li>Option to always show the language selection dialog
(even if a language has been stored in the registry)</li>
<li>Checkboxes on Finish page can be used to call a function</li>
<li>Support for custom leave functions for Start Menu Folder,
Welcome and Finish pages</li>
<li>Support for a link on the Finish page</li>
<li>New macro to get Start Menu folder in uninstaller</li>
<li>Options to disable bitmap stretching</li>
<li>Components page description box info text: always displayed
when mouse is outside box, disabled style</li>
</ul></li>
</ul>
<p class="text"></p>
<ul>
<li>1.64 - April 27, 2003
<ul>
<li>Support for license page with checkbox or radiobuttons to
let the user accept the agreement or not</li>
<li>Macros for finish headers don't have to be inserted anymore</li>
<li>Language preference stored when installation has completed,
no problems anymore when the users selects the wrong language</li>
<li>Header text for aborted installation</li>
<li>New macros: get language for uninstaller, delete shortcuts</li>
<li>Language specific fonts</li>
<li>Welcome/Finish page INI files can be modified in pre functions</li>
<li>More texts can be customized</li>
</ul></li>
</ul>
<p class="text"><a href="Changelog.txt">Complete version history</a></p>
<p class="header">Credits</p>
<p class="text">Made by Joost Verburg.<br />
Icons designed by Nikos Adamamas, aka adni18.<br />
Thanks to Amir Szekely, aka KiCHiK, for his work on NSIS
to make this possible.</p>
<p class="header">Help</p>
<p class="text">Please post questions at the
<a href="http://forums.winamp.com/forumdisplay.php?forumid=65">NSIS Forum</a>.</p>
<p class="header">License</p>
<pre class="margin">Copyright &copy; 2002-2003 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>
<tr>
<td><div class="footer">&copy;2002-2003 Joost Verburg</div></td>
</tr>
</table>
</td></tr>
</table>
</div>
</body>
</html>