NfUtils header file: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 4: Line 4:


Go to [http://forums.winamp.com/showthread.php?s=dd6f8b54c243634fa89aab9aecf4f663&threadid=249699 Forum thread]
Go to [http://forums.winamp.com/showthread.php?s=dd6f8b54c243634fa89aab9aecf4f663&threadid=249699 Forum thread]
 
<br><br>
Download current version:
Download current version:
<br>
<br>
Line 38: Line 38:
   !include "nfUtils.nsh"
   !include "nfUtils.nsh"
</highlight-nsis>
</highlight-nsis>
Descriptions for nfUtils' macros and functions can be obtained by adding the instruction
<highlight-nsis>
{$nfu.!Help} ?
</highlight-nsis>
to your script. This help is implemented by using symbols (NSIS' gflags) for the descriptive text. Because there is a limitation of 64kB per symbolvalue, nfUtils groups its help into sections, which are identified by prefixes. Currently there are two groups (sectionprefixes): "" (none) and "nfu." (for nfUtils' macros and functions). Thus, the instruction
<highlight-nsis>
{$nfu.!Help} nfu.
</highlight-nsis>
will give you an index of all descriptions, which have been installed with the prefix "nfu.", by using one of the macros {$nfu.!InstallMacro}, {$nfu.!InstallFunction} or {$nfu.!InstallDescription}. Finally, the instruction
<highlight-nsis>
{$nfu.!Help} "nfu.!InstallMacro"
</highlight-nsis>
will output the description, which has been provided for the macro "!InstallMacro" (prefixed by "nfu."). It goes without saying that you may (and should) use this little helpsystem for your own macros and functions. But {$nfu.!Help} is only a by-product of the more important macros {$nfu.!InstallFunction} and {$nfu.!InstallMacro}.


[[Category:Headers]]
[[Category:Headers]]

Revision as of 11:59, 20 July 2006

Author: niteflyer (talk, contrib)


Links

Go to Forum thread

Download current version:
Version 1.2.0.0 (07-11-2006): Zip.gif nfUtils12.zip

Download older versions:
Version 1.1.0.0 (06-30-2006): Zip.gif nfUtils11.zip
Version 1.0.0.0 (06-03-2006): Zip.gif nfUtils.zip


Description

nfUtils is a collection of macros and functions in a NSIS header file.

How to use

Download the zipped installer for the current version of nfUtils, unzip and start the installer nfUtils.exe. The installer will add the following files to your NSIS installation:

nfUtils.nsh (the header file)
nfUtils.nsi (the installer script)
nfUtils.exe (the installer)
nfgetver.exe (utility used by nfUtils.nsh)

Basically you will only need nfUtils.nsh in the include directory of your NSIS installation: nfgetver.exe will be generated, when it is needed and unavailable. The installer's script is provided for learning purposes, because it will show the usage of some macros and functions.

To use the header, place this at the beginning of your script:

  !include "nfUtils.nsh"

Descriptions for nfUtils' macros and functions can be obtained by adding the instruction

{$nfu.!Help} ?

to your script. This help is implemented by using symbols (NSIS' gflags) for the descriptive text. Because there is a limitation of 64kB per symbolvalue, nfUtils groups its help into sections, which are identified by prefixes. Currently there are two groups (sectionprefixes): "" (none) and "nfu." (for nfUtils' macros and functions). Thus, the instruction

{$nfu.!Help} nfu.

will give you an index of all descriptions, which have been installed with the prefix "nfu.", by using one of the macros {$nfu.!InstallMacro}, {$nfu.!InstallFunction} or {$nfu.!InstallDescription}. Finally, the instruction

{$nfu.!Help} "nfu.!InstallMacro"

will output the description, which has been provided for the macro "!InstallMacro" (prefixed by "nfu."). It goes without saying that you may (and should) use this little helpsystem for your own macros and functions. But {$nfu.!Help} is only a by-product of the more important macros {$nfu.!InstallFunction} and {$nfu.!InstallMacro}.