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
5
votes
2 answers

NSIS - Delete all files except one file

Could any one clarify me that, when uninstalling I need to delete everything form the Installation folder except the License file. How can I do it with NSIS scripting? Thanks Regards, RoboAlex.
RoboAlex
  • 4,895
  • 6
  • 31
  • 37
5
votes
1 answer

Version comparison in NSIS installer

I have to compare the versions of current file and already the installed in NSIS installer. I understand the version numbers are in string but I read at couple of places that the NSIS automaticaly converts the strings to intergers if needed in logic…
skm
  • 5,015
  • 8
  • 43
  • 104
5
votes
3 answers

Installer which chooses the MSI based on the CPU architecture (x86 32-bit, x64 64-bit, etc)

I have an installer (Visual Studio setup project) which uses DIFxApp and an Orca transform to install drivers. The problem is that there are two DIFxApp merge modules - one for x86 and one for x64. If I reference both of them, the installation only…
Pat
  • 16,515
  • 15
  • 95
  • 114
5
votes
1 answer

How does NSIS set section's size requirement automatically?

We have an installer with multiple components that each has their own section. I'm trying to find out how our existing code actually sets the size of each section. We have 3 components that if checked/unchecked will update the "Space required" value…
SpartaSixZero
  • 2,183
  • 5
  • 27
  • 46
5
votes
2 answers

How to Install an NSIS Executable Silently For All Users

I have an NSIS installer executable which I would like to install silently for all users. I know I can pass the /S argument to do a silent install. The problem is that the default option for the installer is to install only for the current user. How…
5
votes
1 answer

NSIS section sizes doubled due to use of SetOverwrite

I've inherited an installer script, and I'm annoyed by it claiming to require twice as much space as it actually needs. I found that this was due to how each section is using SetOverwrite (because they're re-used for a repair install?). I…
tomlogic
  • 11,489
  • 3
  • 33
  • 59
5
votes
2 answers

How to compare two variables using If Else in NSIS?

Var first Var second Section Strcpy $first "1.0" Strcpy $Second "2.1" ${If} $second > $first MessageBox MB_OK "Grater" ${Else} MessageBox MB_OK "Smaller" ${EndIf} SectionEnd I have written the above code but it is showing…
Vishal Patil
  • 195
  • 2
  • 13
5
votes
1 answer

Detect if Visual C++ Redistributable for Visual Studio 2013 is installed

How to detect if Visual C++ Redistributable for Visual Studio 2013 is installed? I'm using Nullsoft NSIS Installer System but only I need Windows Registry entry I have googled, and looked at other StackOverflow questions. In particular, this Detect…
Ivan Rodriguez
  • 426
  • 4
  • 14
5
votes
2 answers

How to read a command line parameter given to an uninstaller?

Using NSIS, how can I read a (optional) command-line parameter provided to an uninstaller? I don't need to read it by name-- just reading the first parameter given could be enough.
Cuga
  • 17,668
  • 31
  • 111
  • 166
5
votes
1 answer

NSIS Registry Plugin not found

When compiling an NSIS script, whenever I invoke registry (or time) macros contained in the Registry.nsh and Time.nsh plugins, I get an error. The command I run is something like: ${registry::Open} "[fullpath]" "[Options]" $var And the error I get…
hermeneutics
  • 97
  • 2
  • 7
5
votes
3 answers

Make Windows refresh icon cache

I really liked the oxygen appearance of KDE SC 4. I wrote a program to apply these icons to windows. The program is written in NSIS, and is currently nearly fully functional. However, the only way I found to make Windows aware of the icon changes is…
Sudarshan S
  • 1,235
  • 2
  • 16
  • 25
5
votes
3 answers

Passing arguments to java vm from NSIS script

I'm developing my first java application using Eclipse. I've recently needed to adjust the amount of memory allocated by passing -Xmx256M to the JVM. The application is currently package up as a runnable jar and installed using the NSIS. I'm having…
CodeBuddy
  • 5,749
  • 1
  • 25
  • 30
5
votes
1 answer

How to create an Admin shortcut with NSIS?

I have an NSIS script that works great, and creates Start menu shortcuts, one of which points to a batch file. The issue is the user will have to right-click and Run as Administrator or it will fail. Is there a way to create the shortcut to Run as…
codemonkey
  • 203
  • 2
  • 12
5
votes
6 answers

Can .bat file execute an sql query and return a value?

How can I call a query from a .bat file? (say my query is: select version from system). Can my .bat file save the output that this query returns? I wanna use this output in my NSIS script.
Pia
  • 463
  • 2
  • 9
  • 20
5
votes
2 answers

How can I use variable on NSIS include / to get another variable

Is there anyway to include file by mention it with variable? I mean StrCpy $1 "bla.nsh" !include $1 ? or maybe getting value of variable that called by another variable such as: StrCpy $1 "EN" StrCpy $2 ${LANG_${1}_WELCOME_MESSAGE} ? Thanks.
user2269104
  • 207
  • 2
  • 7