All Projects → idleberg → node-makensis

idleberg / node-makensis

Licence: MIT license
A Node wrapper for makensis, the NSIS compiler

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to node-makensis

Satysfi Cross Windows
Crosscompiling SATySFi from Ubuntu to Windows
Stars: ✭ 16 (-15.79%)
Mutual labels:  nsis
Electron Builder
A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
Stars: ✭ 11,653 (+61231.58%)
Mutual labels:  nsis
Uget Integrator
Native messaging host to integrate uGet Download Manager with web browsers
Stars: ✭ 253 (+1231.58%)
Mutual labels:  nsis
Verge Core Installers
Verge Core Installers
Stars: ✭ 10 (-47.37%)
Mutual labels:  nsis
Uget Windows Installer
uGet Installer for Windows
Stars: ✭ 96 (+405.26%)
Mutual labels:  nsis
Stitch
Python Remote Administration Tool (RAT)
Stars: ✭ 2,018 (+10521.05%)
Mutual labels:  nsis
Swiftforwindows
Swift for Windows
Stars: ✭ 423 (+2126.32%)
Mutual labels:  nsis
Documentation
A community-driven, Markdown-based documentation for Nullsoft Scriptable Install System (NSIS)
Stars: ✭ 34 (+78.95%)
Mutual labels:  nsis
Electron Builder Binaries
Stars: ✭ 110 (+478.95%)
Mutual labels:  nsis
Qnapi
Qt-based, multi-engine, multi-platform subtitle downloader
Stars: ✭ 226 (+1089.47%)
Mutual labels:  nsis
Openconnect Gui
Mirror - Graphical OpenConnect client (beta phase)
Stars: ✭ 993 (+5126.32%)
Mutual labels:  nsis
Bulk Crap Uninstaller
Remove large amounts of unwanted applications quickly.
Stars: ✭ 1,212 (+6278.95%)
Mutual labels:  nsis
Nsis Ui
NSIS封包exe,牛牛安装包界面美化控件 [nsNiuniuSkin],包含3个实例,后两个是官网的,helloworld那个是根据上面两个例子改的。
Stars: ✭ 168 (+784.21%)
Mutual labels:  nsis
Ultramodernui
The Ultra-Modern User Interface is a new interface with a style like the most recent installers for NSIS 3 (Nullsoft Scriptable Install System), the tool that allows programmers to create such installers for Windows.
Stars: ✭ 25 (+31.58%)
Mutual labels:  nsis
ghidra-nsis-extension
Ghidra extension to disassemble NSIS installers
Stars: ✭ 17 (-10.53%)
Mutual labels:  nsis
Appjs Deskshell
SDK to build desktop apps using HTML5/CSS/JS for frontend and server script for backend
Stars: ✭ 463 (+2336.84%)
Mutual labels:  nsis
Vcl Styles Plugins
Skin plugins for third party installers and apps
Stars: ✭ 131 (+589.47%)
Mutual labels:  nsis
installer
Installer and any other build related script or code
Stars: ✭ 16 (-15.79%)
Mutual labels:  nsis
electron-differential-updater
Differential updater for mac
Stars: ✭ 27 (+42.11%)
Mutual labels:  nsis
Installer
Stars: ✭ 189 (+894.74%)
Mutual labels:  nsis

makensis

npm npm CI Snyk

A Node wrapper for makensis, the compiler for NSIS installers. Supports both, native and Wine.

Prerequisites

Make sure that NSIS is properly installed. If makensis isn't exposed to your PATH environment variable, you need to set pathToMakensis.

Windows

Install NSIS using the Windows Package Manager or Scoop:

# Windows Package Manager
$ winget install NSIS.NSIS

# Scoop
$ scoop install nsis/nsis

Alternatively, you can download the NSIS installer from SourceForge.

Linux

Install NSIS from your distribution's default package manager, for example:

# Debian
$ sudo apt-get install nsis

# Red Hat
$ sudo dnf install nsis

macOS

Install NSIS using Homebrew or MacPorts:

# Homebrew
$ brew install nsis

# MacPorts
$ port install nsis

Installation

yarn add makensis || npm install makensis

Usage

Example usage in script:

import * as NSIS from 'makensis';

const options = {
    verbose: 2,
    define: {
        SPECIAL_BUILD: true
    }
};

// Asynchronous: async/await
try {
    let output = await NSIS.compile('path/to/installer.nsi', options);
    console.log('Compiler output:', output);
} catch (error) {
    console.error(error);
}

// Asynchronous: Promise API
NSIS.compile('path/to/installer.nsi', options)
    .then((output) => {
        console.log('Compiler output:', output);
    })
    .catch((error) => {
        console.error(error);
    });

