Getting Started - negrutiu/nsis-nscurl GitHub Wiki
If you're new to NScurl
here's how you set it up:
-
Use the official NSIS distribution
- Download NSIS
- Download NScurl binaries
- First script
-
Use the unofficial NSIS fork (supports native
amd64
installers)
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
andx86-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 findNScurl
# 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 tox86-unicode
andx86-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