From 73a6a800569d53dda54809cf4b805641ff909966 Mon Sep 17 00:00:00 2001 From: joostverburg Date: Sun, 3 Nov 2002 16:30:59 +0000 Subject: [PATCH] update git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1574 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Modern UI/Readme.html | 296 +++++++++++++++----------- Examples/Modern UI/Basic.nsi | 1 - Examples/Modern UI/InstallOptions.nsi | 3 +- 3 files changed, 172 insertions(+), 128 deletions(-) diff --git a/Contrib/Modern UI/Readme.html b/Contrib/Modern UI/Readme.html index af4ae366..f98fcd59 100644 --- a/Contrib/Modern UI/Readme.html +++ b/Contrib/Modern UI/Readme.html @@ -98,134 +98,178 @@ a:hover - + - - + + diff --git a/Examples/Modern UI/Basic.nsi b/Examples/Modern UI/Basic.nsi index 5e59f88b..9569f5b5 100644 --- a/Examples/Modern UI/Basic.nsi +++ b/Examples/Modern UI/Basic.nsi @@ -65,7 +65,6 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SecCopyUI} $(DESC_SecCopyUI) !insertmacro MUI_FUNCTIONS_DESCRIPTION_END - ;-------------------------------- ;Uninstaller Section diff --git a/Examples/Modern UI/InstallOptions.nsi b/Examples/Modern UI/InstallOptions.nsi index d65ecbc9..6ea7028e 100644 --- a/Examples/Modern UI/InstallOptions.nsi +++ b/Examples/Modern UI/InstallOptions.nsi @@ -30,7 +30,8 @@ Name "${NAME} ${VERSION}" ;Page order - !define MUI_CUSTOMPAGECOMMANDS + !define MUI_CUSTOMPAGECOMMANDS ;Use customized pages + !insertmacro MUI_PAGECOMMAND_LICENSE Page custom SetCustomA Page custom SetCustomB
-

Introduction

-

NSIS 2 makes it is possible to create installers - with a custom user interface.

-

I made this interface with a modern wizard style, - like the wizards of recent Windows versions. This new interface - also features new graphics and a description area on the - component-selection page.

-

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 - has already been 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 at the top of the page (for example, remove - !define MUI_LICENSEPAGE), and remove the other instructions for - the page (for example, LicenseData).

-

Advanced Macro System, Install Options
- If you want put your own 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. Just add a new Page command - between the other page commands: Page [function name] and call - Install Options in [function name] using the - MUI_INSTALLOPTIONS_SHOW macro.

- 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 directory. - 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 versions 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 directory using 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.4 - October 30, 2002 -
      -
    • Uses new NSIS Page command -
    • Macro system way smaller -
    • Advanced Macro System a lot easier -
    • Renamed some defines -
    -
-

Complete version history

-

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.

-
+

Introduction

+

NSIS 2 makes it is possible to create installers +with a custom user interface.

+

I made this interface with a modern wizard style, + like the wizards of recent Windows versions. This new interface + also features new graphics and a description area on the + component-selection page.

+

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 + has already been written for you!

+ The easiest way to use the Modern UI is to customize one of the example + scripts, but you can also modify an existing script.

+ There are 7 things you need to insert in an existing script to use the + Modern UI (in order).

+

1. Insert the header files

+

!include "${NSISDIR}\Contrib\Modern UI\System.nsh"

+

2. Define the name and version of your software

+

!define NAME "Test Software" ;Define your own software name here
+!define VERSION "1.0" ;Define your own software version here

+

3. Define which elements you are using

+ The Modern UI should know which things it should insert. Use the following defines:

+

!define MUI_LICENSEPAGE ;License page
+!define MUI_COMPONENTSPAGE ;Component-selection page
+!define MUI_DIRECTORYPAGE ;Directory-selection page
+!define MUI_LICENSEPAGE ;License page
+!define MUI_UNINSTALL ;Uninstaller
+!define MUI_ABORTWARNING ;Abort warning messabox

+

4. Insert language files

+ Insert the Modern UI language files for the languages you are using:
+

!include "${NSISDIR}\Contrib\Modern UI\Language files\English.nsh"

+

5. Interface settings (optional)

+ You can change the settings of the interface by usings defines:
+

!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)

+

6. Insert the MUI_SYSTEM macro

+

!insertmacro MUI_SYSTEM

+

7. Set the descriptions for the sections

+

+LangString DESC_SectionName1 ${LANG_ENGLISH} "Description of section 1."
+LangString DESC_SectionName2 ${LANG_ENGLISH} "Description of section 2."
+
+!insertmacro MUI_FUNCTIONS_DESCRIPTION_START
+  !insertmacro MUI_DESCRIPTION_TEXT ${SectionName1} $(DESC_SectionName1)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SectionName2} $(DESC_SectionName2)
+!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
+

+

Note: Always set a name for a section:

+

+Section "Section Name 1" SectionName1
+ ...
+SectionEnd
+
+Section "Section Name 2" SectionName2
+ ...
+SectionEnd
+

+

Custom pages

+ If you want add custom pages to your installer using Install Options, + you can customize the page commands:

+

+!define MUI_CUSTOMPAGECOMMANDS ;Use customized pages
+
+!insertmacro MUI_PAGECOMMAND_LICENSE
+Page custom [function name]
+Page custom [function name]
+!insertmacro MUI_PAGECOMMAND_COMPONENTS
+!insertmacro MUI_PAGECOMMAND_DIRECTORY
+Page custom [function name]
+!insertmacro MUI_PAGECOMMAND_INSTFILES
+
+

You can call Install Options in [function name]:

+
+LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Install Options Page"
+LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Create your own dialog!"
+
+Function [function name]
+  !insertmacro MUI_HEADER_TEXT $(TEXT_IO_TITLE) $(TEXT_IO_SUBTITLE)
+  !insertmacro MUI_INSTALLOPTIONS_SHOW "iniFile.ini"
+FunctionEnd
+
+

Examples

+ Basic: Basic.nsi
+ Multilanguage: MultiLanguage.nsi
+ Cutom pages: + InstallOptions.nsi
+

The interface

+

Modern.exe and modern2.exe

+ There are two different versions 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.

+

Customize the dialogs

+To change elements on the dialogs, modify modern.exe or modern2.exe in the + Contrib\UIs directory using 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.4 - November 3, 2002 +
      +
    • Uses new NSIS Page command +
    • Macro system way smaller +
    • Advanced Macro System a lot easier +
    • Renamed some defines +
    +
+

Complete version history

+

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