Ant task for compiling NSIS scripts on Windows, Linux and Mac systems. Helps automate the build process of projects that use the NSIS installer.
Java NSIS
Pull request Compare This branch is 7 commits ahead of dreese:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/com/danielreese/nsisant
.gitignore
README.markdown
build.xml
test.nsi

README.markdown

NSIS Ant Task

Description

Ant task for compiling NSIS scripts on Windows, Linux and Mac systems. Help automate the build process of projects that use the NSIS installer.

To use it, put the NSIS Ant jarfile in an accessible location and add the following to your Ant script:

<taskdef resource="com/danielreese/nsisant/antlib.xml">
    <classpath location="nsisant-{version}.jar">
</taskdef>

For more information, please view the API, visit the project homepage or read the MakeNSIS documentation.

Download

Download NSIS Ant 1.3 or the source and Javadoc.

NSIS Element Parameters

  • script (required) — Path of the NSIS script to compile.
  • verbosity — How much logging is written to standard output. Default is 0.
    1. no output
    2. errors only
    3. errors and warnings
    4. errors, warnings and info
    5. all output
  • out — File to which to log the output. Default is standard out.
  • pause — Whether to pause after execution of the script. Default is no.
  • noconfig — Whether to disable inclusion of nsisconf.nsh. Default is no.
  • nocd — Whether to disable changing to the directory containing the script. Default is no.
  • prefix — The prefix to use for the command-line options to makensis. Default is to use '/' on Windows and '-' otherwise.
  • path — The directory containing the makensis executable. Default is to search the PATH.

Nested Elements and Parameters

define

Defines a symbol for the script. Equivalent to the /D (-D on non-Windows platforms) command line parameter of makensis. Multiple instances of this element are permitted. It supports the following parameters:

  • name (required) — The name of the symbol to define.
  • value (required) — The value of the symbol.

scriptcmd

Executes an NSIS command in the script. Equivalent to the /X (-X on non-Windows platforms) command line parameter of makensis. Multiple instances of this element are allowed and are executed in the order specified. It supports the following parameters:

  • cmd (required) — The NSIS command to execute in the script.

Examples

Compile a script using all of the default values.

<makensis script="myproject.nsi"/>

Compile a script with verbose output, logging to a file, and the inclusion of nsisconf.nsh disabled. The VERSION symbol is set to the value "2.1" and the "AutoCloseWindow true" command is executed at the beginning of the script.

<makensis script="myproject.nsi" verbosity="4" out="build.log" noconfig="yes">
    <define name="VERSION" value="2.1"/>
    <scriptcmd cmd="AutoCloseWindow true"/>
</makensis>

License

Copyright © 2004 Wayne Grant. Relicensed with permission.
Copyright © 2005-2010 Daniel Reese
Copyright © 2016 Julien Gouesse

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.