Skip to content

negrutiu/nsis-nscurl

Repository files navigation

NScurl (NSIS plugin)

NScurl is a NSIS (Nullsoft Scriptable Install System) plugin with advanced HTTP/HTTPS capabilities.
It's included in the unofficial NSIS fork.

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/2, TLS1.3, etc.
  • Works well on Windows NT4, Windows 11 and everything in between
  • Multi-threaded design to transfer multiple files in parallel
  • Background transfers are available, while your installer performs other installation tasks
  • Multiple attempts to connect and resume failed/dropped transfers
  • Plenty of useful information is available for querying (transfer size, speed, HTTP status, HTTP headers, etc.)
  • Works at any NSIS install stage (in .onInit callback function, in un/install sections, custom pages, silent installers, etc.)
  • Supports custom certificate stores and certificate pinning
  • Supports HTTP and TLS authentication
  • Supports all relevant HTTP methods (GET, POST, PUT, HEAD, etc.)
  • Supports DNS-over-HTTPS secure name resolution
  • Supports custom HTTP headers and data
  • Supports proxy servers (both authenticated and open)
  • Supports files larger than 4GB
  • Can download remote content in-memory instead of a file
  • Works well in 64-bit installers created with this NSIS fork
  • Many more...

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
OpenSSL Apache v2
zlib zlib
zstd BSD3