Skip to content

Getting Started

Marius Negruțiu edited this page May 12, 2021 · 4 revisions

Getting Started

This wiki page explains the first steps you need to take to use NScurl extension in your installers.

You probably work with the official NSIS distribution, in which case you can jump to the first section.
In case you're using an unofficial NSIS fork, skip to the second section.


Example:

Target x86-unicode
;Target x86-ansi

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

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

!insertmacro MUI_LANGUAGE "English"

Name NScurl-Test
ShowInstDetails show

Section Download
  DetailPrint 'Downloading...'
  NScurl::http get "http://live.sysinternals.com/Files/SysinternalsSuite.zip" "$EXEDIR\_SysinternalsSuiteLive.zip" /CANCEL /INSIST /Zone.Identifier /END
  Pop $0
  DetailPrint "Status: $0"
SectionEnd

  • Download and install the unofficial Negruțiu's NSIS fork
    • It already includes NScurl plugin
    • In addition, this NSIS fork allows you to build native amd64 installers, so the NScurl amd64-unicode binary comes in handy...
    • You don't need to include anything, just start making NScurl calls

Example:

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

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

!insertmacro MUI_LANGUAGE "English"

Name NScurl-Test
ShowInstDetails show

Section Download
  DetailPrint 'Downloading...'
  NScurl::http get "http://live.sysinternals.com/Files/SysinternalsSuite.zip" "$EXEDIR\_SysinternalsSuiteLive.zip" /CANCEL /INSIST /Zone.Identifier /END
  Pop $0
  DetailPrint "Status: $0"
SectionEnd
Clone this wiki locally