Building in General

NSIS

Previous | Contents | Next

G.1 Building in General

Source code is available in SVN and as a separate package with every NSIS distribution.

To build NSIS, Python and SCons must be installed. Currently, the supported version of SCons is version 1.2.0 and above. Any version of Python above 1.6 is supported.

NSIS uses the zlib compression library. As a consequence the header and library files of zlib must be installed.

In case these zlib development files aren't present then they could be installed via a package manager (apt-get, aptitude, rpm, yum) on POSIX platforms. Another option is to build zlib from scratch and install it.

For Windows it is recommended to download zlib from http://nsis.sf.net/Zlib. Extract the contents of this zip archive to a folder of your choice, e.g. C:\dev\zlib-1.2.7 and set an environment variable named ZLIB_W32 containing this path.

C:\>set ZLIB_W32=C:\dev\zlib-1.2.7

Alternatively the command line option ZLIB_W32 specifying the path can be passed to scons instead of the environment variable.

C:\dev\nsis>scons ZLIB_W32=C:\dev\zlib-1.2.7

The header and library files are assumed to be in %ZLIB_W32%. In addition scons checks for zlib header files in %ZLIB_W32%\include, the import library zdll.lib in %ZLIB_W32%\lib and the dynamic link library zlib1.dll in %ZLIB_W32% respectively %ZLIB_W32%\lib.

To build, open a console, change the working directory to the root directory of NSIS and type scons. That's it. For example:

C:\>cd dev\nsis
C:\dev\nsis>scons
scons: Reading SConscript files ...
Using Microsoft tools configuration
Checking for main() in C library gdi32... (cached) yes
Checking for main() in C library user32... (cached) yes
Checking for main() in C library version... (cached) yes
Checking for main() in C library pthread... (cached) no
Checking for main() in C library stdc++... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library libiconv... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
...

To install the built files, type:

scons PREFIX="C:\Program Files\NSIS" install

To create an installer (only on Windows), type:

scons dist-installer

To create a distribution zip file, type:

scons dist-zip

To create both, type:

scons dist

To get a complete list of options that the build system has to offer, type:

scons -h

To get a complete list of options SCons has to offer, type:

scons -H

Previous | Contents | Next