The nsis package

[Tags: bsd3, library]

NSIS (Nullsoft Scriptable Install System, is a tool that allows programmers to create installers for Windows. This library provides an alternative syntax for NSIS scripts, as an embedded Haskell language, removing much of the hard work in developing an install script. Simple NSIS installers should look mostly the same, complex ones should be significantly more maintainable.

[Skip to ReadMe]


Versions0.1, 0.1.1, 0.1.2, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.3
Change logCHANGES.txt
Dependenciesbase (==4.*), transformers (>=0.2), uniplate (>=1.5) [details]
CopyrightNeil Mitchell 2012-2015
AuthorNeil Mitchell <>
MaintainerNeil Mitchell <>
Home page
Bug tracker
Source repositoryhead: git clone
UploadedWed Jun 24 18:15:56 UTC 2015 by NeilMitchell
DistributionsLTSHaskell:0.3, NixOS:0.3, Stackage:0.3
Downloads1810 total (52 in last 30 days)
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]




Maintainers' corner

For package maintainers and hackage trustees

Readme for nsis-0.3

NSIS Manual Hackage version Build Status

This library makes it easier to write NSIS Windows Installers. You should use this library if:

The original NSIS tool requires you to write a script in a custom programming language. This library lets you write a Haskell program using special functions that generates an NSIS script. Using this library is better because:

If your script is simple it is likely to look relatively similar in either system. If your script is complex it could end up 100 lines shorter and far clearer in my system. As an illustrative example, let's warn before installing into the Windows directory or the System directory. In original NSIS this would be:

Goto skip
MessageBox MBOK|MB_ICON_EXCLAMATION "Warning: installing into the Windows directory"

Using this library we can write:

iff_ ("$INSTDIR" %== "$WINDIR" %|| "$INSTDIR" %== "$SYSDIR") $
    alert "Warning: installing into the Windows directory"

A Simple Example

The Examples directory contains a number of simple NSIS scripts, several ported from the NSIS distributed examples. As a simple example:

import Development.NSIS

main = writeFile "example1.nsi" $ nsis $ do
     name "Example1"                  -- The name of the installer
     outFile "example1.exe"           -- Where to produce the installer
     installDir "$DESKTOP/Example1"   -- The default installation directory
     requestExecutionLevel User       -- Request application privileges for Windows Vista
     -- Pages to display
     page Directory                   -- Pick where to install
     page InstFiles                   -- Give a progress bar while installing
     -- Groups fo files to install
     section "" [] $ do
         setOutPath "$INSTDIR"        -- Where to install files in this section
         file [] "Example1.hs"        -- File to put into this section

Running this code will generate a file example1.nsi that can be processed with makensis to produce the installer example1.exe. Documentation on each of the functions is available here.

Contributions welcome

I welcome contributions. Some things you could help with:

I have written this library to address my needs. I would welcome bug reports or pull requests, in particular if you can write the installer you need in NSIS but not in this library.