Skip to content

Getting Started

Marius Negruțiu edited this page May 3, 2024 · 4 revisions

If you're new to NScurl here's how you set it up:

Official NSIS distribution

Download NSIS

Download and install the official NSIS (Nullsoft Scriptable Install System):
https://nsis.sourceforge.io/Download

Note

NSIS generates x86-unicode and x86-ansi installers

Download NScurl

Download and extract the latest NScurl binaries from GitHub:
https://github.com/negrutiu/nsis-nscurl/releases/latest

Example (NSIS official)

Tip

We'll use !AddPluginDir NSIS directive to let the compiler know where to find NScurl

# NScurl demo

Target x86-unicode
;Target x86-ansi
;Target amd64-unicode          ; Not available in official NSIS

!AddPluginDir /x86-unicode     "NScurl\x86-unicode"
!AddPluginDir /x86-ansi        "NScurl\x86-ansi"
!AddPluginDir /amd64-unicode   "NScurl\amd64-unicode"

!include "MUI2.nsh"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Name NScurl-Demo
ShowInstDetails show

Section Download
    DetailPrint 'Downloading...'
    NScurl::http get "https://download.sysinternals.com/files/SysinternalsSuite.zip" "$EXEDIR\SysinternalsSuite.zip" /INSIST /CANCEL /Zone.Identifier /END
    Pop $0
    ${If} $0 == "OK"
        DetailPrint "Download successful"
    ${Else}
        DetailPrint "Download failed with error $0"
    ${EndIf}
SectionEnd

Unofficial NSIS fork

Download NSIS fork

Download and install the NSIS fork from Github:
https://github.com/negrutiu/nsis

Tip

This NSIS fork generates amd64-unicode installers in addition to x86-unicode and x86-ansi
NScurl is already available so there's no need for additional downloads

Caution

This is an unofficial NSIS distro
Despite our best efforts to keep it in-sync with the official repository, it might lag slightly behind

Example (NSIS fork)

# NScurl demo

;Target x86-unicode
;Target x86-ansi
Target amd64-unicode

!include "MUI2.nsh"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

Name NScurl-Demo
ShowInstDetails show

Section Download
    DetailPrint 'Downloading...'
    NScurl::http get "https://download.sysinternals.com/files/SysinternalsSuite.zip" "$EXEDIR\SysinternalsSuite.zip" /INSIST /CANCEL /Zone.Identifier /END
    Pop $0
    ${If} $0 == "OK"
        DetailPrint "Download successful"
    ${Else}
        DetailPrint "Download failed with error $0"
    ${EndIf}
SectionEnd