Nullsoft Scriptable Install System
   HOME

TheInfoList



OR:

Nullsoft Scriptable Install System (NSIS) is a script-driven
installer Installation (or setup) of a computer program (including device drivers and plugins), is the act of making the program ready for execution. Installation refers to the particular configuration of a software or hardware with a view to making it us ...
authoring tool for Microsoft Windows backed by Nullsoft, the creators of
Winamp Winamp is a media player for Microsoft Windows originally developed by Justin Frankel and Dmitry Boldyrev by their company Nullsoft, which they later sold to AOL in 1999 for $80 million. It was then acquired by Radionomy in 2014. Sinc ...
. NSIS is released under a combination of
free software licenses A free-software license is a notice that grants the recipient of a piece of software extensive rights to modify and redistribute that software. These actions are usually prohibited by copyright law, but the rights-holder (usually the author) ...
, primarily the zlib license. It has become a widely used alternative to
commercial Commercial may refer to: * a dose of advertising conveyed through media (such as - for example - radio or television) ** Radio advertisement ** Television advertisement * (adjective for:) commerce, a system of voluntary exchange of products and s ...
proprietary products like InstallShield, with users including
Amazon Amazon most often refers to: * Amazons, a tribe of female warriors in Greek mythology * Amazon rainforest, a rainforest covering most of the Amazon basin * Amazon River, in South America * Amazon (company), an American multinational technolog ...
,
Dropbox Dropbox is a file hosting service operated by the American company Dropbox, Inc., headquartered in San Francisco, California, U.S. that offers cloud storage, file synchronization, personal cloud, and client software. Dropbox was founded in 2007 ...
,
Google Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
,
Ubisoft Ubisoft Entertainment SA (; ; formerly Ubi Soft Entertainment SA) is a French video game publisher headquartered in Saint-Mandé with development studios across the world. Its video game franchises include '' Assassin's Creed'', ''Far Cry'', ...
, FL Studio, BitTorrent, and
McAfee McAfee Corp. ( ), formerly known as McAfee Associates, Inc. from 1987 to 1997 and 2004 to 2014, Network Associates Inc. from 1997 to 2004, and Intel Security Group from 2014 to 2017, is an American global computer security software company head ...
.


History

NSIS was created to distribute
Winamp Winamp is a media player for Microsoft Windows originally developed by Justin Frankel and Dmitry Boldyrev by their company Nullsoft, which they later sold to AOL in 1999 for $80 million. It was then acquired by Radionomy in 2014. Sinc ...
. It is based on a previous Nullsoft product, PiMP (plugin Mini Packager), and is also known as SuperPiMP. After
version Version may refer to: Computing * Software version, a set of numbers that identify a unique evolution of a computer program * VERSION (CONFIG.SYS directive), a configuration directive in FreeDOS Music * Cover version * Dub version * Remix * ''Ve ...
2.0a0, the project was moved to
SourceForge SourceForge is a web service that offers software consumers a centralized online location to control and manage open-source software projects and research business software. It provides source code repository hosting, bug tracking, mirroring ...
where developers outside Nullsoft started working on it on a regular basis. NSIS 2.0 was released approximately two years later. NSIS version 1 is in many ways similar to the classic
Windows Installer Windows Installer (msiexec.exe, previously known as Microsoft Installer, codename Darwin) is a software component and application programming interface (API) of Microsoft Windows used for the installation, maintenance, and removal of software. ...
, but it supports more compression formats. NSIS version 2 features a new streamlined
graphical user interface The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inst ...
and supports LZMA compression, multiple languages, and an easy-to-use plugin system. In January 2006 NSIS was SourceForge's project of the month.


Script examples


Hello world!

!include "MUI.nsh" !insertmacro MUI_LANGUAGE "English" Name "Hello world!" # Name of the installer. OutFile "HelloWorld.exe" # Name of the installer's file. Function .onInit # Function that will be executed on installer's start up. MessageBox MB_OK, MB_ICONINFORMATION "Hello world!" # Show a message that says "Hello world!". Quit # Close the installer because this is a simple "Hello world!" installer. FunctionEnd Section # Useless section because this is a simple "Hello world!" installer. SectionEnd


Simple installer