// Synchronous
let output = NSIS.compile.sync('path/to/installer.nsi', options);
console.log('Compiler output:', output);

API

⚠️ Any of the following API methods is asynchronous. To use their synchronous counterpart, append .sync() to the method name, e.g. compile.sync() instead of compile().

commandHelp

Usage: commandHelp([command], [options], [spawnOptions])

Returns usage information for a specific command, or a list of all commands. Equivalent of the -CMDHELP switch.

compile

Usage: compile(script, [options], [spawnOptions])

Compiles specified script with MakeNSIS. The script can be omitted in favor of the preExecute / postExecute options.

headerInfo

Usage: headerInfo([options], [spawnOptions])

Returns information about which options were used to compile MakeNSIS. Equivalent of the -HDRINFO switch.

license

Usage: license([options], [spawnOptions])

Returns MakeNSIS software license. Equivalent of the -LICENSE switch.

nsisDir

Usage: nsisDir([options], [spawnOptions])

Returns the path of ${NSISDIR}.

version

Usage: version([options], [spawnOptions])

Returns version of MakeNSIS. Equivalent of the -VERSION switch.

Options

⚠️ Some of these options are limited to NSIS v3 (see the changelog for details)

define

Type: Object

Defines symbols for the script [to value]. Equivalent of the -D switch.

Example
define: {
    SPECIAL_BUILD: true,
    LANGUAGE: "English"
}

env

Type: boolean | string

Enables support for special environment variables, that will be passed on to the script as definitions. Can be a path containing .env files or a specific file.

Example
# .env
NSIS_APP_ENVIRONMENT=development
# installer.nsi
!if ${NSIS_APP_ENVIRONMENT} == "development"
    DetailPrint "Valuable Debug Information"
!endif

inputCharset

Type: string

Specifies the codepage for files without a BOM (ACP|OEM|CP#|UTF8|UTF16<LE|BE>). Equivalent of the -INPUTCHARSET switch.

outputCharset

Type: string

Specifies the codepage used by stdout when the output is redirected (ACP|OEM|CP#|UTF8[SIG]|UTF16<LE|BE>[BOM]). Equivalent of the -OUTPUTCHARSET switch.

⚠️ This option is only available on Windows

json

Type: boolean

Returns output from makensis as an object

noCD

Type: boolean

Disables the current directory change to that of the .nsi file. Equivalent of the -NOCD switch.

noConfig

Type: boolean

Disables inclusion of <path to makensis.exe>/nsisconf.nsh. Equivalent of the -NOCONFIG switch.

pathToMakensis

Type: string

Specifies a custom path to makensis

pause

Type: boolean

Pauses after execution. Equivalent of the -PAUSE switch.

priority

Type: integer

Sets the compiler process priority, where the value 5=realtime, 4=high, 3=above normal, 2=normal, 1=below normal, 0=idle. Equivalent of the -P switch.

⚠️ This option is only available on Windows

strict

Type: boolean

Treat warnings as errors. Equivalent of the -WX switch.

ppo / safePPO

Type: boolean

Will only run the preprocessor and print the result to stdout. The safe version will not execute instructions like !appendfile or !system. !packhdr and !finalize are never executed. Equivalent of the -PPO / SAFEPPO switches.

preExecute

Type: string | string[]

Prepends script-commands to the script, can be passed as array or multiline-string. Equivalent of the -X switch when used before passing a script.

Example
preExecute: [
    'SetCompressor lzma',
    'SetCompressorDictSize 16'
];

postExecute

Type: string | string[]

Appends commands to the script, can be passed as array or multiline-script. Equivalent of the -X switch when used after passing a script.

Example
postExecute: [`!echo "That's all Folks!"`];

rawArguments

Type: string[]

Specifies raw arguments for makensis.

⚠️ These will be added to the compiler arguments last and will hence overwrite any of the NSIS options above!

verbose

Type: integer

Verbosity where the value 4=all, 3=no script,2=no info, 1=no warnings, 0=none. Equivalent of the -V switch.

Wine Options

Environmental variables allow for Wine to be configured by the user. These can be specified using the spawnOptions.env property. See the documentation for details.

On top of that, the following options for Wine are available.

wine

Type: boolean

Runs makensis on Wine

pathToWine

Type: string

Specifies a custom path to wine, useful when working with wine32 or wine32on64.

Events

This module emits three types of events you can hook into using the on() and once() methods:

stdout

Gives access to an object containing the current line, and whether it contains a warning of the path of the outfile.

stderr

Gives access to an object containing the current line.

exit

Gives access to an object containing the exit code, the full stdout and stderr, and the number of warnings.

Related

License

This work is licensed under The MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].