Plugin Tester (or Wrapper): Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Wikipedia python library)
 
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{PageAuthor|PerditionC}}
== Links ==
== Links ==
http://www.darklogic.org/win32/nsis/plugins/plgnTester.0.0.zip  (~4KB)
 
Please send bug reports, suggestions, etc. to jeremyd --at--
=== VC6 ===
fdos.org
<attach>PlgnTester.zip</attach><br>
 
=== VC10 ===
http://dl.dropbox.com/u/74708275/plgnTester.rar


== Description ==
== Description ==
plgntester - NSIS Plugin Tester v0.00
plgntester - NSIS Plugin Tester v0.01


This is a command line program that can be used to
This is a command line program that can be used to
invoke a NSIS plugin. It supports passing any string
invoke a NSIS plugin. It supports passing any string
variable on the stack, setting any of the standard
variable on the stack, setting any of the standard
variables (user defined variables are unsupported),
variables (user defined variables are unsupported),
Line 14: Line 19:


== Usage ==
== Usage ==
testwrap.exe plugin function {/VAR # str} [args]
plgnTester.exe [options] plugin function {/VAR # str} [args]


plugin is the name of the plugin (or dll) to load, passed
Currently the only options available determine the output.
/silent limits output to that displayed by the plugin
/nogui prevents the mock NSIS installation listview dialog
/debug displays the contents of the stack and registers
before and after the plugin function is invoked.
 
Plugin is the name of the plugin (or dll) to load, passed
asis to LoadLibrary, so one can omit the .dll and normal
asis to LoadLibrary, so one can omit the .dll and normal
path search should be done, but if in the NSIS plugin
path search should be done, but if in the NSIS plugin
Line 22: Line 33:
An error message is returned if failed to load.
An error message is returned if failed to load.


function is the name of the exported function to invoke.
Function is the name of the exported function to invoke.
It should be exactly as exported, which should match  
It should be exactly as exported, which should match  
the name used in a NSIS script.  An error message is
the name used in a NSIS script.  An error message is
Line 30: Line 41:
Any number (as permitted by the command line) of /VAR # str
Any number (as permitted by the command line) of /VAR # str
sequences can be included (and in any location on cmd line).
sequences can be included (and in any location on cmd line).
/VAR marks the start of setting a variable.
/VAR marks the start of setting a variable. <nowiki>#</nowiki> is 0-24,<br>
# is 0-24, where 0-9 correspond to NSIS variables $0-$9,
where 0-9 correspond to NSIS variables $0-$9,<br>
and 10-19 correspond to NSIS variables $R0-$R9.
and 10-19 correspond to NSIS variables $R0-$R9.<br>
20-24 are $CMDLINE, $INSTDIR, $OUTDIR, $EXEDIR, $LANGUAGE
20-24 are $CMDLINE, $INSTDIR, $OUTDIR, $EXEDIR, $LANGUAGE


The remaining arguments (if any) are the strings pushed onto
The remaining arguments (if any) are the strings pushed onto
the stack and passed to the plugin.  Strings are pushed on
the stack and passed to the plugin.  Strings are pushed on  
 
the stack in opposite order from command line.  That is,  
the stack in opposite order from command line.  That is,  
pass arguments on the command line in same order as if you
pass arguments on the command line in same order as if you
Line 43: Line 53:
which should match order plugin pops them).
which should match order plugin pops them).


This is primary meant as a debugging tool, so should be
This is primarily meant as a debugging tool, so should be
modified if necessary to the plugin being tested, but
modified if necessary to the plugin being tested, but
should work asis for many. When using a debugger, one
should work as it is for some. When using a debugger, one
should compile it with debugging information and the
should compile it with debugging information and the
plugin with debug information, then one can step through
plugin with debug information, then one can step through
them both and/or set break points. Only the input stack
them both and/or set break points. Only the input stack
and variables and then output stack and variables are
and variables and then output stack and variables are
shown.  Present version passes NULL for the HWND as no
shown.  When /nogui option is specified, NULL is passed
window is created, though if requested, a future version may
for the HWND as no window is created.
add the neccessary window. Future versions may also
 
add a /QUIET or /VERBOSE option allowing this to more
== Contact ==
easily be used as a wrapper.
 
Please send bug reports, suggestions, etc. to jeremyd --at--
fdos.org.


Page author: PerditionC
[[Category:Related Software]]

Latest revision as of 07:46, 1 June 2012

Author: PerditionC (talk, contrib)


Links

VC6

PlgnTester.zip (30 KB)

VC10

http://dl.dropbox.com/u/74708275/plgnTester.rar

Description

plgntester - NSIS Plugin Tester v0.01

This is a command line program that can be used to invoke a NSIS plugin. It supports passing any string variable on the stack, setting any of the standard variables (user defined variables are unsupported), and can invoke any specified function in given plugin.

Usage

plgnTester.exe [options] plugin function {/VAR # str} [args]

Currently the only options available determine the output. /silent limits output to that displayed by the plugin /nogui prevents the mock NSIS installation listview dialog /debug displays the contents of the stack and registers before and after the plugin function is invoked.

Plugin is the name of the plugin (or dll) to load, passed asis to LoadLibrary, so one can omit the .dll and normal path search should be done, but if in the NSIS plugin directory, you will need to explicitly provide its path. An error message is returned if failed to load.

Function is the name of the exported function to invoke. It should be exactly as exported, which should match the name used in a NSIS script. An error message is returned if function is not found or other error obtaining its procedure address.

Any number (as permitted by the command line) of /VAR # str sequences can be included (and in any location on cmd line). /VAR marks the start of setting a variable. # is 0-24,
where 0-9 correspond to NSIS variables $0-$9,
and 10-19 correspond to NSIS variables $R0-$R9.
20-24 are $CMDLINE, $INSTDIR, $OUTDIR, $EXEDIR, $LANGUAGE

The remaining arguments (if any) are the strings pushed onto the stack and passed to the plugin. Strings are pushed on the stack in opposite order from command line. That is, pass arguments on the command line in same order as if you were invoking the plugin from a NSIS script (calling order, which should match order plugin pops them).

This is primarily meant as a debugging tool, so should be modified if necessary to the plugin being tested, but should work as it is for some. When using a debugger, one should compile it with debugging information and the plugin with debug information, then one can step through them both and/or set break points. Only the input stack and variables and then output stack and variables are shown. When /nogui option is specified, NULL is passed for the HWND as no window is created.

Contact

Please send bug reports, suggestions, etc. to jeremyd --at-- fdos.org.