!include "MUI.nsh" !define MUI_ABORTWARNING # This will warn the user if they exit from the installer. !insertmacro MUI_PAGE_WELCOME # Welcome to the installer page. !insertmacro MUI_PAGE_DIRECTORY # In which folder install page. !insertmacro MUI_PAGE_INSTFILES # Installing page. !insertmacro MUI_PAGE_FINISH # Finished installation page. !insertmacro MUI_LANGUAGE "English" Name "MyApp" # Name of the installer (usually the name of the application to install). OutFile "MyAppInstaller.exe" # Name of the installer's file. InstallDir "$PROGRAMFILES\MyApp" # Default installing folder ($PROGRAMFILES is Program Files folder). ShowInstDetails show # This will always show the installation details. Section "MyApp" # In this section add your files or your folders. # Add your files with "File (Name of the file)", example: "File "$DESKTOP\MyApp.exe"" ($DESKTOP is Desktop folder); or add your folders always with "File (Name of the folder)\*", always add your folders with an asterisk, example: "File /r $DESKTOP\MyApp\*" (this will add its files and (with /r its subfolders)). SectionEnd


Simple installer that adds a shortcut in the start menu and comes with an uninstaller

# define name of installer OutFile "InstallMyApp" # define installation directory InstallDir $LOCALAPPDATA\Programs\myapp # For removing Start Menu shortcut in Windows 7 RequestExecutionLevel user # start default section Section # set the installation directory as the destination for the following actions SetOutPath $INSTDIR # create the uninstaller WriteUninstaller "$INSTDIR\uninstall.exe" # point the new shortcut at the program uninstaller CreateShortcut "$SMPROGRAMS\My App.lnk" "$INSTDIR\myapp.exe" CreateShortcut "$SMPROGRAMS\My App Uninstall.lnk" "$INSTDIR\uninstall.exe" File /r "C:\path\to\where\my\files\are\*" SectionEnd # uninstaller section start Section "uninstall" # first, delete the uninstaller Delete "$INSTDIR\uninstall.exe" # second, remove the link from the start menu Delete "$SMPROGRAMS\My App.lnk" Delete "$SMPROGRAMS\My App Uninstall.lnk" Delete $INSTDIR # uninstaller section end SectionEnd


Concepts


Script

The NSIS compiler program ''makensis'' compiles scripts like the following example into executable installation programs. Each line in the script contains a single command. # Example script Name "Example1" OutFile "jubaowu.exe" InstallDir "$PROGRAMFILES\Example1" Page Directory Page InstFiles Section SetOutPath $INSTDIR File ..\makensis.exe SectionEnd


Modern user interface

Version 2.0 introduced a new optional streamlined graphical user interface called ''Modern UI'' (MUI). The MUI has a wizard-like interface. It supports a welcome page, finish page, language selection dialog, description area for components, and greater customization options than the old user interface. # Modern UI example script !include MUI.nsh Name "Example 2" OutFile "Example2.exe" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "license.rtf" !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "French" Section "Extract makensis" SetOutPath $INSTDIR File ..\makensis.exe SectionEnd Since NSIS version 2.30 (Released on 25 August 2007) there is new version (beta) of this UI accessible: Modern UI 2 (MUI2) which is an enhancement to Modern UI. Unlike the old MUI this version is based on nsDialogs instead of old-fashioned InstallOptions .ini files. From version 2.34 (Released on 24 December 2007) this MUI2 is ready for mass consumption and it is included in all NSIS packages. Also all examples had been switched to it. Modern UI 2 documentation.


Graphical interfaces

NSIS projects can be configured by simply editing text files (with .nsi extension). However, several third parties provide editing software: * EclipseNSIS is a module for the Eclipse platform. It allows NSIS scripts to be edited, compiled and validated. * HM NIS Edit (freeware) editor with support of custom
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
or Delphi plug-ins. * Venis (freeware) editor * Visual & Installer is an add-in which integrates NSIS with Microsoft Visual Studio IDE and allows to create and build NSIS projects right within it.


Installer interfaces

Several projects that extend or replace the Modern UI have started in the past few years. Interfaces such as the ExperienceUI and UltraModernUI completely change the style of the installer by skinning it to look like the InstallShield interface. Other interfaces like installSpiderUI aim for a more minimalistic approach on the visual side of things while maintaining the same level of functionality as the ASD.


Plugins

NSIS can be extended with plugins that can communicate with the installer. Plugins can be written in any unmanaged programming language capable of building a dynamic-link library (such as C, C++ or Delphi), and they can be used to perform installation tasks or extend the installer interface. A plugin can be called with a single line of NSIS code. Several plugins come with the NSIS package that permit the installer to display a splash screen, display a custom page, display an image on the background, download files from a website, perform mathematical operations, patch files and more. Other plugins are available online, including ZipDLL, and a
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
plugin.


Features

