new, hopefully more informative, System plug-in documentation
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3556 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
879a8245bc
commit
74051c80de
5 changed files with 779 additions and 194 deletions
761
Contrib/System/System.html
Normal file
761
Contrib/System/System.html
Normal file
|
@ -0,0 +1,761 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>NSIS System Plug-in</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>NSIS System Plug-in</h1>
|
||||
<p><i>© brainsucker (Nik Medved), 2002</i></p>
|
||||
|
||||
<h2>Table of Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#intro">Introduction</a></li>
|
||||
<li>
|
||||
<a href="#funcs">Available Functions</a>
|
||||
<ul>
|
||||
<li><a href="#memfuncs">Memory Related Functions</a></li>
|
||||
<li><a href="#callfuncs">Calling Functions</a></li>
|
||||
<li><a href="#64bitfuncs">64-bit Functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#faq">FAQ</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="intro"></a>Introduction</h2>
|
||||
|
||||
<p>The System plug-in gives developers the ability to call any exported function from any DLL. For example, you can use it to call <a href="http://msdn.microsoft.com/library/en-us/fileio/base/getlogicaldrivestrings.asp">GetLogicalDriveStrings</a> to get a list of available drives on the user's computer.</p>
|
||||
|
||||
<p>The System plug-in also allows the developer to allocate, free and copy memory; interact with COM objects and perform mathematical operations on 64-bit integers.</p>
|
||||
|
||||
<p>Programming knowledge is highly recommended in order to understand the System plug-in.</p>
|
||||
|
||||
<h4>Usage Examples From The Archive</h4>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://nsis.sourceforge.net/archive/viewpage.php?pageid=257">Get local time</a></li>
|
||||
<li><a href="http://nsis.sourceforge.net/archive/viewpage.php?pageid=439">Register conduits with Palm HotSync</a></li>
|
||||
<li><a href="http://nsis.sourceforge.net/archive/viewpage.php?pageid=122">Get free memory</a></li>
|
||||
<li><a href="http://nsis.sourceforge.net/archive/viewpage.php?pageid=190">Read REG_MULTI_SZ</a></li>
|
||||
<li><a href="http://nsis.sourceforge.net/archive/viewpage.php?pageid=464">Get disk serial number</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="funcs"></a>Available Functions</h2>
|
||||
|
||||
<h3><a name="memfuncs"></a>Memory Related Functions</h3>
|
||||
|
||||
<div>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<b>Alloc</b> <i>SIZE</i>
|
||||
<blockquote>
|
||||
<p>Allocates <i>SIZE</i> bytes and returns a memory address on the stack.</p>
|
||||
<h4>Usage Example</h4>
|
||||
<blockquote><pre>
|
||||
System::<b>Alloc</b> 64
|
||||
Pop $0
|
||||
DetailPrint "64 bytes allocated at $0"
|
||||
System::Free $0
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<b>Copy</b> [/<i>SIZE</i>] <i>DESTINATION</i> <i>SOURCE</i>
|
||||
<blockquote>
|
||||
<p>Copies <i>SIZE</i> bytes from <i>SOURCE</i> to <i>DESTINATION</i>. If <i>SIZE</i> is not specified, <i>SOURCE</i>'s size will queried using GlobalSize. This means that if you don't allocate <i>SOURCE</i> using System::Alloc, System::Call or GlobalAlloc, you must specify <i>SIZE</i>. If <i>DESTINATION</i> is zero it will be allocated and its address will be pushed on the stack.</p>
|
||||
<h4>Usage example</h4>
|
||||
<blockquote><pre>
|
||||
# allocate a buffer and put 'test string' and an int in it
|
||||
System::Call "*(&t1024 'test string', i 5) i .s"
|
||||
Pop $0
|
||||
# copy to an automatically created buffer
|
||||
System::<b>Copy</b> 0 $0
|
||||
Pop $1
|
||||
# get string and int in $1 buffer
|
||||
System::Call "*$1(&t1024 .r2, i .r3)"
|
||||
# free buffer
|
||||
System::Free $1
|
||||
# print result
|
||||
DetailPrint $2
|
||||
DetailPrint $3
|
||||
# copy to our own buffer
|
||||
System::Alloc 1028
|
||||
Pop $1
|
||||
System::<b>Copy</b> $1 $0
|
||||
# get string and int in $1 buffer
|
||||
System::Call "*$1(&t1024 .r2, i .r3)"
|
||||
# free
|
||||
System::Free $0
|
||||
System::Free $1
|
||||
# print result
|
||||
DetailPrint $2
|
||||
DetailPrint $3
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<b>Free</b> <i>ADDRESS</i>
|
||||
<blockquote>
|
||||
<p>Frees <i>ADDRESS</i>.</p>
|
||||
<h4>Usage Example</h4>
|
||||
<blockquote><pre>
|
||||
System::Alloc 64
|
||||
Pop $0
|
||||
DetailPrint "64 bytes allocated at $0"
|
||||
System::<b>Free</b> $0
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<b>Store</b> "<i>OEPRATION</i> [<i>OEPRATION</i> [<i>OEPRATION</i> ...]]"
|
||||
<blockquote>
|
||||
<p>Performs stack operations. An operation can be pushing or popping a single register from the NSIS stack or pushing or popping all of the registers ($0-$9 and $R0-$R9) from System's private stack. Operations can be separated by any character.</p>
|
||||
<h4>Available Operations</h4>
|
||||
<ul>
|
||||
<li>To push $<i>#</i>, use p<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
|
||||
<li>To pop $<i>#</i>, use r<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
|
||||
<li>To push $R<i>#</i>, use P<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
|
||||
<li>To pop $R<i>#</i>, use R<i>#</i>, where <i>#</i> is a digit from 0 to 9.</li>
|
||||
<li>To push $0-$9 and $R0-$R9 to System's private stack, use s or S.</li>
|
||||
<li>To pop $0-$9 and $R0-$R9 from System's private stack, use l or L.</li>
|
||||
</ul>
|
||||
<p>Note that the System's private stack will be lost when the System plug-in is unloaded from NSIS. If you want to use it, you must keep the System plug-in loaded into NSIS. To do that, use SetPluginUnload or the /NOUNLOAD flag in the NSIS script.</p>
|
||||
<h4>Usage Examples</h4>
|
||||
<blockquote><pre>
|
||||
StrCpy $0 "test"
|
||||
System::<b>Store</b> "p0"
|
||||
Pop $1
|
||||
DetailPrint "$0 = $1"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
StrCpy $2 "test"
|
||||
System::<b>Store</b> "p2 R2"
|
||||
DetailPrint "$2 = $R2"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
StrCpy $3 "test"
|
||||
System::<b>Store</b> /NOUNLOAD "s"
|
||||
StrCpy $3 "another test"
|
||||
System::<b>Store</b> "l"
|
||||
DetailPrint $3
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Store</b> "r4" "test"
|
||||
DetailPrint $4
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<h3><a name="callfuncs"></a>Calling Functions</h3>
|
||||
|
||||
<div>
|
||||
|
||||
<ul>
|
||||
<li><b>Call</b> <i>PROC</i> [( <i>PARAMS</i> ) [<i>RETURN</i> [? <i>OPTIONS</i>]]]</li>
|
||||
<li><b>Get</b> <i>PROC</i> [( <i>PARAMS</i> ) [<i>RETURN</i> [? <i>OPTIONS</i>]]]
|
||||
<blockquote>
|
||||
<p>Call and get both share a common syntax. As the names suggest, Call calls and Get gets. What does it call or get? It depends on <i>PROC</i>'s value.</p>
|
||||
|
||||
<p><i>PARAMS</i> is a list of parameters and what do to with them. You can pass data in the parameters and you can also get data from them. The parameters list is separated by commas. Each parameter is combined of three values: <i>type</i>, <i>source</i> and <i>destination</i>. <i>Type</i> can be an integer, a string, etc. <i>Source</i>, which is the source of the parameter value, can be a NSIS register ($0, $1, $INSTDIR), the NSIS stack, a concrete value (5, "test", etc.) or nothing (null). <i>Destination</i>, which is the destination of the parameter value after the call returns, can can be a NSIS register, the NSIS stack or nothing which means no output is required. Either one of <i>source</i> or <i>destination</i> can also be a dot (`.') if it is not needed.</p>
|
||||
|
||||
<p><i>RETURN</i> is like a single parameter definition, but <i>source</i> is only used when creating callback functions. Normally <i>source</i> is a dot.</p>
|
||||
|
||||
<p><i>OPTIONS</i> is a list of options which control the way System plug-in behaves. Each option can be turned off by prefixing with an exclamation mark. For example: <b>?!e</b>.</p>
|
||||
|
||||
<p><i>PARAMS</i>, <i>RETURN</i> and <i>OPTIONS</i> can be repeated many times in one Get/Call line. When repeating, a lot can be omitted, and only what you wish to change can be used. <i>Type</i>, <i>source</i> and/or <i>destination</i> can be omitted for each parameter, even the return value. Options can be added or removed. This allows you to define function prototypes and save on some typing. The <a href="#repeat">last two examples</a> show this.</p>
|
||||
|
||||
<p><b>(can't get a working example)</b> <i>PROC</i> can also be repeated but must be prefixed with a hash sign (`#').</p>
|
||||
|
||||
<h4>Possible <i>PROC</i> values and Meanings</h4>
|
||||
|
||||
<blockquote>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Value</th>
|
||||
<th>Meaning</th>
|
||||
<th>Example</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i>DLL</i>::<i>FUNC</i></th>
|
||||
<td><i>FUNC</i> exported from <i>DLL</i></td>
|
||||
<td><a href="#func">user32::MessageBox</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>::<i>ADDR</i></th>
|
||||
<td>Function located at <i>ADDR</i></td>
|
||||
<td><a href="#funcaddr">see below</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>*<i>ADDR</i></th>
|
||||
<td>Structure located at <i>ADDR</i></td>
|
||||
<td><a href="#structaddr">see below</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>*</th>
|
||||
<td>New structure</td>
|
||||
<td><a href="#newstruct">see below</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i>IPTR</i>-><i>IDX</i></th>
|
||||
<td>Member indexed <i>IDX</i> from<br/>interface pointed by <i>IPTR</i></td>
|
||||
<td><a href="#com">see below</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><nothing></th>
|
||||
<td>New callback function</td>
|
||||
<td><a href="#callback">see below</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i>PROC</i></th>
|
||||
<td><i>PROC</i> returned by Get</td>
|
||||
<td><a href="#get">see below</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
|
||||
<h4>Available Parameter Types</h4>
|
||||
|
||||
<blockquote>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>v</th>
|
||||
<td>void (generally for return)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>i</th>
|
||||
<td>int (includes char, byte, short, handles, pointers and so on)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>l</th>
|
||||
<td>large integer, int64</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>t</th>
|
||||
<td>text, string (pointer to first character)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>w</th>
|
||||
<td>WCHAR text, Unicode string</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>g</th>
|
||||
<td>GUID</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>k</th>
|
||||
<td>callback</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>&v<i>N</i></th>
|
||||
<td><i>N</i> bytes padding (structures only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>&i<i>N</i></th>
|
||||
<td>integer of <i>N</i> bytes (structures only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>&l</th>
|
||||
<td>structure size (structures only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>&t<i>N</i></th>
|
||||
<td><i>N</i> bytes of text (structures only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>&w<i>N</i></th>
|
||||
<td><i>N</i> bytes of Unicode text (structures only)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>&g<i>N</i></th>
|
||||
<td><i>N</i> bytes of GUID (structures only)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
|
||||
<h4>Available Sources and Destinations</h4>
|
||||
|
||||
<blockquote>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>.</th>
|
||||
<td>ignored</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i>number</i></th>
|
||||
<td>concrete hex, decimal or octal integer value. several integers can be or'ed using the pipe symbol (`|')</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>'<i>string</i>'<br/>"<i>string</i>"<br/>`<i>string</i>`</th>
|
||||
<td>concrete string value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i>r0</i> through <i>r9</i></th>
|
||||
<td>$0 through $9 respectively</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><i>r10</i> through <i>r19</i><br/><i>R0</i> through <i>R9</i></th>
|
||||
<td>$R0 through $R9 respectively</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>c</th>
|
||||
<td>$CMDLINE</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>d</th>
|
||||
<td>$INSTDIR</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>o</th>
|
||||
<td>$OUTDIR</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>e</th>
|
||||
<td>$EXEDIR</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>a</th>
|
||||
<td>$LANG</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>s</th>
|
||||
<td>NSIS stack</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>n</th>
|
||||
<td>null for source, no output required for destination</td>
|
||||
</tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
|
||||
<h4>Callbacks</h4>
|
||||
|
||||
<blockquote>
|
||||
<p>Callback functions are simply functions which are passed to a function and called back by it. They are frequently used to pass a possibly large set of data item by item. For example, <a href="http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/EnumChildWindows.asp">EnumChildWindows</a> uses a <a href="http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/EnumChildProc.asp">callback function</a>. As NSIS functions are not quite regular functions, the System plug-in provides its own mechanism to support callback functions. It allows you to create callback functions and notifies you each time a callback function was called.</p>
|
||||
|
||||
<p>Creation of callback functions is done using <a href="#callfuncs">Get</a> and the callback creation syntax. As you will not call the callbacks yourself, the source of the parameters should be omitted using a dot. When the callback is called, the destination of the parameters will be filled with the values passed on to the callback. The value the callback will return is set by the source of the return "parameter". The destination of the return "parameter" should always be set as that's where System will notify you the callback was called.
|
||||
<blockquote><pre>System::Get "(i .r0, i .r1) iss"</pre></blockquote>
|
||||
</p>
|
||||
|
||||
<p>To pass a callback to a function, use the k type.
|
||||
<blockquote><pre>System::Get "(i .r0, i .r1) isR0"
|
||||
Pop $0
|
||||
System::Call "dll::UseCallback(k r0)"</pre></blockquote>
|
||||
</p>
|
||||
|
||||
<p>Each time the callback is called, the string callback#, where # is the number of the callback, will be placed in the destination of the return "parameter". The number of the first callback created is 1, the second's is 2, the third's is 3 and so on. As System is single threaded, a callback can only be called while calling another function. For example, EnumChildWindows's callback can only be called when EnumChildWindows is being called. You should therefore check for callback# after each function call that might call your callback.
|
||||
<blockquote><pre>System::Call "(i .r0, i .r1) isR0"
|
||||
Pop $0
|
||||
System::Call "dll::UseCallback(k r0)"
|
||||
StrCmp $R0 "callback1" 0 +2
|
||||
DetailPrint "UseCallback passed ($0, $1) to the callback"
|
||||
</pre></blockquote></p>
|
||||
|
||||
<p>After you've processed the callback call, you should use <a href="#callfuncs">Call</a>, passing it the value returned by <a href="#callfuncs">Get</a> - the callback. This tells System to return from the callback. If you've specified a source for the return "parameter" when the callback was created, you should fill that source with the appropriate return value.</p>
|
||||
<blockquote><pre>System::Call "(i .r0, i .r1) isR0"
|
||||
Pop $0
|
||||
System::Call "dll::UseCallback(k r0)"
|
||||
loop:
|
||||
StrCmp $R0 "callback1" 0 done
|
||||
DetailPrint "UseCallback passed ($0, $1) to the callback"
|
||||
Push 1 # return value of the callback
|
||||
System::Call $0 # tell system to return from the callback
|
||||
Goto loop
|
||||
done:
|
||||
</pre></blockquote>
|
||||
|
||||
<p>A complete working <a href="#callback">example</a> is available in the usage examples section.</p>
|
||||
|
||||
</p>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4>Notes</h4>
|
||||
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li>To find out the index of a member in a COM interface, you need to search for the definition of this COM interface in the header files that come with Visual C/C++ or the Platform SDK. Remember the index is zero based.</li>
|
||||
<li>Always remember to use NSIS's /NOUNLOAD switch or SetPluginUnload when working with callbacks. The System plug-in will not be able to process the callback calls right if it's unloaded.</li>
|
||||
<li>If a function can't be found, an `A' will be appended to its name and it will be looked up again. This is done because a lot of Windows API functions have two versions, one for ANSI strings and one for Unicode strings. The ANSI version of the function is marked with `A' and the Unicode version is marked with `W'. For example: lstrcpyA and lstrcpyW.</li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
|
||||
<h4>Available Options</h4>
|
||||
|
||||
<blockquote>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>c</th>
|
||||
<td>cdecl calling convention (the stack restored by caller). By default stdcall calling convention is used (the stack restored by callee).</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>r</th>
|
||||
<td>Always return (for GET means you should pop result and proc, for CALL means you should pop result (at least)). By default result is returned for errors only (for GET you will pop either error result or right proc, and for CALL you will get either your return or result at defined return place).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>n</th>
|
||||
<td>No redefine. Whenever this proc will be used it will never be redefined either by GET or CALL. This options is never inherited to children.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>s</th>
|
||||
<td>Use general Stack. Whenever the first callback defined the system starts using the temporary stacks for function calls.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>e</th>
|
||||
<td>Call GetLastError() after procedure end and push result on stack.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>u</th>
|
||||
<td>Unload DLL after call (using FreeLibrary, so you'll be able to delete it for example).</td>
|
||||
</tr>
|
||||
</table>
|
||||
</blockquote>
|
||||
|
||||
<h4>Usage Examples</h4>
|
||||
|
||||
<blockquote><pre>
|
||||
<a name="func"></a>System::<b>Call</b> "user32::MessageBox(i $HWNDPARENT, t 'NSIS System Plug-in', t 'Test', i 0)"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="funcaddr"></a>System::<b>Call</b> "kernel32::GetModuleHandle(t 'user32.dll') i .s"
|
||||
System::<b>Call</b> "kernel32::GetProcAddress(i s, t 'MessageBoxA') i .r0"
|
||||
System::<b>Call</b> "::$0(i $HWNDPARENT, t 'GetProcAddress test', t 'NSIS System Plug-in', i 0)"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="get"></a>System::<b>Get</b> "user32::MessageBox(i $HWNDPARENT, t 'This is a default text', t 'Default', i 0)"
|
||||
Pop $0
|
||||
System::<b>Call</b> "$0"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Get</b> "user32::MessageBox(i $HWNDPARENT, t 'This is a default text', \
|
||||
t 'Default', i 0x1|0x10)"
|
||||
Pop $0
|
||||
System::<b>Call</b> "$0(, 'This is a System::Get test', 'NSIS System Plug-in',)"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="structaddr"></a>System::Alloc 4
|
||||
Pop $0
|
||||
System::<b>Call</b> "*$0(i 5)"
|
||||
System::<b>Call</b> "*$0(i .r1)"
|
||||
DetailPrint $1
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="newstruct"></a>System::<b>Call</b> "*(i 5) i .r0"
|
||||
System::<b>Call</b> "*$0(i .r1)"
|
||||
DetailPrint $1
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="com"></a># defines
|
||||
!define CLSCTX_INPROC_SERVER 1
|
||||
!define CLSID_ActiveDesktop {75048700-EF1F-11D0-9888-006097DEACF9}
|
||||
!define IID_IActiveDesktop {F490EB00-1240-11D1-9888-006097DEACF9}
|
||||
# create IActiveDesktop interface
|
||||
System::<b>Call</b> "ole32::CoCreateInstance( \
|
||||
g '${CLSID_ActiveDesktop}', i 0, \
|
||||
i ${CLSCTX_INPROC_SERVER}, \
|
||||
g '${IID_IActiveDesktop}', *i .r0) i.r1"
|
||||
StrCmp $1 0 0 end
|
||||
# call IActiveDesktop->GetWallpaper
|
||||
System::<b>Call</b> "$0->4(w .r2, i ${NSIS_MAX_STRLEN}, i 0)"
|
||||
# call IActiveDesktop->Release
|
||||
System::<b>Call</b> "$0->2()"
|
||||
# print result
|
||||
DetailPrint $2
|
||||
end:
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
InitPluginsDir
|
||||
SetOutPath $PLUGINSDIR
|
||||
File MyDLL.dll
|
||||
System::<b>Call</b> "MyDLL::MyFunc(i 5) ? u"
|
||||
Delete $PLUGINSDIR\MyDLL.dll
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="callback"></a>SetPluginUnload alwaysoff
|
||||
System::<b>Get</b> "(i.r1, i) iss"
|
||||
Pop $R0
|
||||
System::<b>Call</b> "user32::EnumChildWindows(i $HWNDPARENT, k R0, i) i.s"
|
||||
loop:
|
||||
Pop $0
|
||||
StrCmp $0 "callback1" 0 done
|
||||
System::<b>Call</b> "user32::GetWindowText(ir1,t.r2,i${NSIS_MAX_STRLEN})"
|
||||
System::<b>Call</b> "user32::GetClassName(ir1,t.r3,i${NSIS_MAX_STRLEN})"
|
||||
IntFmt $1 "0x%X" $1
|
||||
DetailPrint "$1 - [$3] $2"
|
||||
Push 1 # callback's return value
|
||||
System::<b>Call</b> "$R0"
|
||||
Goto loop
|
||||
done:
|
||||
SetPluginUnload manual
|
||||
System::Free $R0
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
<a name="repeat"></a>!define MB "user32::MessageBox(i$HWNDPARENT,t,t'NSIS System Plug-in',i0)"
|
||||
System::<b>Call</b> "${MB}(,'my message',,)"
|
||||
System::<b>Call</b> "${MB}(,'another message',,) i.r0"
|
||||
MessageBox MB_OK "last call returned $0"
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Call</b> "user32::MessageBox(i $HWNDPARENT, t 'test', t 'test', i 0) i.s ? \
|
||||
e (,t'test replacement',,) i.r0 ? !e"
|
||||
DetailPrint $0
|
||||
ClearErrors
|
||||
Pop $0
|
||||
IfErrors good
|
||||
MessageBox MB_OK "this message box will never be reached"
|
||||
good:
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<h3><a name="64bitfuncs"></a>64-bit Functions</h3>
|
||||
|
||||
<div>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<b>Int64Op</b> <i>ARG1</i> <i>OP</i> [<i>ARG2</i>]
|
||||
<blockquote>
|
||||
<p>Performs <i>OP</i> on <i>ARG1</i> and optionally <i>ARG2</i> and returns the result on the stack. Both <i>ARG1</i> and <i>ARG2</i> are 64-bit integers. This means they can range between -2^63 and 2^63 - 1.</p>
|
||||
<h4>Available Operations</h4>
|
||||
<ul>
|
||||
<li>Addition -- <b>+</b></li>
|
||||
<li>Subtraction -- <b>-</b></li>
|
||||
<li>Multiplication -- <b>*</b></li>
|
||||
<li>Division -- <b>/</b></li>
|
||||
<li>Module -- <b>%</b></li>
|
||||
<li>Bitwise or -- <b>|</b></li>
|
||||
<li>Bitwise and -- <b>&</b></li>
|
||||
<li>Bitwise xor -- <b>^</b></li>
|
||||
<li>Logical or -- <b>||</b></li>
|
||||
<li>Logical and -- <b>&&</b></li>
|
||||
<li>Less than -- <b><</b></li>
|
||||
<li>Greater than -- <b>></b></li>
|
||||
<li>Equals -- <b>=</b></li>
|
||||
<li>Bitwise not (one argument) -- <b>~</b></li>
|
||||
<li>Logical not (one argument) -- <b>!</b></li>
|
||||
</ul>
|
||||
|
||||
<h4>Usage Examples</h4>
|
||||
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 5 + 5
|
||||
Pop $0
|
||||
DetailPrint "5 + 5 = $0" # 10
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 64 - 25
|
||||
Pop $0
|
||||
DetailPrint "64 - 25 = $0" # 39
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 526355 * 1565487
|
||||
Pop $0
|
||||
DetailPrint "526355 * 1565487 = $0" # 824001909885
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 5498449498849818 / 3
|
||||
Pop $0
|
||||
DetailPrint "5498449498849818 / 3 = $0" # 1832816499616606
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 0x89498A198E4566C % 157
|
||||
Pop $0
|
||||
DetailPrint "0x89498A198E4566C % 157 = $0" # 118
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 0xF0F0F0F | 0xF0F0FFF
|
||||
Pop $0
|
||||
IntFmt $0 "0x%X" $0
|
||||
DetailPrint "0xF0F0F0F | 0xF0F0FFF = $0" # 0xF0F0FFF
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 0x12345678 & 0xF0F0F0F0
|
||||
Pop $0
|
||||
IntFmt $0 "0x%X" $0
|
||||
DetailPrint "0x12345678 & 0xF0F0F0F0 = $0" # 0x10305070
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 1 ^ 0
|
||||
Pop $0
|
||||
DetailPrint "1 ^ 0 = $0" # 1
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 1 || 0
|
||||
Pop $0
|
||||
DetailPrint "1 || 0 = $0" # 1
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 1 && 0
|
||||
Pop $0
|
||||
DetailPrint "1 && 0 = $0" # 0
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 5168 < 89873
|
||||
Pop $0
|
||||
DetailPrint "5168 < 89873 = $0" # 1
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 5168 > 89873
|
||||
Pop $0
|
||||
DetailPrint "5168 > 89873 = $0" # 0
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 189189 = 189189
|
||||
Pop $0
|
||||
DetailPrint "189189 = 189189 = $0" # 1
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 1 ~
|
||||
Pop $0
|
||||
IntFmt $0 "0x%X" $0
|
||||
DetailPrint "1 ~ = $0" # 0xFFFFFFFE
|
||||
</pre></blockquote>
|
||||
<blockquote><pre>
|
||||
System::<b>Int64Op</b> 1 !
|
||||
Pop $0
|
||||
DetailPrint "1 ! = $0" # 0
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<h2><a name="faq"></a>FAQ</h2>
|
||||
|
||||
<div>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<b>Q:</b> How can I pass structs to functions?
|
||||
<blockquote>
|
||||
<p><b>A:</b> First of all, you must allocate the struct. This can be done in two ways. You can either use <a href="#memfuncs">Alloc</a> or <a href="#callfuncs">Call</a> with the special struct allocation syntax. Next, if you need to pass data in the struct, you must fill it with data. Then you call the function with a pointer to the struct. Finally, if you want to read data from the struct which might have been written by the called function, you must use <a href="#callfuncs">Call</a> with the struct handling syntax. After all is done, it's important to remember to free the struct.</p>
|
||||
|
||||
<h4>Allocation</h4>
|
||||
|
||||
<blockquote><p>To allocate the struct using <a href="#memfuncs">Alloc</a>, you must know the size of the struct in bytes. Therefore, it would normally be easier to use <a href="#callfuncs">Call</a>. In this case it's easy to see the required size is 16 bytes, but other cases might not be that trivial. In both cases, the struct address will be located on the top of the stack and should be retrieved using Pop.</p>
|
||||
|
||||
<blockquote><pre>
|
||||
System::Alloc 16
|
||||
</pre></blockquote>
|
||||
|
||||
<blockquote><pre>
|
||||
System::Call "*(i, i, i, t).s"
|
||||
</pre></blockquote>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4>Setting Data</h4>
|
||||
|
||||
<blockquote><p>Setting data can be done using <a href="#callfuncs">Call</a>. It can be done in the allocation stage, or in another stage using the struct handling syntax.</p>
|
||||
|
||||
<blockquote><pre>
|
||||
System::Call "*(i 5, i 2, i 513, t 'test')"
|
||||
</pre></blockquote>
|
||||
|
||||
<blockquote><pre>
|
||||
# assuming the struct's memory address is kept in $0
|
||||
System::Call "*$0(i 5, i 2, i 513, t 'test')"
|
||||
</pre></blockquote>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4>Passing to the Function</h4>
|
||||
|
||||
<blockquote><p>As all allocation methods return an address, the type of the passed data should be an integer, an address in memory.</p>
|
||||
|
||||
<blockquote><pre>
|
||||
# assuming the struct's memory address is kept in $0
|
||||
System::Call "dll::func(i r0)"
|
||||
</pre></blockquote>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4>Reading Data</h4>
|
||||
|
||||
<blockquote><p>Reading data from the struct can be done using the same syntax as setting it. The only difference is that the destination part of the parameter will be set and the source part will be omitted using a dot.</p>
|
||||
|
||||
<blockquote><pre>
|
||||
# assuming the struct's memory address is kept in $0
|
||||
System::Call "*$0(i .r0, i .r1, i .r2, t .r3)"
|
||||
DetailPrint "first int = $0"
|
||||
DetailPrint "second int = $1"
|
||||
DetailPrint "third int = $2"
|
||||
DetailPrint "string = $3"
|
||||
</pre></blockquote>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4>Freeing Memory</h4>
|
||||
|
||||
<blockquote><p>Memory is freed using <a href="#memfuncs">Free</a>.</p>
|
||||
|
||||
<blockquote><pre>
|
||||
# assuming the struct's memory address is kept in $0
|
||||
System::Free $0
|
||||
</pre></blockquote>
|
||||
|
||||
</blockquote>
|
||||
|
||||
<h4>A Complete Example</h4>
|
||||
|
||||
<blockquote><pre>
|
||||
# allocate
|
||||
System::Alloc 32
|
||||
Pop $1
|
||||
# call
|
||||
System::Call "Kernel32::GlobalMemoryStatus(i r1)"
|
||||
# get
|
||||
System::Call "*$1(i.r2, i.r3, i.r4, i.r5, i.r6, i.r7, i.r8, i.r9)"
|
||||
# free
|
||||
System::Free $1
|
||||
# print
|
||||
DetailPrint "Structure size: $2 bytes"
|
||||
DetailPrint "Memory load: $3%"
|
||||
DetailPrint "Total physical memory: $4 bytes"
|
||||
DetailPrint "Free physical memory: $5 bytes"
|
||||
DetailPrint "Total page file: $6 bytes"
|
||||
DetailPrint "Free page file: $7 bytes"
|
||||
DetailPrint "Total virtual: $8 bytes"
|
||||
DetailPrint "Free virtual: $9 bytes"
|
||||
</pre></blockquote>
|
||||
|
||||
</blockquote>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,180 +0,0 @@
|
|||
NSIS System Plugin
|
||||
(c) brainsucker (Nik Medved), 2002
|
||||
|
||||
The whole system plugin and this documentation as a part could be a hard
|
||||
barrier for non Win32 programmers, in this case you could come to NSIS forum
|
||||
(http://forums.winamp.com/forumdisplay.php?forumid=65) and ask some questions
|
||||
to the people living there, they'll always help you.
|
||||
|
||||
By the way, any help in writing complete and easy-to-go System plugin
|
||||
documentation will be appreciated.
|
||||
|
||||
Note: it will be best to turn plugin unload off in case of using System
|
||||
plugin (SetPluginUnload alwaysoff).
|
||||
|
||||
============== Main functions ==============
|
||||
|
||||
RESULT/PROC System::Get "Proc"
|
||||
RESULT/RETURN System::Call "Proc" StackArgs...
|
||||
|
||||
These functions return error RESULTs or PROC/RETURN in OK case.
|
||||
Error result is "error" and callback results are "callbackN", where N is
|
||||
callback index.
|
||||
|
||||
============== Additional functions ==============
|
||||
|
||||
----------------------------------
|
||||
System::Int64Op ARG1 OP1
|
||||
System::Int64Op ARG1 OP2 ARG2
|
||||
----------------------------------
|
||||
Performs operation on ARG1 and ARG2 (or on ARG1 only at single argument
|
||||
operator cases) and returns result on stack. Here are the OP2s: +, -, *, / DIV,
|
||||
% MOD, | OR, & AND, ^ XOR, || LOGIC-OR, && LOGIC-AND, < BELOW, > ABOVE, = EQUAL.
|
||||
There are only 2 OP1s: ~ (BITWISE-NOT) and ! (LOGIC-NOT).
|
||||
|
||||
----------------------------------
|
||||
System::Alloc SIZE
|
||||
----------------------------------
|
||||
Allocates SIZE bytes and returns the pointer on stack.
|
||||
|
||||
----------------------------------
|
||||
System::Copy 0 SOURCE
|
||||
System::Copy DESTINATION SOURCE
|
||||
System::Copy /SIZE 0 SOURCE
|
||||
System::Copy /SIZE DESTINATION SOURCE
|
||||
----------------------------------
|
||||
Copys data from source to destination, if /SIZE option and SIZE itself
|
||||
are undefined uses GlobalSize to determine source size. If destination is equal
|
||||
to 0, allocates the new memory block.
|
||||
|
||||
----------------------------------
|
||||
System::Free ADDR
|
||||
----------------------------------
|
||||
Frees memory used by object at ADDR (callbacks too).
|
||||
|
||||
----------------------------------
|
||||
System::Store COMMAND
|
||||
----------------------------------
|
||||
Store operations, allows to save/restore registers, pop/push values on
|
||||
stack. COMMAND is string consisting of following ops:
|
||||
s, S - push the whole registers range (to separate stack)
|
||||
l, L - pop the whole registers range (from separate stack)
|
||||
pN - push $N register to general nsis stack
|
||||
PN - push $RN register to general nsis stack
|
||||
rN - pop $N register from general nsis stack
|
||||
RN - pop $RN register from general nsis stack
|
||||
|
||||
============== Get/Call syntaxis ==============
|
||||
|
||||
----------------------------------
|
||||
Syntax:
|
||||
----------------------------------
|
||||
"Proc(Params)Return?Options#Proc(Params)Return?Options..."
|
||||
|
||||
----------------------------------
|
||||
Proc:
|
||||
----------------------------------
|
||||
dll::proc -> Proc from DLL
|
||||
::addr -> Handle to system proc (memory address)
|
||||
*addr -> Structure
|
||||
* -> New structure
|
||||
IPtr->MemberIdx -> Call member with member index from interface given
|
||||
by interface pointer IPtr (IPtr will be passed to
|
||||
proc automatically, use like C++ call).
|
||||
nothing -> Dup proc, usually callback or for future defenition
|
||||
|
||||
proc -> Ready proc specification for use or redefinition
|
||||
|
||||
|
||||
If in System::Call proc specification points to already existing proc,
|
||||
the existing proc will be adapted and executed, otherwise the new proc will be
|
||||
created, executed and deleted.
|
||||
|
||||
----------------------------------
|
||||
Params syntax:
|
||||
----------------------------------
|
||||
(Param1, Param2, Param3...), the number of params of proc is set
|
||||
to number of params at last Params section (so params cutting may ocur). If you
|
||||
need to save previous Param defenition use '_' after last param at Params
|
||||
section - no param cutting will ocur for it (section).
|
||||
Syntax of single param: "Type Source Destination", type can be omitted (previous
|
||||
or void will be used), each of Source and Destination can be replaced with
|
||||
'.' placeholder. Any parameter can be omitted at all - previous or default
|
||||
values will be used (example: "(i1,,i2)", 2nd arg omitted).
|
||||
|
||||
Return section is like single param defenition, but the Source defenition is
|
||||
never used, beside callback cases.
|
||||
|
||||
----------------------------------
|
||||
Params & Return - Type:
|
||||
----------------------------------
|
||||
v - void (generaly for return)
|
||||
i - int (includes char, byte, short, handles, pointers and so on)
|
||||
l - long & large integer (know as int64)
|
||||
t - text, string (LPCSTR, pointer to first character)
|
||||
w - WCHAR text, or unicode string.
|
||||
g - GUID
|
||||
k - callback. See Callback section.
|
||||
|
||||
* - pointer specifier -> the proc needs the pointer to type, affects
|
||||
next char (parameter) [ex: '*i' - pointer to int]
|
||||
|
||||
----------------------------------
|
||||
For structures:
|
||||
& - additional meaning specificator.
|
||||
----------------------------------
|
||||
&v - padding, &vN - pad for N bytes
|
||||
&i - smaller types: &i4, &i2 (short), &i1 (byte)
|
||||
&l - cumbersome, but &lN means the structure size (N bytes value),
|
||||
calculated automaticaly, outputed always as int (N could be 0).
|
||||
&t - structure contains plain text, &tN, where lenght == N bytes.
|
||||
&w - structure contains plain unicode text, &tN,
|
||||
where lenght == (N)/2 chars = N bytes.
|
||||
&g - &gN copy N bytes of plain GUID. in fact guid size is 16 :)
|
||||
|
||||
----------------------------------
|
||||
Params & Return - Source / Destination:
|
||||
----------------------------------
|
||||
. - makes no change to source
|
||||
0..9 - starts numeric inline input (accepts 0..9, x, |)
|
||||
" / ' / ` - starts / ends string inline input
|
||||
Registers $0-$9 -> r(0..9)
|
||||
Registers $R0-$R9 -> 'r(10..19)' or 'R(0..9)'
|
||||
Additional regs -> c(Cmdline) d(instDir) o(Outdir) e(Exedir) a(lAng)
|
||||
Stack -> s (you could pass arguments from Call line, see examples)
|
||||
None -> n (0 (null) for input / specifies no output is required)
|
||||
|
||||
Note: If you are using inline input syntax, you shouldn't use the same quotes for
|
||||
quoting inlines and the whole defenition. If you need to place the
|
||||
same quotes into input as you used for separation of input expression just use
|
||||
these characters in doubled way. For example (t "just an ""Example""!").
|
||||
|
||||
----------------------------------
|
||||
Options:
|
||||
(any option can be turned off (returned to default value) by specifing
|
||||
'!' where needed, for example _stdcall cc can be turned on by '!c'):
|
||||
----------------------------------
|
||||
c - _cdecl calling convention (the stack restored by caller). By default
|
||||
stdcall calling convention is used (the stack restored by callee).
|
||||
r - always return (for GET means you should pop result and proc,
|
||||
for CALL means you should pop result (at least)). By default result is returned
|
||||
for errors only (for GET you will pop either error result or right
|
||||
proc, and for CALL you will get either your return or result at defined
|
||||
return place.
|
||||
n - no redefine. Whenever this proc will be used it will never be
|
||||
redefined either by GET or CALL. This options is never inherited to childs.
|
||||
s - use general Stack. Whenever the first callback defined the system
|
||||
starts using the temporary stacks for function calls.
|
||||
e - call GetLastError() after procedure end and push result on stack,
|
||||
u - unload DLL after call (using FreeLibrary, so you'll be able to
|
||||
do something with it, delete for example).
|
||||
|
||||
----------------------------------
|
||||
Callback:
|
||||
----------------------------------
|
||||
You should check for callbacked return after every function call which can use
|
||||
your callback. General scheme is:
|
||||
1. Check result for callback or normal return
|
||||
2. Input arguments defined for callback are at places.
|
||||
3. Place output and return arguments
|
||||
4. Call System::Call using callback proc handle
|
|
@ -42,7 +42,7 @@ Released on February 7th, 2004
|
|||
|
||||
\b Improved plug-ins: \L{../Contrib/InstallOptions/Readme.html}{InstallOptions}, \L{../Contrib/NSISdl/ReadMe.txt}{NSISdl} and \L{../Contrib/Splash/splash.txt}{Splash}
|
||||
|
||||
\b New plug-ins: \L{../Contrib/AdvSplash/advsplash.txt}{AdvSplash}, \L{../Contrib/Banner/Readme.txt}{Banner}, \L{../Contrib/BgImage/BgImage.txt}{BgImage}, \L{../Contrib/Dialer/Dialer.txt}{Dialer}, \L{../Examples/languages.nsi}{LangDLL}, \L{../Contrib/Math/Math.txt}{Math}, \L{../Contrib/nsExec/nsExec.txt}{nsExec}, \L{../Contrib/StartMenu/Readme.txt}{StartMenu}, \L{../Contrib/System/System.txt}{System}, \L{../Contrib/UserInfo/UserInfo.nsi}{UserInfo} and \L{../Contrib/VPatch/Readme.html}{VPatch}
|
||||
\b New plug-ins: \L{../Contrib/AdvSplash/advsplash.txt}{AdvSplash}, \L{../Contrib/Banner/Readme.txt}{Banner}, \L{../Contrib/BgImage/BgImage.txt}{BgImage}, \L{../Contrib/Dialer/Dialer.txt}{Dialer}, \L{../Examples/languages.nsi}{LangDLL}, \L{../Contrib/Math/Math.txt}{Math}, \L{../Contrib/nsExec/nsExec.txt}{nsExec}, \L{../Contrib/StartMenu/Readme.txt}{StartMenu}, \L{../Contrib/System/System.html}{System}, \L{../Contrib/UserInfo/UserInfo.nsi}{UserInfo} and \L{../Contrib/VPatch/Readme.html}{VPatch}
|
||||
|
||||
\b New and improved utilities: \L{../Contrib/Makensisw/Readme.txt}{MakeNSISw}, NSIS Menu (NSIS.exe), NSIS Update (Bin\\NSIS Update.exe) and zip2exe (Bin\\zip2exe.exe)
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ System.dll recognises the following data types:
|
|||
|
||||
\b b - boolean (needs/returns 'true':'false') - by the fact this type is senseless -> usual integer can be used ('0':'1')
|
||||
|
||||
\b k - callback. See Callback section in system.txt.
|
||||
\b k - callback. See Callback section in system.html.
|
||||
|
||||
\b * - pointer specifier -> the proc needs the pointer to type, affects next char (parameter) [ex: '*i' - pointer to int]
|
||||
|
||||
|
|
|
@ -539,6 +539,7 @@ Section "System" SecPluginsSystem
|
|||
File ..\Contrib\System\*.nsh
|
||||
File ..\Contrib\System\*.nsi
|
||||
File ..\Contrib\System\*.txt
|
||||
File ..\Contrib\System\*.html
|
||||
SectionEnd
|
||||
|
||||
Section "StartMenu" SecPluginsStartMenu
|
||||
|
@ -1058,17 +1059,16 @@ Section -post
|
|||
CreateDirectory $SMPROGRAMS\NSIS\Contrib
|
||||
CreateShortCut "$SMPROGRAMS\NSIS\Contrib\MakeNSISW readme.lnk" "$INSTDIR\contrib\MakeNsisw\readme.txt"
|
||||
|
||||
Push "MakeNSISW"
|
||||
Push MakeNSISW
|
||||
Call AddWorkspaceToStartMenu
|
||||
|
||||
; ExDLL
|
||||
Push "ExDLL"
|
||||
Push ExDLL
|
||||
Call AddWorkspaceToStartMenu
|
||||
|
||||
; InstallOptions
|
||||
Push "InstallOptions\Readme.html"
|
||||
Push "InstallOptions Readme"
|
||||
Call AddContribToStartMenu
|
||||
Push InstallOptions
|
||||
Call AddReadmeToStartMenu
|
||||
|
||||
Push "InstallOptions\io.dsw"
|
||||
Push "Source\InstallOptions project workspace"
|
||||
|
@ -1082,9 +1082,8 @@ Section -post
|
|||
Call AddWorkspaceToStartMenu
|
||||
|
||||
; Modern UI
|
||||
Push "Modern UI\Readme.html"
|
||||
Push "Modern UI Readme"
|
||||
Call AddContribToStartMenu
|
||||
Push "Modern UI"
|
||||
Call AddReadmeToStartMenu
|
||||
|
||||
; Splash
|
||||
Push Splash
|
||||
|
@ -1160,9 +1159,8 @@ Section -post
|
|||
Call AddContribToStartMenu
|
||||
|
||||
; VPatch
|
||||
Push "VPatch\Readme.html"
|
||||
Push "VPatch Readme"
|
||||
Call AddContribToStartMenu
|
||||
Push VPatch
|
||||
Call AddReadmeToStartMenu
|
||||
|
||||
no_startshortcuts:
|
||||
!endif
|
||||
|
@ -1384,8 +1382,14 @@ Function AddReadmeToStartMenu
|
|||
IfFileExists $INSTDIR\Contrib\$0\$0.txt 0 +3
|
||||
Push $0\$0.txt
|
||||
Goto create
|
||||
IfFileExists $INSTDIR\Contrib\$0\Readme.txt 0 done
|
||||
IfFileExists $INSTDIR\Contrib\$0\$0.html 0 +3
|
||||
Push $0\$0.html
|
||||
Goto create
|
||||
IfFileExists $INSTDIR\Contrib\$0\Readme.txt 0 +3
|
||||
Push $0\Readme.txt
|
||||
Goto create
|
||||
IfFileExists $INSTDIR\Contrib\$0\Readme.html 0 done
|
||||
Push $0\Readme.html
|
||||
create:
|
||||
Push "$0 Readme"
|
||||
Call AddContribToStartMenu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue