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.12.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
210
decreased by-13.22%
Maintainers
1
Weekly downloads
 
Created
Source

makensis

npm npm Travis CircleCI David

A Node wrapper for makensis, the compiler for NSIS installers. Supports both, native 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 -t experimental 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';

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

Example usage in script:

import * as makensis from 'makensis';

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

// Asynchronous #1
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}`);
});

// Asynchronous #2
(async () => {
    try {
        let output = await makensis.compile('/path/to/installer.nsi', options);
        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 preExecute / postExecute.

compileSync

Usage: compileSync(script, [options])

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

version

Usage: version([options])

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

versionSync

Usage: versionSync([options])

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

hdrInfo

Usage: hdrInfo([options])

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

hdrInfoSync

Usage: hdrInfoSync([options])

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

cmdHelp

Usage: cmdHelp([command], [options])

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

cmdHelpSync

Usage: cmdHelpSync([command], [options])

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

Options

MakeNSIS

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.

Alias: nocd

noConfig

Type: boolean

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

Alias: noconfig

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.

Alias: inputcharset

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.

Alias: outputcharset

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.

Alias: PPO / safeppo

define

Type: Object

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

Example:

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

Type: Array|string

Prepends script-commands to the script, parameters are processed by order. Equivalent of the -X switch

Example:

preExecute: [
    "SetCompressor lzma",
    "SetCompressorDictSize 16"
]

Alias: execute

postExecute

Type: Array|string

Appends script-commands to the script, parameters are processed by order. Equivalent of the -X switch

Example:

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

Type: boolean

Run makensis on Wine

Spawn
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
json

Type: boolean

Return output from makensis as an object

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 18 Feb 2018

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