Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

makensis

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makensis

A Node wrapper for makensis, the NSIS compiler

  • 0.8.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

makensis

npm npm Travis David David

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

Prerequisites

Make sure that NSIS is properly installed with makensis in your PATH environmental variable.

On non-Windows platforms, you can usually install NSIS with your package manager:

# Debian
sudo apt-get install nsis

# Red Hat
sudo dnf install nsis

# Homebrew
brew install nsis

# MacPorts
port install nsis

Alternatively, you can setup NSIS in your Wine environment. Keep in mind that Wine writes standard streams while running makensis, so additional parsing of the compiler output might be necessary.

Installation

yarn add makensis || npm install makensis

Usage

Use ES6 imports or require() to include the module:

// ECMAScript Import
import * as makensis from 'makensis';

// Node Require
const makensis = require('makensis');

Example usage in script:

import * as makensis from 'makensis';

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

// Asynchronous
makensis.compile('/path/to/installer.nsi', options)
.then(output => {
    console.log('Standard output:\n' + output.stdout);
}).catch(output => {
    console.error(`Exit Code ${output.status}: ${output.stderr}`);
});

// Synchronous
let output = makensis.compileSync('/path/to/installer.nsi', options);

if (output.status === 0) {
    console.log('Standard output:\n' + output.stdout);
} else {
    console.error(`Exit Code ${output.status}: ${output.stderr}`);
}

Methods

compile

Usage: compile(script, [options])

Compiles specified script with MakeNSIS. The script can be omitted in favor of execute.

compileSync

Usage: compileSync(script, [options])

Compiles specified script with MakeNSIS. The script can be omitted in favor of execute.

version

Usage: version()

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

versionSync

Usage: versionSync()

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

hdrinfo

Usage: hdrInfo()

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

hdrInfoSync

Usage: hdrInfoSync()

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

cmdHelp

Usage: cmdHelp([command])

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

cmdHelpSync

Usage: cmdHelpSync([command])

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

MakeNSIS Options

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

verbose

Type: integer

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

pause

Type: boolean

Pauses after execution. Equivalent of the -PAUSE switch.

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.

inputCharset

Type: string

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

outputCharset

Type: string

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

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.

define

Type: Object

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

Example:

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

Type: Array

Executes script-commands in the script, parameters are processed by order. Equivalent of the -X switch

Example:

execute: [
    "SetCompressor lzma",
    "SetCompressorDictSize 16"
]
wine

Type: boolean

Run makensis on Wine

Spawn Options

cwd

Type: string

Current working directory of the child process

detached

Type: boolean

Prepare child to run independently of its parent process. Specific behavior depends on the platform, see options.detached.

shell

Type: boolean|string

If true, runs command inside of a shell. Uses /bin/sh on UNIX, and process.env.ComSpec on Windows. A different shell can be specified as a string. See Shell Requirements and Default Windows Shell.

Other Options

pathToMakensis

Type: string

Specifies a custom path to makensis

License

This work is licensed under The MIT License

Donate

You are welcome support this project using Flattr or Bitcoin 17CXJuPsmhuTzFV2k4RKYwpEHVjskJktRd

Keywords

FAQs

Package last updated on 22 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc