Questions tagged [nsis]

This tag is used for questions about the open source Nullsoft Scriptable Install System (NSIS) setup generator.

Details

Being a user's first experience with your product, a stable and reliable installer is an important component of succesful software. With NSIS you can create such installers that are capable of doing everything that is needed to setup your software.

NSIS is script-based and allows you to create the logic to handle even the most complex installation tasks. Many plug-ins and scripts are already available: you can create web installers, communicate with Windows and other software components, install or update shared components and more

Getting Started

IDE

Plugins

NSIS comes with a variety of plugins

Plugins are usually one .dll file and an .nsh file. To Install Plugins you need to copy the dll to C:\Program Files\NSIS\Plugins and the nsh file to C:\Program Files\NSIS\Include
See : How do I install a Plugin

Useful Plugins

Tips

  1. You can use the the LogicLib which comes as part of the installation to use if conditions in your script (this is not directly available). All you need to do is:

    !include 'LogicLib.nsh'
    

    And then:

    # ...
    ${If} $0 == "hello"
        DetailPrint "world"
    ${Endif}
    

    See this for details.

2580 questions
7
votes
1 answer

Execute a Execwait in NSIS with administrative privileges

I want to execute ExecWait in NSIS with admin privileges, I was unable to find any documentation on this issue.
rajat
  • 3,415
  • 15
  • 56
  • 90
6
votes
1 answer

How to show details by default with NSIS installer

With NSIS a basic build will have a "Show Details" button which will show the installer script messages. Is there a way to make this the default such that the user does not have to click "Show Details"?
Russell Steen
  • 6,494
  • 6
  • 38
  • 56
6
votes
1 answer

Having InstallDir within IF ELSE block

I try to have the following code from ; The default installation directory InstallDir $PROGRAMFILES\${PRODUCT_NAME} to !include x64.nsh ${If} ${RunningX64} ; The default installation directory InstallDir…
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
6
votes
2 answers

Why does VIProductVersion argument override value of ProductVersion key?

Code snippet from the nsi script: VIProductVersion 1.2.0.0 VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion 1.1.0.0 I want to set FileVersion to 1.1.0.0 but in file properties it is set to 1.2.0.0. I also noticed that VIProductVersion executed…
Bojan Komazec
  • 9,216
  • 2
  • 41
  • 51
6
votes
3 answers

How to Install the Visual C++ Redist Using NSIS

My C++ application needs to install the Visual Studio C++ redistributable. I'm using Visual Studio 2019 Community edition. I use NSIS (version 3.04) to create my install program. Should I try to detect if the redist is installed and only install it…
gdunbar
  • 571
  • 4
  • 11
6
votes
4 answers

NSIS - Merge Modules

I'm looking for away to include into the installation the merge modules of VC2008 (mscrt90 and atl90) My main problem involved around bundling the policy file. I've no problem adding the DLL and the manifest files but the policy seems to behave…
Eden
  • 3,696
  • 2
  • 24
  • 24
6
votes
2 answers

LANG_ENGLISH undefined for MUI when compiling with NSIS 3.0

I just upgraded from NSIS 2.51 to NSIS 3.0, mainly because the new version supports Windows 10. For my installer I'm using the Modern User Interface (MUI). I make use of some custom pages. According to the documentation, I'm using the…
honk
  • 9,137
  • 11
  • 75
  • 83
6
votes
4 answers

Installing a driver via pnputil

I'm trying to install an .inf file via NSIS like (Installing a driver in NSIS script). Installation itself works smooth, but Windows installs the driver with its internal published name (an incrementing number oemxxx.inf). How can I get pnputil.exe…
machine
  • 295
  • 2
  • 3
  • 12
6
votes
2 answers

Copy Files in NSIS

I am using the following command to copy files. After setting output path... File "Documents\*" This action works flawlessly. There are no issues coping the files in the Documents directory until... if there is a copy of an existing file (with a…
Silly Rabbit
  • 308
  • 2
  • 4
  • 11
6
votes
2 answers

Is there a way to pretty format or beautify NSIS script source code?

I've got an NSIS script that is a couple thousand lines and not properly indented making the script difficult to read. Is there a way to format NSIS script or at the minimum be able to indent the Ifs and Endifs sections? There's plenty of online…
Joshua
  • 1,709
  • 2
  • 24
  • 38
6
votes
4 answers

NSIS multiple if conditions

Can I implement the following C code inside NSIS script? C code if ( (value1 == 1) && ((value2 == "text") || (value3 >= 100)) ) //Do something NSIS code ${If} $value2 == "text" ${OrIf} $value3 >= 100 But I don't think on the above condition I…
hypheni
  • 756
  • 3
  • 17
  • 37
6
votes
1 answer

Deploying Excel Add-In using NSIS - Registry issue

I created a test project in VS 2012 file -> new -> project -> Other Languages -> Visual C# -> Office -> 2010 which builds fine. I would like to deploy this on client machines, looking on the MSDN website I have 2 options, clickonce or…
cool mr croc
  • 725
  • 1
  • 13
  • 33
6
votes
2 answers

How to set an Icon in NSIS install (CMake)

The documentation for CPACK_PACKAGE_ICON is very limited on cmake wiki page. The following is not working for me (as per): set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/images/MyIcon.bmp") include(CPack) It leads to: File:…
malat
  • 12,152
  • 13
  • 89
  • 158
6
votes
4 answers

Creating an empty directory (NSIS)

How can I do it by NSIS 2.46? I know this is probably a dumb question, but how the heck do I create an empty directory and check for errors? I do so: ClearErrors CreateDirectory $R1 ${If} ${Errors} DetailPrint "failed" MessageBox…
6
votes
2 answers

NSIS Installer - Displaying different licences

I'm trying to modify an existing NSIS install script to allow for different licence files to be presented to the user depending on whether they are a new or existing user. I have pre-existing code which detects an existing install in the .onInit…
Wysawyg
  • 712
  • 8
  • 22