Skip to content

negrutiu/nsis-install

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub action negrutiu/nsis-install

Static Badge

This GitHub action installs or upgrades the NSIS compiler (Nullsoft Scriptable Install System) on GitHub Windows runners.

You can choose between two NSIS distributions:

Compared to the official NSIS releases, the negrutiu-NSIS fork can build native amd64 installers and comes with some useful plugins pre-installed.

This GitHub action downloads and installs the latest build of the selected distribution. If NSIS is already installed, it will be upgraded to the latest version.

Warning

This action only works on Windows runners.

Action Inputs

distro

NSIS distribution to install:

Default is negrutiu

arch

NSIS compiler architecture to install:

  • x86, Win32, i[2-6]86 - Available in all distros
  • amd64, x64, x86(-|_)64 - Only available in the negrutiu distro

All values are internally normalized to x86 or amd64
Default is x86 which will replace the official NSIS installation that is pre-installed on GitHub Windows runners. If you opt for the negrutiu distro, both x86 and amd64 compilers can build both x86 and amd64 installers.

Important

arm64 is not supported.

install-dir

Custom directory to install NSIS to.

Defaults to %ProgramFiles%\NSIS or %ProgramFiles(x86)%\NSIS depending on the architecture.

Note

If the specified directory is invalid (e.g., due to insufficient permissions, a non-existent drive, or other filesystem errors), the installer will fall back to the default location. You can check the action output instdir to see the actual installation directory.

register-path

Adds NSIS install directory to the system PATH environment variable.

Defaults to true.

Action Outputs

instdir

Installation directory (e.g. C:\Program Files (x86)\NSIS)

version

Installed NSIS version (e.g. 1.2.3.4)

arch

Installed NSIS architecture (x86 or amd64)

Usage

Basic

jobs:
  build:
    runs-on: windows-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Install NSIS
      uses: negrutiu/nsis-install@v2

    - name: Build installer
      run: makensis my_installer.nsi

Read Outputs

You can use action outputs to get installation details.
First thing, give an id to the action step...

jobs:
  build:
    runs-on: windows-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Install NSIS
      id: nsis
      uses: negrutiu/nsis-install@v2

    - name: Show NSIS info
      run: |
        echo "NSIS dir: ${{ steps.nsis.outputs.instdir }}"
        echo "NSIS version: ${{ steps.nsis.outputs.version }}"
        echo "NSIS arch: ${{ steps.nsis.outputs.arch }}"

    - name: Build installer
      run: makensis my_installer.nsi

Native amd64 Installers

To build for amd64, use Target amd64-unicode directive in your NSIS script.

; --------------------
; my_installer.nsi
; --------------------

!define /ifndef ARCH "x86"
Target "${ARCH}-unicode"  ; possible values: amd64-unicode, x86-unicode, x86-ansi

OutFile "my_installer_${ARCH}.exe"

; [...]

In your workflow, use -D makensis option to define the ARCH variable.

jobs:
  build:
    runs-on: windows-latest
    steps:
    - Name: Checkout code
      uses: actions/checkout@v4

    - name: Install NSIS
      uses: negrutiu/nsis-install@v2

    - name: Build x86 installer
      run: makensis -DARCH=x86 my_installer.nsi

    - name: Build amd64 installer
      run: makensis -DARCH=amd64 my_installer.nsi

Related topics

About

Install NSIS in GitHub runners

Resources

License

Stars

Watchers

Forks

Languages