nsiswrapper (1) - Linux Manuals
nsiswrapper: Helper program for making NSIS Windows installers
nsiswrapper - Helper program for making NSIS Windows installers
nsiswrapper [options] [roots...] nsiswrapper myprogram.exe anotherprog.exe docs/ > script.nsis nsiswrapper --run myprogram.exe anotherprog.exe docs/
DESCRIPTIONnsiswrapper is a helper program for making it easier to create Windows installers in a cross-compiler environment. It still requires NSIS (a Windows installer generator) but cuts out the tedium of writing the NSIS command script, and can even invoke NSIS automatically to generate a final Windows executable.
The general way to use it is to list out some files that you want packaged. For example:
This will search for "myprogram.exe" and any libraries ("*.dll") that it depends upon, and then it will print out an NSIS script.
If you want to have it run "makensis" as well (to automatically create a Windows installer) then do:
nsiswrapper --run myprogram.exe
which will generate "installer.exe" output file that contains "myprogram.exe" plus any dependencies.
You can list other files and directories that you want to have contained in your installer. For example:
nsiswrapper myprogram.exe anotherprog.exe docs/*.html
There are many other command line options which control aspects of the NSIS command script (and hence, the final installer), such as:
- The name of the final installer.
- Desktop shortcuts and menu items.
- License files.
ROOTS (FILES AND DIRECTORIES)Each parameter should refer to a file or directory which is to be included in the installer.
These are known as ``roots'' because we also automatically add any dependencies to the list of files. Thus if a Windows executable requires any DLLs, those are added automatically. DLLs are searched for on the current $PATH (environment variable).
We choose the install location by removing any common prefix from the names of roots, which generally ensures that the original directory structure is preserved. Thus for example if the original roots (and any dependencies) are:
/usr/i686-pc-mingw32/sys-root/mingw/bin/program.exe /usr/i686-pc-mingw32/sys-root/mingw/bin/library.dll /usr/i686-pc-mingw32/sys-root/mingw/etc/config
then the install directory will look like this:
$INSTDIR/bin/program.exe $INSTDIR/bin/library.dll $INSTDIR/etc/config
($INSTDIR is the installation directory chosen by the user at install time).
You can also specify the install location (relative to $INSTDIR) by adding roots of the form:
/usr/i686-pc-mingw32/sys-root/mingw/bin/program.exe=program.exe /usr/i686-pc-mingw32/sys-root/mingw/bin/library.dll=library.dll /usr/i686-pc-mingw32/sys-root/mingw/etc/config=conf/config
which results in:
$INSTDIR/program.exe $INSTDIR/library.dll $INSTDIR/conf/config
- Print brief help message and exit.
- Print the full manual page for the command and exit.
- Print verbose messages while running. If this is not given then we try to operate quietly.
- Normally this program just prints out the NSIS installer command script. However if you supply this option, then we run "makensis" and attempt to generate an actual Windows installer.
- GTK programs should normally supply this option. It ensures that the correct files are copied and/or created by the installer for GTK programs to work.
- --name Name
Set the long name of the installer.
If not set, the script tries to invent a suitable name based on the first root file given on the command line.
See also --outfile.
- --outfile myinstaller.exe
Set the output filename for the installer.
If not set, this defaults to "installer.exe".
This is the same as the "OutFile" option to NSIS.
- --installdir 'C:\foo'
Set the default Windows installation directory. If not set, this
program will choose a suitable default based on the name.
In any case, the end user can override this when they run the installer.
Note that since this string will contain backslashes, you should single-quote it to protect it from the shell.
This is the same as the "InstallDir" option to NSIS.
- --installdirregkey 'HKLM SOFTWARE\FOO'
Set the name of the registry key used to save the installation
directory. This has two purposes: Firstly it is used to automagically
remember the installation directory between installs. Secondly your
program can use this as one method to find its own installation
directory (there are other ways to do this).
The default is "HKLM SOFTWARE\Name" where "Name" is derived from the name of the installer.
Note that since this string will contain backslashes and spaces, you should single-quote it to protect it from the shell.
This is the same as the "InstallDirRegKey" option to NSIS.