Modern UI 1.65

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2571 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-05-25 20:21:21 +00:00
parent 0568d17ef7
commit 1d2cc0db8e
9 changed files with 533 additions and 698 deletions

View file

@ -1,5 +1,11 @@
NSIS Modern User Interface - VERSION HISTORY
1.65 - May 25, 2003
* New page configuration system, no different system for installers
with custom pages
* Default windows color for the license text background
* New format for example scripts
1.64 - April 27, 2003
* Support for license page with checkbox or radiobuttons to let the
user accept the agreement or not

View file

@ -65,11 +65,19 @@ table
.subheader
{
margin: 20px;
font-size: 11pt;
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;
@ -142,31 +150,49 @@ follow these steps:</p>
to specify a path.</p>
<p class="subheader">2. Define the name and version of your software</p>
<pre class="margin">
!define MUI_PRODUCT "Test Software" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
!define MUI_PRODUCT "Your Software"
!define MUI_VERSION "1.0"
</pre>
<p class="subheader">3. Defines</p>
<p class="text">Use defines to let the Modern UI know what it
should insert. Most defines (i.e. MUI_WELCOMEPAGE) don't need
a value, there are true/false settings. Others
<p class="subheader">3. Pages</p>
<p class="text">Insert the following macro's to set the pages you want to use
and the order of the pages. You can insert custom Page commmands between
the macro's to add custom pages.<br />
<a href="#customPages">More info about custom pages...</a></p>
<p class="text">Example:</p>
<pre class="margin">!insertmacro MUI_PAGE_COMPONENTS</pre>
<p class="text">
<span class="bold">Installer Pages</span><br />
MUI_PAGE_WELCOME<br />
MUI_PAGE_LICENSE<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_INSTFILES<br />
</p>
<p class="subheader">4. Defines</p>
<p class="text">You can use defines to configure the Modern UI.
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.<br />
Parameters are specified in this format:
value.</p>
<p class="text">Parameters are specified in this format:
<span class="parameter">required (option1 | option2)
[optional]</span>.<br />
You should put all parameters in one string for the define:</p>
[optional]</span>.</p>
<p class="text">You should put all parameters in one string for the define:</p>
<pre class="margin">
!define MUI_WELCOMEPAGE ;No value
!define MUI_FINISHPAGE_RUN "$INSTDIR\Application.exe" ;Value
!define MUI_INSTALLCOLORS "FFFFFF 000000" ;Multiple parameters
</pre>
<p class="text">All defines are optional.</p>
<p class="subheader">3a. General settings</p>
<p class="text"><span class="bold">MUI_WELCOMEPAGE</span><br />
Show the welcome page. The welcome page is an introduction
and shows information for the user.</p>
<p class="text"><span class="bold">MUI_LICENSEPAGE</span><br />
Show the license page.</p>
<p class="subheader">4a. General settings</p>
<p class="sub2header">License Page Settings</p>
<div class="margin">
<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>
@ -174,8 +200,7 @@ follow these steps:</p>
Display two radiobuttons to allow the user to choose between accepting the
license terms or not.</p>
</div>
<p class="text"><span class="bold">MUI_COMPONENTSPAGE</span><br />
Show the component selection page.</p>
<p class="sub2header">Components Page 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
@ -183,11 +208,9 @@ follow these steps:</p>
<p class="text"><span class="bold">MUI_COMPONENTSPAGE_NODESC</span><br />
No description area.</p>
</div>
<p class="text"><span class="bold">MUI_DIRECTORYPAGE</span><br />
Show the directory selection page.</p>
<p class="text"><span class="bold">MUI_STARTMENUPAGE</span><br />
Show the Start Menu Folder selection page.<br /><br />
If you did not disable the 'Do not create shortcuts' checkbox,
<p class="sub2header">Start Menu Folder Selection Page Settings</p>
<div class="margin">
<p class="text">If you did not disable the 'Do not create shortcuts' checkbox,
put the script code to write the shortcuts between these macro's,
because the creation can be disabled by the user:</p>
<pre class="margin">
@ -195,7 +218,6 @@ follow these steps:</p>
...create the shortcuts...
!insertmacro MUI_STARTMENU_WRITE_END
</pre>
<div class="margin">
<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 $9.
You cannot use this variable in your script (or you should Push/Pop it).</p>
@ -218,11 +240,7 @@ follow these steps:</p>
!insertmacro MUI_STARTMENU_DELETE_END
</pre>
</div>
<p class="text"><span class="bold">MUI_FINISHPAGE</span><br />
Show the finish page. The finish page tells that the installation is succesful.
You can also add options to run the application or show the Readme file.
If the reboot flag is set, a page that allows the user to reboot the system
will be displayed (this option can be disabled).</p>
<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).
@ -250,22 +268,13 @@ follow these steps:</p>
Define this option to save some space if you are not using the /REBOOTOK
flag or SetRebootFlag.</p>
</div>
<p class="sub2header">Other settings</p>
<div class="margin">
<p class="text"><span class="bold">MUI_ABORTWARNING</span><br />
Show a message box with a warning (are you sure?) when the user closes
the installation.</p>
<p class="text"><span class="bold">MUI_CUSTOMPAGECOMMANDS</span><br />
Don't insert Page commands. Use this if you are using custom Page
commands to add your own pages.</p>
<p class="text"><span class="bold">MUI_UNINSTALLER</span><br />
Define if you are using an uninstaller.</p>
<div class="margin">
<p class="text"><span class="bold">MUI_UNCONFIRMPAGE</span><br />
Show the uninstall confirm page.</p>
<p class="text"><span class="bold">MUI_UNCUSTOMPAGECOMMANDS</span><br />
Don't insert UninstPage commands. Use this if you are using custom
UninstPage commands to add your own pages.</p>
</div>
<p class="subheader">3b. Interface settings</p>
<p class="subheader">4b. Interface settings</p>
<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 />
@ -283,12 +292,14 @@ follow these steps:</p>
The icon of the installer.<br /><i>Default: ${NSISDIR}\Contrib\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\Icons\modern-uninstall.ico</i></p>
<p class="text"><span class="bold">MUI_LICENSEBKCOLOR </span><span class="parameter">color: RRGGBB</span><br />
The background color for the license textbox.<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\Icons\modern.bmp</i></p>
<p class="text"><span class="bold">MUI_INSTALLCOLORS </span><span class="parameter">(/windows | (foreground color: RRBBGG)
(background color: RRGGBB))</span>
<br />The colors of the details screen. Use /windows instead of the colors to use the Windows
<p class="text"><span class="bold">MUI_INSTALLCOLORS </span><span class="parameter">(/windows | (foreground color: RRGGBB)
(background color: RRGGBB))</span><br />
The colors of the details screen. Use /windows instead of the colors to use the Windows
colors (the default).<br /><i>Default: /windows</i></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>
@ -301,7 +312,7 @@ follow these steps:</p>
Display the header image on the right side instead of the left side.</p>
</div>
<p class="text"><span class="bold">MUI_SPECIALINI </span><span class="parameter">ini_file</span><br />
Install Options INI File for the Welcome and Finish page.<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.<br /><i>Default: ${NSISDIR}\Contrib\Icons\modern-wizard.bmp</i></p>
@ -309,15 +320,11 @@ follow these steps:</p>
Background color for the header, Welcome page and Finish page.<br /><i>Default: 0xFFFFFF</i></p>
<p class="text"><span class="bold">MUI_RTL_UI</span><br />
Right-to-left interface.</p>
<p class="subheader">4. Define custom functions (optional)</p>
<p class="subheader">5. Define custom functions (optional)</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 function, create your
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 custom pages (optional)</p>
<p class="text">If you want to use custom pages (define MUI_CUSTOMPAGECOMMANDS
or MUI_UNCUSTOMPAGECOMMANDS), insert them before inserting the language files.</p>
<p class="text"><a href="#customPages">More info...</a></p>
<p class="subheader">6. 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>
@ -334,14 +341,19 @@ follow these steps:</p>
<p class="text">You can customize texts that can be set in the Classic UI using the LicenseText,
ComponentText, DirText and MiscButtonText commands but are not being changed by the Modern UI using
these defines:</p>
<pre class="margin">
MUI_BUTTONTEXT_LICENSE, MUI_BUTTONTEXT_BACK, MUI_BUTTONTEXT_NEXT,
MUI_BUTTONTEXT_CANCEL
MUI_INNERTEXT_COMPONENTS_SUB1, MUI_INNERTEXT_COMPONENTS_SUB2
MUI_TEXT_DIRECTORY_BROWSE
</pre>
<p class="text">
<span class="bold">MUI_BUTTONTEXT_LICENSE </span><span class="parameter">text</span><br />
<span class="bold">MUI_BUTTONTEXT_BACK </span><span class="parameter">text</span><br />
<span class="bold">MUI_BUTTONTEXT_NEXT </span><span class="parameter">text</span><br />
<span class="bold">MUI_BUTTONTEXT_CANCEL </span><span class="parameter">text</span>
</p>
<p class="text">
<span class="bold">MUI_INNERTEXT_COMPONENTS_SUB1 </span><span class="parameter">text</span><br />
<span class="bold">MUI_INNERTEXT_COMPONENTS_SUB2 </span><span class="parameter">text</span>
</p>
<p class="text">
<span class="bold">MUI_TEXT_DIRECTORY_BROWSE </span><span class="parameter">text</span>
</p>
<p class="text">You can also customize the fonts for a language using the following defines:</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 />
@ -351,7 +363,7 @@ MUI_TEXT_DIRECTORY_BROWSE
<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">Language selection dialog</span></p>
<p class="sub2header">Language selection dialog</p>
<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>
@ -409,29 +421,23 @@ 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 to set the order of the pages and the names of the page functions.
For the normal Modern UI pages, insert one of the PAGECOMMAND macro's:</p>
own page commands between the page macro's:</p>
<pre class="margin">
!insertmacro MUI_PAGECOMMAND_WELCOME
!insertmacro MUI_PAGECOMMAND_LICENSE
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGE_WELCOME
Page custom FunctionName ;Custom page
!insertmacro MUI_PAGECOMMAND_INSTFILES
!insertmacro MUI_PAGECOMMAND_FINISH
!insertmacro MUI_COMPONENTS
</pre>
<p class="text">For the uninstaller:</p>
<pre class="margin">
!insertmacro MUI_UNPAGECOMMAND_CONFIRM
!insertmacro MUI_UNPAGE_CONFIRM
UninstPage custom un.FunctionName ;Custom page
!insertmacro MUI_UNPAGECOMMAND_INSTFILES
!insertmacro MUI_UNPAGE_INSTFILES
</pre>
<p class="text">Don't forget to define MUI_CUSTOMPAGECOMMANDS or
MUI_UNCUSTOMPAGECOMMANDS and to insert the Page commands on the
right position.</p>
<p class="subheader">Call Install Options</p>
<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">
Install Options documentation</a> for info about creating Install Options INI Files.</p>
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>
@ -449,9 +455,9 @@ Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "..\ioFile.ini" "ioFile.ini"
FunctionEnd
</pre>
<p class="text">You can call Install Options in the function defined with the Page
or UninstPage command. Use the MUI_HEADER_TEXT macro to set the text in the
white box:</p>
<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"
@ -476,7 +482,7 @@ Function FunctionName ;FunctionName defined with Page command
Push $R2
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioFile.ini"
Pop $R0
Pop $R0 ;HWND of dialog
GetDlgItem $R1 $R0 1200 ;1200 + Field number - 1
@ -486,22 +492,27 @@ Function FunctionName ;FunctionName defined with Page command
!insertmacro MUI_INSTALLOPTIONS_SHOW
Pop $R1
Pop $R2
Pop $R1
Pop $R0
FunctionEnd
</pre>
<p class="text">To read or write values to the INI Files on runtime, use these macro's:</p>
<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 macro's:</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">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">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 the .onInit function or in Page
functions are first in the data block, because this will make your installer
@ -614,6 +625,16 @@ MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE
</p>
<p class="header">Version history</p>
<ul>
<li>1.65 - May 25, 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>New format for example scripts</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
@ -650,7 +671,6 @@ MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE
<li>RTL support</li>
<li>Documentation updates</li>
<li>Minor fixes</li>
<li>No changed language strings</li>
</ul></li>
</ul>
<p class="text"><a href="Changelog.txt">Complete version history</a></p>

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,18 @@
;NSIS Modern User Interface version 1.64
;NSIS Modern User Interface version 1.65
;Basic Example Script
;Written by Joost Verburg
!define MUI_PRODUCT "Modern UI Test" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Product Info
!define MUI_PRODUCT "Modern UI Test"
!define MUI_VERSION "1.65"
;--------------------------------
;Configuration
@ -19,28 +25,26 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
;--------------------------------
;Data
@ -50,7 +54,7 @@
;--------------------------------
;Installer Sections
Section "modern.exe" SecCopyUI
Section "Dummy Test File" SecCopyUI
;ADD YOUR OWN STUFF HERE!
@ -68,6 +72,8 @@ SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy modern.exe to the application folder."
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END

