NxSMSILoaderDlg plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.)
(→‎Overview: Grammar & Removed necessary idiom.)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{|align=right
{{PageAuthor|saivert}}
|<small>Author: [[{{ns:2}}:saivert|saivert]] ([[{{ns:3}}:saivert|talk]], [[{{ns:-1}}:Contributions/saivert|contrib]])</small>
 
|}
<br style="clear:both;">
== Download ==
== Download ==
http://inthegray.com/saivert/nsisdev/
Updated August 14th 2007: File moved to new server.
 
[http://saivert.com/nsis/NxS%20MSI%20LoaderDlg.7z NxS MSI LoaderDlg.7z] (60,6 KB)


== Overview ==
== Overview ==
This plugin is my version of the Banner plugin. I decided to write it after
This plugin is my version of the Banner plugin. I decided to write it after
I saw the horrible MSIBanner plugin which was supposed to look like the
I saw the horrible MSIBanner plugin which was supposed to look like the
dialog displayed when Windows Installer packages are opened (.MSI extension).
dialog displayed when Windows Installer packages are opened (.MSI extension),
Ofcourse it didn't. That's why this plugin was born.
of course it didn't. That's why this plugin was born.
 
Hmm... that's enough crap. Here's the details:


== Usage ==
== Usage ==
 
The following fragment of script code uses all of the options/parameters that NxS MSI LoaderDlg supports.
: The following fragment of script code uses all of the options/parameters that
: NxS MSI LoaderDlg supports.
<highlight-nsis>
<highlight-nsis>
    NxSMSILoaderDlg::show /NOUNLOAD "Title of dialog" \
NxSMSILoaderDlg::show /NOUNLOAD "Title of dialog" \
      /top "Top text" \
  /top "Top text" \
      /sub "Sub text (more info)" \
  /sub "Sub text (more info)" \
      /h 1 \
  /h 1 \
      /pos 43 \
  /pos 43 \
      /max 100 \
  /max 100 \
  /can
  /can
</highlight-nsis>
</highlight-nsis>
: TIP: Copy & paste into your script and modify the parameters.
TIP: Copy & paste into your script and modify the parameters.


: The parameters explained:
The parameters explained:
:: /top     This sets the top text (to the right of the icon).
; /top
:: /sub    Sets the subtext (above the progress bar control)
: This sets the top text (to the right of the icon).
:: /h      Shows/hides dialog from taskbar.
:::: Requires a number: 1 means hide. 0 means show.
:: /pos    Sets the progress bar position.
::/max    Sets the number of steps the progress bar control
:::: has. Default value is 100.
:: /can    Enables/disables Cancel button on dialog.
:::: Requires a number: 1 = enable, 0 = disable.
:::: Default is disabled.


: NOTES:
; /sub
:: Values for the /pos parameter range from 0 (zero) to 100 or the value
: Sets the subtext (above the progress bar control).
:: specified for the /max parameter.


:::: Any other text passed on the stack (not one of the parameters) are used as
; /h
:::: the title of the dialog. If you pass multiple strings not recognized as a
: Shows/hides dialog from taskbar. Requires a number: 1 means hide. 0 means show.
:::: parameter the last one of these strings are used for the title. The rest
:::: is ignored.


: To update the dialog use e.g:
; /pos
: Sets the progress bar position.
 
; /max
: Sets the number of steps the progress bar control has. Default value is 100.
 
; /can
: Enables/disables Cancel button on dialog. Requires a number: 1 = enable, 0 = disable. Default is disabled.
 
== Notes ==
Values for the /pos parameter range from 0 (zero) to 100 or the value specified for the /max parameter.
 
Any other text passed on the stack (not one of the parameters) are used as the title of the dialog. If you pass multiple strings not recognized as a parameter the last one of these strings are used for the title. The rest is ignored.
 
To update the dialog use e.g:
<highlight-nsis>
<highlight-nsis>
    NxSMSILoaderDlg::update /NOUNLOAD /top "Checking something..." /sub "78% complete" /pos 78
NxSMSILoaderDlg::update /NOUNLOAD /top "Checking something..." /sub "78% complete" /pos 78
</highlight-nsis>
</highlight-nsis>


: To get handle of the dialog (HWND) use:
To get handle of the dialog (HWND) use:
<highlight-nsis>
<highlight-nsis>
    NxSMSILoaderDlg::getWindow /NOUNLOAD
NxSMSILoaderDlg::getWindow /NOUNLOAD
Pop $0 ; $0 now contains the handle to the dialog
Pop $0 ; $0 now contains the handle to the dialog
</highlight-nsis>
</highlight-nsis>
: TIP: You don't need to use getWindow in order to modify the text. Just use the
: NxSMSILoaderDlg::Update function using the same syntax as NxSMSILoaderDlg::show.


: To check if the Cancel button has been pressed use:
'''TIP:''' You don't need to use getWindow in order to modify the text. Just use the NxSMSILoaderDlg::Update function using the same syntax as NxSMSILoaderDlg::show.
 
To check if the Cancel button has been pressed use:
<highlight-nsis>
<highlight-nsis>
    NxSMSILoaderDlg::HasUserAborted /NOUNLOAD
NxSMSILoaderDlg::HasUserAborted /NOUNLOAD
Pop $R0 ; $R0 now contains "1" if user clicked Cancel or "0" (zero) otherwise.
Pop $R0 ; $R0 now contains "1" if user clicked Cancel or "0" (zero) otherwise.
</highlight-nsis>
</highlight-nsis>


: To destroy the dialog and free resources use:
To destroy the dialog and free resources use:
<highlight-nsis>
<highlight-nsis>
    NxSMSILoaderDlg::destroy
NxSMSILoaderDlg::destroy
</highlight-nsis>
</highlight-nsis>


: See Example.nsi for an example.
See Example.nsi for an example.


== Modern UI ==
== Modern UI ==
Line 81: Line 80:


== Custom UI ==
== Custom UI ==
This plugin can not be modified except if you recompile it. The source code is should be included.
This plugin can not be modified except if you recompile it. The source code should be included.


== Some More Tricks ==
== Some More Tricks ==
Line 89: Line 88:
Based on Banner (written by [[user:brainsucker|brainsucker]] and [[user:kichik|kichik]]) and
Based on Banner (written by [[user:brainsucker|brainsucker]] and [[user:kichik|kichik]]) and
MSIBanner (written by [[User:Joel|Joel]]) plugin projects.
MSIBanner (written by [[User:Joel|Joel]]) plugin projects.
[[Category:Plugins]]

Latest revision as of 16:52, 20 May 2009

Author: saivert (talk, contrib)


Download

Updated August 14th 2007: File moved to new server.

NxS MSI LoaderDlg.7z (60,6 KB)

Overview

This plugin is my version of the Banner plugin. I decided to write it after I saw the horrible MSIBanner plugin which was supposed to look like the dialog displayed when Windows Installer packages are opened (.MSI extension), of course it didn't. That's why this plugin was born.

Usage

The following fragment of script code uses all of the options/parameters that NxS MSI LoaderDlg supports.

NxSMSILoaderDlg::show /NOUNLOAD "Title of dialog" \
  /top "Top text" \
  /sub "Sub text (more info)" \
  /h 1 \
  /pos 43 \
  /max 100 \
  /can

TIP: Copy & paste into your script and modify the parameters.

The parameters explained:

/top
This sets the top text (to the right of the icon).
/sub
Sets the subtext (above the progress bar control).
/h
Shows/hides dialog from taskbar. Requires a number: 1 means hide. 0 means show.
/pos
Sets the progress bar position.
/max
Sets the number of steps the progress bar control has. Default value is 100.
/can
Enables/disables Cancel button on dialog. Requires a number: 1 = enable, 0 = disable. Default is disabled.

Notes

Values for the /pos parameter range from 0 (zero) to 100 or the value specified for the /max parameter.

Any other text passed on the stack (not one of the parameters) are used as the title of the dialog. If you pass multiple strings not recognized as a parameter the last one of these strings are used for the title. The rest is ignored.

To update the dialog use e.g:

NxSMSILoaderDlg::update /NOUNLOAD /top "Checking something..." /sub "78% complete" /pos 78

To get handle of the dialog (HWND) use:

NxSMSILoaderDlg::getWindow /NOUNLOAD
Pop $0 ; $0 now contains the handle to the dialog

TIP: You don't need to use getWindow in order to modify the text. Just use the NxSMSILoaderDlg::Update function using the same syntax as NxSMSILoaderDlg::show.

To check if the Cancel button has been pressed use:

NxSMSILoaderDlg::HasUserAborted /NOUNLOAD
Pop $R0 ; $R0 now contains "1" if user clicked Cancel or "0" (zero) otherwise.

To destroy the dialog and free resources use:

NxSMSILoaderDlg::destroy

See Example.nsi for an example.

Modern UI

This plugin doesn't behave differently when the installes uses the Modern UI add-on by Joost Verburg.

Custom UI

This plugin can not be modified except if you recompile it. The source code should be included.

Some More Tricks

This plugin does not have any "tricks" like the Banner plugin has.

Credits

Based on Banner (written by brainsucker and kichik) and MSIBanner (written by Joel) plugin projects.