Introduction

Using NSIS 2, it is possible to create new user interfaces for the Nullsoft Installer System.

I made this interface with a modern wizard style, like the wizards of recent Windows versions. This new interface also features new icons (designed by adni18) and a description area on the component select dialog.

To use this new interface for for installer, you need to add some code to your NSIS script. Read this document for more info!

Requirements

NSIS 2 beta 0 (or later)

Screenshot

How to use

The Modern UI has a macro system, so most of the code is already written for you!

Basic Macro System
For most scripts, you can use the basic macro system. The basic macro system inserts all code and functions for you. For an example, have a look at Basic.nsi.

To remove certain default NSIS pages (such as the License page), remove a define before the language files (for example, remove !define MUI_LICENSEPAGE), and remove the other instruction for the page (for example, LicenseData).

Advanced Macro System, Install Options
If you want put your code in certain NSIS functions or want to use custom installer pages, use the Advanced Macro System. The code will still be inserted using the macro's, but you can customize a lot of things, add your own code or add new pages.
Using the Install Options macro's, it's also very easy to use custom pages in your installer.
Have a look at InstallOptions.nsi for an example of the Install Options and the Advanced Macro System.

Multilanguage installers
The Modern UI has full multilanguage support and also uses language files which can be translated easily. You can find the language files in the Contrib\Modern UI\Language files folder. There are already a lot of translations available, but you can also make your own translation.
See MultiLanguage.nsi for a multilanguage example using the Basic Macro System.

The interface

Modern.exe and modern2.exe
There are two different version of the interface. Modern.exe contains the dialogs of the standard interface. If you have an installer with a lot of subsections or long section names, use modern2.exe, which has a different component-selection page.

Change interface settings
You can change the settings of the interface by usings defines before you insert the MUI_INTERFACE macro.
Example: !define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe"
If you don't define a setting, the default will be used.

The following settings are available: (default)
MUI_ICON (${NSISDIR}\Contrib\Icons\modern-install.ico) - The icon of the instaleller
MUI_UNICON (${NSISDIR}\Contrib\Icons\modern-uninstall.ico) - The icon of the uninstaleller
MUI_CHECKBITMAP (${NSISDIR}\Contrib\Icons\modern.bmp) - The bitmap with images for the checks of the component select treeview.
MUI_UI (${NSISDIR}\Contrib\UIs\modern.exe) - The interface file with the dialog resources
MUI_FONT (Tahoma) - The font of the installer and uninstaller
MUI_INSTALLCOLORS (/windows) - The hexadecimal colors of the details screen ("foreground" "background")
MUI_PROGRESSBAR (smooth) - The style of the progress bar ("colored" to use the MUI_INSTALLCOLORS or "" for a old-school windows look)

Customize the dialogs
To change elements on the dialogs, modify modern.exe or modern2.exe in the Contrib\UIs folder using a a resource editor such as Resource Hacker.

The 'Loading Setup' text on the splash screen which is being displayed when the installer is starting (Verifying installer, Unpacking data when using COMPRESS_WHOLE) 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(2).exe.
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.

Version history

  • 1.3 - October 26, 2002
    • Easier macro system for basic scripts
    • New MultiLanguage system using Modern UI Language Files
    • New directory structure (header/language files in Contrib\Modern UI)
    • Small bugfixes & typo corrections
    • SetPage function should be set using defines
    • Different NextPage/PrevPage/FinishHeader macro's for install/uninstall
    • Interface settings can be definend (for example, MUI_ICON), no parameters for MUI_INTERFACE anymore
  • 1.21 - September 30, 2002
    • Temp vars set in Modern UI header
    • Currentpage & Install Options vars should be set using parameters of the MUI_INTERFACE and MUI_INSTALLOPTIONS macro's
    • MultiLanguage.nsi uses the new language strings
  • 1.20 - September 22, 2002
    • Lots of macro system updates & fixes
    • InstallOptions support in macro system
    • Added Modern UI + InstallOptions example (InstallOptions.nsi)
    • MUI_NEXTPAGE_OUTER integrated in MUI_NEXTPAGE
    • No hard-coded function names anymore (you should give MUI_PREVPAGE a parameter with the set page function name (for example, MUI_PREVPAGE SetPage)
    • Examples use ReserveFile for faster startup
  • 1.19 - Semtember 19, 2002
    • Renamed some macro's
    • Custom code can be used between page start/stop macro's
  • 1.18 - Semtember 13, 2002
    • Uses the new Sendmessage string option
  • 1.17 - Semtember 10, 2002
    • Win9x font weight bug fixed (font of title in white rect)
  • 1.16 - Semtember 6, 2002
    • Change text 'Scroll down' on license page to 'Press Page Down', because the RichEdit control has focus by default now
  • 1.15 - Semtember 4, 2002
    • Multilanguage example: changed LangDialog to LangDLL::LangDialog (using the DLL name is now required)
  • 1.14 - Semtember 3, 2002
    • Small grammar fix (thanks eccles)
    • UI files updated by Justin for better RichEdit usage
  • 1.13 - Semtember 2, 2002
    • Added 16 color icons
  • 1.12 - August 30, 2002
    • Verifying installer & Unpacking data dialog has no titlebar anymore
  • 1.11 - August 29, 2002
    • Finish header for uninstaller can also be set using MUI_FINISHHEADER
  • 1.1 - August 29, 2002
    • Header file with macros, it's now very easy to use the UI in your scripts :)
    • Added the modern2.exe UI, with an other location of the Description frame, for installers with a lot of subsections (thanks rainwater)
    • Updated example scripts
    • Added Multilanguage.nsi example (Multilanguage & LangDLL)
    • Fixed background color issue with some custom XP themes
    • Removed WS_VISIBLE from black rect for inner dialog (fixes display issues)
    • Changed size of description area
    • Example script: Added instructions for the user on the Description frame
    • Auto sizing branding text
    • Used modern.bmp for the checks (thanks rainwater)
    • Using the new NSIS version, descriptions work using the keyboard and you can give descriptions to subsections
    • Correct font size using High-DPI fonts
  • 1.0 - August 26, 2002
    • Initial release

Credits

Made by Joost Verburg.
Icons designed by Nikos Adamamas, aka adni18.
Thanks to Amir Szekely, aka KiCHiK for his work on NSIS to make this possible.

Help

Please post questions at the NSIS Forum.

License

Copyright © 2002 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.