View file

@ -1,12 +1,18 @@
;NSIS Modern User Interface version 1.64
;NSIS Modern User Interface version 1.65
;Header Bitmap Example Script
;Written by Joost Verburg
!define MUI_PRODUCT "Modern UI Test" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Product Info
!define MUI_PRODUCT "Modern UI Test"
!define MUI_VERSION "1.65"
;--------------------------------
;Configuration
@ -19,30 +25,27 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
!define MUI_HEADERBITMAP "${NSISDIR}\Contrib\Icons\modern-header.bmp"
!define MUI_ABORTWARNING
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
;--------------------------------
;Data
@ -53,14 +56,14 @@
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only useful for BZIP2 compression
;Only for BZIP2 compression
ReserveFile "${NSISDIR}\Contrib\Icons\modern-header.bmp"
;--------------------------------
;Installer Sections
Section "modern.exe" SecCopyUI
Section "Dummy Test File" SecCopyUI
;ADD YOUR OWN STUFF HERE!
@ -78,6 +81,8 @@ SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy modern.exe to the application folder."
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END

View file

@ -1,13 +1,19 @@
;NSIS Modern User Interface version 1.64
;NSIS Modern User Interface version 1.65
;InstallOptions Example Script
;Written by Joost Verburg
!define MUI_PRODUCT "Modern UI Test" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
!define TEMP $R0
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
!define TEMP $R0
;--------------------------------
;Product Info
!define MUI_PRODUCT "Modern UI Test"
!define MUI_VERSION "1.65"
;--------------------------------
;Configuration
@ -21,45 +27,29 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE
Page custom CustomPageA
!insertmacro MUI_PAGE_COMPONENTS
Page custom CustomPageB
!insertmacro MUI_PAGE_DIRECTORY
Page custom CustomPageC
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
!define MUI_CUSTOMPAGECOMMANDS
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
;--------------------------------
;Pages
!insertmacro MUI_PAGECOMMAND_LICENSE
Page custom SetCustomA
Page custom SetCustomB
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
Page custom SetCustomC
!insertmacro MUI_PAGECOMMAND_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
;Header
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "InstallOptions Page"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Create your own dialog!"
;--------------------------------
;Data
@ -70,7 +60,7 @@
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only useful for BZIP2 compression
;Only for BZIP2 compression
ReserveFile "ioA.ini"
ReserveFile "ioB.ini"
@ -80,9 +70,9 @@
;--------------------------------
;Installer Sections
Section "modern.exe" SecCopyUI
Section "Dummy Test File" SecCopyUI
;Add your stuff here
;ADD YOUR OWN STUFF HERE!
SetOutPath "$INSTDIR"
File "${NSISDIR}\Contrib\UIs\modern.exe"
@ -90,57 +80,69 @@ Section "modern.exe" SecCopyUI
;Store install folder
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR
;Read a value from an InstallOptions INI File
!insertmacro MUI_INSTALLOPTIONS_READ ${TEMP} "ioC.ini" "Field 2" "State"
StrCmp ${TEMP} "1" "" +2
;Checked
MessageBox MB_OK "A MessageBox..."
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Read a value from an InstallOptions INI file
!insertmacro MUI_INSTALLOPTIONS_READ ${TEMP} "ioC.ini" "Field 2" "State"
;Display a messagebox if check box was checked
StrCmp ${TEMP} "1" "" +2
MessageBox MB_OK "You checked the check box, here is the MessageBox..."
SectionEnd
;--------------------------------
;Descriptions
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
;--------------------------------
;Installer Functions
Function .onInit
;Extract InstallOptions INI Files
;Extract InstallOptions INI files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioA.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioB.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioC.ini"
FunctionEnd
Function SetCustomA
LangString TEXT_IO_TITLE ${LANG_ENGLISH} "InstallOptions page"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "This is a page created using the InstallOptions plug-in."
Function CustomPageA
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
FunctionEnd
Function SetCustomB
Function CustomPageB
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioB.ini"
FunctionEnd
Function SetCustomC
Function CustomPageC
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioC.ini"
FunctionEnd
;--------------------------------
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy modern.exe to the application folder."
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;Add your stuff here
;ADD YOUR OWN STUFF HERE!
Delete "$INSTDIR\modern.exe"
Delete "$INSTDIR\Uninstall.exe"
@ -148,5 +150,5 @@ Section "Uninstall"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
SectionEnd

