Introduction

Dialogs Plugin

Current version: 2.3

This plugin will call the Open, Save, Folder, InputBox and a PasswordBox dialogs.
This plugin is for NSIS versions 2.0 or other versions that support the plugin feature.

Instructions:

  • Get your copy of the new NSIS here.
  • Copy the plugin, Dialogs.dll, into your NSIS' plugin directory.

    • Usefull links:

  • NSIS site.
  • NSIS forum.
  • NSIS Web Archive.

    • Contents:

  • About.
  • Functions & Syntax.
  • Author.
  • TODO.
  • Versions.


Functions & Syntax

 The inputed values dependes of each function (see each example).
The outputed value has a new syntax:

${VAR_0} == $0
${VAR_1} == $1
${VAR_2} == $2
${VAR_3} == $3
${VAR_4} == $4
${VAR_5} == $5
${VAR_6} == $6
${VAR_7} == $7
${VAR_8} == $8
${VAR_9} == $9
${VAR_R0} == $R0
${VAR_R1} == $R1
${VAR_R2} == $R2
${VAR_R3} == $R3
${VAR_R4} == $R4
${VAR_R5} == $R5
${VAR_R6} == $R6
${VAR_R7} == $R7
${VAR_R8} == $R8
${VAR_R9} == $R9
${VAR_CMDLINE} == $CMDLINE
${VAR_INSTDIR} == $INSTDIR
${VAR_OUTDIR} == $OUTDIR
${VAR_EXEDIR} == $EXEDIR
${VAR_LANGUAGE} == $LANGUAGE

See the "defines.nsh".
The main functions of the plugin are:

  • Open
  • Folder
  • Save
  • InputBox
  • InputRegCode


Open

Function to call the Open file dialog. Syntax:

Dialogs::Open [custom_filter] [custom_index_filter] [custom_dialog_title] [intial_folder] [output_var]

custom_filter: The filter of the dialog, for example: "All files(*.*)|*.*|sound file (*.wav)|*.wav|". To use this add the char. "|" as separator between filter name and filter patern; always close it with "|" (see Open.nsi & Save.nsi).
custom_index_filter: If you use multiple paters, use this as the default filter when the dialog appears.
custom_dialog_title: Change the default title of the dialog.
intial_folder: Where to start listing the files in the dialog.
output_var: See output syntax.

See the example "Open.nsi".


Folder

Function to call the Folder Browse dialog. Syntax:

Dialogs::Folder [custom_title] [custom_string] [custom_folder] [output_var]

custom_title: A custom title for the dialog title.
custom_string: Customize the inner string.
custom_folder: The custom start-up directory.
output_var: See output syntax.

See the example "Folder.nsi".


Save

Function to call the Save file dialog. Syntax:

Dialogs::Save [custom_filter] [custom_index_filter] [custom_dialog_title] [intial_folder] [output_var]

custom_filter: The filter of the dialog, for example: "All files(*.*)|*.*|sound file (*.wav)|*.wav|". To use this add the char. "|" as separator between filter name and filter patern; always close it with "|" (see Open.nsi & Save.nsi).
custom_index_filter: If you use multiple paters, use this as the default filter when the dialog appears.
custom_dialog_title: Change the default title of the dialog.
intial_folder: Where to start listing the files in the dialog.
output_var: See output syntax.

See the example "Save.nsi".


InputBox

Function to prompt a dialog asking a info. for the user. Syntax:

Dialogs::InputBox [dialog_title] [caption_inner_text] [caption_button1] [caption_button2] [apply_password] [output_var]
dialog_title: Caption for the dialog's title.
caption_inner_text: A inner text for the dialog.
caption_button1: Caption for the first button.
caption_button2: Caption for the second button.
apply_password: Use "1" if you want to add a password field, otherwise use "0".
output_var: See output syntax.

See the example "InputBox.nsi".
See the example "InputPass.nsi".


InputRegCode

Function to prompt a dialog asking a serial key upon the username inputed (Use the SerialMaker, included). Syntax:

Dialogs::InputRegCode [dialog_title] [caption_inner_text] [caption_user] [caption_serial] [key] [caption_button1] [caption_button2] [output_var]
dialog_title: Caption for the dialog's title.
caption_inner_text: A inner text for the dialog.
caption_user: The caption asking the username.
caption_serial: The caption asking the serial.
key: A key to use with the SerialMaker.
caption_button1: Caption for the first button.
caption_button2: Caption for the second button.
output_var: See output syntax.

See the example "InputRegCode.nsi".


Other

 Other functions, might help in some way ;)

  • "Author". Well.... me :P
  • "Ver". Function to obtain the current version of the plugin.

    See the example "Other.nsi".


Author

 This plugin was created by Lobo Lunar (Joel Almeida García).
Email: lobolunarnet@yahoo.com.mx


TODO

 1. Customize the filter. I want to customize it to use multiple filters and not just one. [done]
2. Users ideas :D
3. Add the Save dialog. [done]
4. Add a custom start-up directory in the Folder Dialog. [done]


Versions

 1.0:
  • Release.

    1.1:

  • Added the "Save" Dialog.

    1.2:

  • Change syntax.
  • Added the custom Index filter.
  • Added the multiple filter for both Open and Save Dialogs.
  • Added "Create Folder" button on Folder Dialog.
  • Removed the current selection folder label in Folder Browse (maybe I'll put it back).

    1.3:

  • Added the InputBox with password style dialog.

    2.0:

  • New help file system.
  • Added a new syntax in the output var (must see examples and the defines.nsh).
  • Added the custom title and a custom start-up directory in the Folder dialog.

    2.1:

  • New function: InputRegCode.
  • Rename NsisPass to InputPass.
  • All the dialogs don't appear in the taskbar.
  • Change syntax, check all the examples for the updated ones.

    2.2:

  • All syntax have been updated. Removed $HWNDPARENT. See examples.

    2.3:

  • Update the function InputRegCode with different serial algorithm.


About

 This plugin was build with Visual C++ 6.0, you'll need Windows 95/98/NT/2000/Me/XP.
If you found errors (bugs) report them, please!!!! :)