NSIS supports the following features: * zlib, bzip2, and LZMA compression *Script-based *Multilingual * Plugin support *Script
preprocessor In computer science, a preprocessor (or precompiler) is a program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which is often used by so ...


Generated installer

The generated installer is a
Portable Executable The Portable Executable (PE) format is a file format for executables, object code, DLLs and others used in 32-bit and 64-bit versions of Windows operating systems. The PE format is a data structure that encapsulates the information necessary fo ...
, with the installation files archived within the installer, a 34 KB overhead for the NSIS installer, and the installation script compiled into executable code. As the installation script is compiled, the script cannot be obtained from the delivered executable without reverse-engineering the binary. The archive may be unpacked using
7-Zip 7-Zip is a free and open-source file archiver, a utility used to place groups of files within compressed containers known as "archives". It is developed by Igor Pavlov and was first released in 1999. 7-Zip has its own archive format called 7z, ...
, the
Total Commander __NOTOC__ Total Commander (formerly Windows Commander) is a shareware orthodox file manager for Windows, Windows Phone, Windows Mobile/Windows CE and Android, developed by Christian Ghisler. Originally coded using Delphi, latest Windows 64-b ...
plugin InstallExplorer, or the
FAR Manager Far Manager (short for ''File and ARchive Manager'') is an orthodox file manager for Microsoft Windows and is a clone of Norton Commander. Far Manager uses the Win32 console and has a keyboard-oriented user interface (although limited mouse o ...
plugin InstallExplorer. The archive contains several folders: * $PLUGINSDIR : installation routine plugins * $INSTDIR : files used during the installation * $_OUTDIR : files to be installed. The generated installer includes command line arguments in order to give users more control: * /NCRC disables the CRC check, unless the script forces it * /S runs the installer/uninstaller silently. * /D sets the default installation directory. It must be the last parameter and must not contain any quotes. Only absolute paths are supported.


Unicode support

Versions of NSIS before 3.0 did not support Unicode, but only a means to convert some files to different encodings via a plugin. However, a variant of NSIS that has full Unicode support is available. Notable projects using this variant are: *
Google Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
(
Picasa Picasa was a cross-platform image organizer and image viewer for organizing and editing digital photos, integrated with a now defunct photo-sharing website, originally created by a company named Lifescape (which at that time was incubated by ...
) *
Apache OpenOffice Apache OpenOffice (AOO) is an open-source office productivity software suite. It is one of the successor projects of OpenOffice.org and the designated successor of IBM Lotus Symphony. It is a close cousin of LibreOffice, Collabora Online and ...
for Windows *
Mozilla Mozilla (stylized as moz://a) is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, spreads and supports Mozilla products, thereby promoting exclusively free software and open standards, w ...
(
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements current ...
,
Mozilla Thunderbird Mozilla Thunderbird is a free and open-source cross-platform email client, personal information manager, news client, RSS and chat client developed by the Mozilla Foundation and operated by subsidiary MZLA Technologies Corporation. The projec ...
) * FileZilla *
Winamp Winamp is a media player for Microsoft Windows originally developed by Justin Frankel and Dmitry Boldyrev by their company Nullsoft, which they later sold to AOL in 1999 for $80 million. It was then acquired by Radionomy in 2014. Sinc ...
*
Flickr Flickr ( ; ) is an American image hosting and video hosting service, as well as an online community, founded in Canada and headquartered in the United States. It was created by Ludicorp in 2004 and was a popular way for amateur and profession ...
*
PortableApps.com PortableApps.com is a website offering free applications for Windows that have been specially packaged for portability. These portable applications are intended to be used from removable media such as USB flash drives. User data is stored in a ...
*
Second Life ''Second Life'' is an online multimedia platform that allows people to create an avatar for themselves and then interact with other users and user created content within a multi player online virtual world. Developed and owned by the San Fra ...
* Xampp * CherryPlayer * AVG * TeamViewer With the release of version 3.0 of NSIS, Unicode support can be implemented using the compiler directive "Unicode true". This gives full Unicode support with no further code changes, but the installer will not run under Windows 95/98/Me. As of 2016 before the 3.0 release NSIS was available in the
PortableApps PortableApps.com is a website offering free applications for Windows that have been specially packaged for portability. These portable applications are intended to be used from removable media such as USB flash drives. User data is stored in a s ...
format for Unicode 2.46.5 Rev 3 and ANSI 2.51.


See also

* List of installation software


References


External links

* * *{{openhub, nsis, NSIS
Unofficial 64-bit builds
Free installation software Free software programmed in C Free software programmed in C++ Portable software Software using the zlib license Utilities for Windows