View file

@ -1,12 +1,18 @@
;NSIS Modern User Interface version 1.64
;MultiLanguage Example Script
;NSIS Modern User Interface version 1.65
;Multilingual Example Script
;Written by Joost Verburg
!define MUI_PRODUCT "Modern UI Test" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Product Info
!define MUI_PRODUCT "Modern UI Test"
!define MUI_VERSION "1.65"
;--------------------------------
;Configuration
@ -19,21 +25,25 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\${MUI_PRODUCT}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;--------------------------------
;Modern UI Configuration
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
;--------------------------------
;Languages
@ -52,6 +62,7 @@
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Ukrainian"
@ -66,51 +77,18 @@
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Catalan"
;--------------------------------
;Language Strings
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "modern.exe: English description"
LangString DESC_SecCopyUI ${LANG_FRENCH} "modern.exe: French description"
LangString DESC_SecCopyUI ${LANG_GERMAN} "modern.exe: German description"
LangString DESC_SecCopyUI ${LANG_SPANISH} "modern.exe: Spanish description"
LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "modern.exe: Simplified Chinese description"
LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "modern.exe: Traditional Chinese description"
LangString DESC_SecCopyUI ${LANG_JAPANESE} "modern.exe: Japanese description"
LangString DESC_SecCopyUI ${LANG_KOREAN} "modern.exe: Korean description"
LangString DESC_SecCopyUI ${LANG_ITALIAN} "modern.exe: Italian description"
LangString DESC_SecCopyUI ${LANG_DUTCH} "modern.exe: Dutch description"
LangString DESC_SecCopyUI ${LANG_DANISH} "modern.exe: Danish description"
LangString DESC_SecCopyUI ${LANG_SWEDISH} "modern.exe: Swedish description"
LangString DESC_SecCopyUI ${LANG_GREEK} "modern.exe: Greek description"
LangString DESC_SecCopyUI ${LANG_RUSSIAN} "modern.exe: Russian description"
LangString DESC_SecCopyUI ${LANG_PORTUGUESEBR} "modern.exe: Portuguese (Brasil) description"
LangString DESC_SecCopyUI ${LANG_POLISH} "modern.exe: Polish description"
LangString DESC_SecCopyUI ${LANG_UKRAINIAN} "modern.exe: Ukrainian description"
LangString DESC_SecCopyUI ${LANG_CZECH} "modern.exe: Czechian description"
LangString DESC_SecCopyUI ${LANG_SLOVAK} "modern.exe: Slovakian description"
LangString DESC_SecCopyUI ${LANG_CROATIAN} "modern.exe: Slovakian description"
LangString DESC_SecCopyUI ${LANG_BULGARIAN} "modern.exe: Bulgarian description"
LangString DESC_SecCopyUI ${LANG_HUNGARIAN} "modern.exe: Hungarian description"
LangString DESC_SecCopyUI ${LANG_THAI} "modern.exe: Thai description"
LangString DESC_SecCopyUI ${LANG_ROMANIAN} "modern.exe: Romanian description"
LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "modern.exe: Macedonian description"
LangString DESC_SecCopyUI ${LANG_TURKISH} "modern.exe: Turkish description"
LangString DESC_SecCopyUI ${LANG_LITHUANIAN} "modern.exe: Lithuanian description"
LangString DESC_SecCopyUI ${LANG_CATALAN} "modern.exe: Catalan description"
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only useful for BZIP2 compression
;Only for BZIP2 compression
!insertmacro MUI_RESERVEFILE_LANGDLL
;--------------------------------
;Installer Sections
Section "modern.exe" SecCopyUI
Section "Dummy Test File" SecCopyUI
;ADD YOUR OWN STUFF HERE!
@ -120,8 +98,9 @@ Section "modern.exe" SecCopyUI
;Store install folder
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
@ -136,6 +115,36 @@ FunctionEnd
;--------------------------------
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "modern.exe: English description"
LangString DESC_SecCopyUI ${LANG_FRENCH} "modern.exe: French description"
LangString DESC_SecCopyUI ${LANG_GERMAN} "modern.exe: German description"
LangString DESC_SecCopyUI ${LANG_SPANISH} "modern.exe: Spanish description"
LangString DESC_SecCopyUI ${LANG_SIMPCHINESE} "modern.exe: Simplified Chinese description"
LangString DESC_SecCopyUI ${LANG_TRADCHINESE} "modern.exe: Traditional Chinese description"
LangString DESC_SecCopyUI ${LANG_JAPANESE} "modern.exe: Japanese description"
LangString DESC_SecCopyUI ${LANG_KOREAN} "modern.exe: Korean description"
LangString DESC_SecCopyUI ${LANG_ITALIAN} "modern.exe: Italian description"
LangString DESC_SecCopyUI ${LANG_DUTCH} "modern.exe: Dutch description"
LangString DESC_SecCopyUI ${LANG_DANISH} "modern.exe: Danish description"
LangString DESC_SecCopyUI ${LANG_SWEDISH} "modern.exe: Swedish description"
LangString DESC_SecCopyUI ${LANG_GREEK} "modern.exe: Greek description"
LangString DESC_SecCopyUI ${LANG_RUSSIAN} "modern.exe: Russian description"
LangString DESC_SecCopyUI ${LANG_PORTUGUESE} "modern.exe: Portuguese description"
LangString DESC_SecCopyUI ${LANG_PORTUGUESEBR} "modern.exe: Portuguese (Brasil) description"
LangString DESC_SecCopyUI ${LANG_POLISH} "modern.exe: Polish description"
LangString DESC_SecCopyUI ${LANG_UKRAINIAN} "modern.exe: Ukrainian description"
LangString DESC_SecCopyUI ${LANG_CZECH} "modern.exe: Czechian description"
LangString DESC_SecCopyUI ${LANG_SLOVAK} "modern.exe: Slovakian description"
LangString DESC_SecCopyUI ${LANG_CROATIAN} "modern.exe: Slovakian description"
LangString DESC_SecCopyUI ${LANG_BULGARIAN} "modern.exe: Bulgarian description"
LangString DESC_SecCopyUI ${LANG_HUNGARIAN} "modern.exe: Hungarian description"
LangString DESC_SecCopyUI ${LANG_THAI} "modern.exe: Thai description"
LangString DESC_SecCopyUI ${LANG_ROMANIAN} "modern.exe: Romanian description"
LangString DESC_SecCopyUI ${LANG_MACEDONIAN} "modern.exe: Macedonian description"
LangString DESC_SecCopyUI ${LANG_TURKISH} "modern.exe: Turkish description"
LangString DESC_SecCopyUI ${LANG_LITHUANIAN} "modern.exe: Lithuanian description"
LangString DESC_SecCopyUI ${LANG_CATALAN} "modern.exe: Catalan description"
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END

