NSISDependencyInstaller

NSIS Dependency Installer

Nullsoft Scriptable Install System (NSIS) Dependency Installer Can Download And Install Any Dependency Such As .NET, Visual C++ Or SQL Server During Your Application’s Installation. In Addition, It Is Easy To Add Your Own Dependencies As Well.

Installation And Usage

  1. Download And Install NSIS 3.11+.
  2. Download This Repository Or Clone It git clone https://github.com/rc-chuah/NSISDependencyInstaller.
  3. Open The Extracted ExampleSetup.nsi File.
  4. Comment Out Dependency Macro Calls Inside .onInit Function To Disable Installing Them:
     !insertmacro Dependency_AddVC2013 ; Installed In Example Setup
     ;!insertmacro Dependency_AddVC2013 ; Commented Out And Not Installed In Example Setup
    
  5. Modify Other Sections Like [MainSection] [-AdditionalIcons] [-Post] [Uninstall] As Necessary.
  6. Build The Setup Using Nullsoft Scriptable Install System (NSIS) Compiler.

Integration

You Can Also Just Include CodeDependencies.nsh File Into Your Setup And Call The Desired Dependency_Add Macros (Some May Need Defining Their Exe File Path Before The Include):

!include "CodeDependencies.nsh"

; Define ...

Function .onInit
  ; Add The Dependencies You Need
  !insertmacro Dependency_AddDotNet90
  ; ...
FunctionEnd

; Section ...

Details

You Have Two Ways To Distribute The Dependency Installers. By Default, Most Dependencies Will Be Downloaded From The Official Website. Another Way Is To Pack The Dependency Into A Single Executable Setup Like So:

The Dependencies Are Installed Based On The System Architecture. If You Want To Install 32-Bit Dependencies On A 64-Bit System You Can Force 32-Bit Mode Like So:

!insertmacro Dependency_ForceX86 True ; Force 32-Bit Install Of Next Dependencies
!insertmacro Dependency_AddVC2013
!insertmacro Dependency_ForceX86 False ; Disable Forced 32-Bit Install Again

If You Only Deploy 32-Bit Binaries And Dependencies You Can Also Instead Just Not Define [${If} ${IsNativeARM64} ${ElseIf} ${RunningX64} ${Else} ${EndIf}], [${If} ${IsNativeARM64} ${ElseIf} ${IsNativeAMD64} ${ElseIf} ${IsNativeIA32} ${Else} Abort “Unsupported CPU Architecture!” ${EndIf}], [${If} ${RunningX64} ${Else} ${EndIf}], [SetRegView 64], [SetRegView 32], [${DisableX64FSRedirection}], [${EnableX64FSRedirection}] And [${IsWow64}] In [MainSection], [-AdditionalIcons], [-Post] And [Uninstall] Sections.

Dependencies

Credits

Thanks To The Community For Sharing Many Fixes And Improvements. To Contribute Please Create A Pull Request.

License

The Universal Permissive License (UPL) 1.0