Skip to content

negrutiu/nsis-nscurl

Repository files navigation

NScurl (NSIS plugin)

NScurl is a NSIS plugin (Nullsoft Scriptable Install System) with advanced HTTP/HTTPS capabilities.
It's implemented in C on top of libcurl with OpenSSL as SSL backend.

License: BSD3 Latest Release Downloads GitHub issues

Features

  • Supports modern protocols and ciphers including HTTP/3, HTTP/2, TLS1.3, etc.
  • Works well on Windows NT4, Windows 11 and everything in between
  • Asynchronous design allowing multiple file transfers to run in parallel
  • Background transfers are available, allowing your installer to perform other tasks concurrently
  • Configurable timeouts and resume strategy for failed transfers
  • Extensive transfer information is available for querying (size, speed, status, headers, etc.)
  • Works at any NSIS install stage (in the .onInit callback function, install/uninstall sections, custom pages, silent installers, etc.)
  • Supports custom certificate stores and certificate pinning
  • Supports HTTP and TLS authentication
  • Supports common HTTP methods (GET, POST, PUT, DELETE, HEAD, etc.)
  • Supports DNS-over-HTTPS secure name resolution
  • Supports custom HTTP headers and request body data
  • Supports both authenticated and unauthenticated proxy servers
  • Supports downloads and uploads of files larger than 4GB
  • Can download remote content in-memory by passing Memory as the destination instead of a file path
  • Works well in amd64 installers created with this NSIS fork

Tip

  • A GitHub Action is available to install/upgrade NSIS plugins (including NScurl) on Windows runners
  • A GitHub Action is available to install/upgrade NSIS compiler on Windows, Linux or macOS runners

Basic usage

Check out the Getting Started wiki page.
Check out the documentation page.
Check out the NSIS test script.

; Quick transfer
NScurl::http GET "https://download.sysinternals.com/files/SysinternalsSuite.zip" "$TEMP\SysinternalsSuite.zip" /INSIST /CANCEL /RESUME /END
Pop $0 ; transfer status ("OK" for success)

; Quick transfer with GET parameters and request headers
NScurl::http GET "https://httpbin.org/get?param1=value1&param2=value2" "$TEMP\httpbin_get.json" /HEADER "Header1: Value1" /HEADER "Header2: Value2" /END
Pop $0

; POST json data
NScurl::http POST "https://httpbin.org/post" Memory /HEADER "Content-Type: application/json" /DATA '{"number_of_the_beast":666}' /END
Pop $0

; POST json data as MIME multi-part form
NScurl::http POST "https://httpbin.org/post" Memory /POST "User" "My user name" /POST "Password" "My password" /POST FILENAME=MyFile.json TYPE=application/json "Details" '{"number_of_the_beast":666}' /END
Pop $0

Licenses

Project License
NScurl itself BSD3
brotli MIT
curl MIT/X inspired
nghttp2 MIT
nghttp3 MIT
ngtcp2 MIT
OpenSSL Apache v2
zlib zlib
zstd BSD3