View file

@ -1,12 +1,20 @@
;NSIS Modern User Interface version 1.64
;NSIS Modern User Interface version 1.65
;Start Menu Folder Selection Example Script
;Written by Joost Verburg
!define MUI_PRODUCT "Modern UI Test" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
!define TEMP $R0
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Product Info
!define MUI_PRODUCT "Modern UI Test"
!define MUI_VERSION "1.65"
;--------------------------------
;Configuration
@ -18,9 +26,26 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
!define MUI_ABORTWARNING
;$9 is being used to store the Start Menu Folder.
;Do not use this variable in your script (or Push/Pop it)!
;Do not use this variable in your script!
;To change this variable, use MUI_STARTMENUPAGE_VARIABLE.
;Have a look at the Readme for info about other options (default folder,
@ -31,31 +56,10 @@
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${MUI_PRODUCT}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!define TEMP $R0
;--------------------------------
;Modern UI Configuration
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_STARTMENUPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
;--------------------------------
;Data
@ -65,7 +69,7 @@
;--------------------------------
;Installer Sections
Section "modern.exe" SecCopyUI
Section "Dummy Test File" SecCopyUI
;ADD YOUR OWN STUFF HERE!
@ -75,6 +79,9 @@ Section "modern.exe" SecCopyUI
;Store install folder
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN
;Create shortcuts
@ -83,15 +90,14 @@ Section "modern.exe" SecCopyUI
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy modern.exe to the application folder."
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
@ -105,6 +111,10 @@ Section "Uninstall"
Delete "$INSTDIR\modern.exe"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
!insertmacro MUI_STARTMENU_DELETE_BEGIN ${TEMP}
@ -114,8 +124,4 @@ Section "Uninstall"
!insertmacro MUI_STARTMENU_DELETE_END
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
SectionEnd

View file

@ -1,12 +1,18 @@
;NSIS Modern User Interface version 1.64
;NSIS Modern User Interface version 1.65
;Welcome/Finish Page Example Script
;Written by Joost Verburg
!define MUI_PRODUCT "Modern UI Test" ;Define your own software name here
!define MUI_VERSION "1.0" ;Define your own software version here
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Product Info
!define MUI_PRODUCT "Modern UI Test"
!define MUI_VERSION "1.65"
;--------------------------------
;Configuration
@ -19,57 +25,48 @@
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\${MUI_PRODUCT}" ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Modern UI Configuration
!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_FINISHPAGE
!define MUI_FINISHPAGE_RUN "$INSTDIR\modern.exe"
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE
!define MUI_FINISHPAGE_RUN "$INSTDIR\modern.exe"
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Language Strings
;Description
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy the modern.exe file to the application folder."
;--------------------------------
;Data
LicenseData "${NSISDIR}\Contrib\Modern UI\License.txt"
;--------------------------------
;Reserve Files
;Things that need to be extracted on first (keep these lines before any File command!)
;Only useful for BZIP2 compression
!insertmacro MUI_RESERVEFILE_WELCOMEFINISHPAGE
;--------------------------------
;Installer Sections
Section "modern.exe" SecCopyUI
Section "Dummy Test File" SecCopyUI
;Add your stuff here
;ADD YOUR OWN STUFF HERE!
SetOutPath "$INSTDIR"
File "${NSISDIR}\Contrib\UIs\modern.exe"
;Store install folder
WriteRegStr HKCU "Software\${MUI_PRODUCT}" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
@ -78,16 +75,18 @@ SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecCopyUI ${LANG_ENGLISH} "Copy modern.exe to the application folder."
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI)
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;Add your stuff here
;ADD YOUR OWN STUFF HERE!
Delete "$INSTDIR\modern.exe"
Delete "$INSTDIR\Uninstall.exe"
@ -96,4 +95,4 @@ Section "Uninstall"
DeleteRegKey /ifempty HKCU "Software\${MUI_PRODUCT}"
SectionEnd
SectionEnd