
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A Node wrapper for makensis
, the compiler for NSIS installers. Supports both, native and Wine.
Make sure that NSIS is properly installed. If makensis
isn't exposed to your PATH environment variable, you need to set pathToMakensis
.
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.
Install NSIS from your distribution's default package manager, for example:
# Debian
$ sudo apt-get install nsis
# Red Hat
$ sudo dnf install nsis
Install NSIS using Homebrew or MacPorts:
# Homebrew
$ brew install nsis
# MacPorts
$ port install nsis
npm install makensis
Example usage in script:
import * as NSIS from 'makensis';
const options = {
verbose: 2,
define: {
SPECIAL_BUILD: true
}
};
try {
let output = await NSIS.compile('path/to/installer.nsi', options);
console.log('Compiler output:', output);
} catch (error) {
console.error(error);
}
Usage: commandHelp(command?, options?, spawnOptions?)
Returns usage information for a specific command, or a list of all commands. Equivalent of the -CMDHELP
switch.
Usage: compile(script, options?, spawnOptions?)
Compiles specified script with MakeNSIS. The script can be omitted in favor of the preExecute
/ postExecute
options.
Usage: headerInfo(options?, spawnOptions?)
Returns information about which options were used to compile MakeNSIS. Equivalent of the -HDRINFO
switch.
Usage: license(options?, spawnOptions?)
Returns MakeNSIS software license. Equivalent of the -LICENSE
switch.
Usage: nsisDir(options?, spawnOptions?)
Returns the path of ${NSISDIR}
.
Usage: version(options?, spawnOptions?)
Returns version of MakeNSIS. Equivalent of the -VERSION
switch.
:warning: Some of these options are limited to NSIS v3 (see the changelog for details)
Type: Object
Defines symbols for the script [to value]. Equivalent of the -D
switch.
define: {
SPECIAL_BUILD: true,
LANGUAGE: "English"
}
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.
# .env
NSIS_APP_ENVIRONMENT=development
# installer.nsi
!if ${NSIS_APP_ENVIRONMENT} == "development"
DetailPrint "Valuable Debug Information"
!endif
Type: boolean
Allows dispatching the log events stdout
, stderr
and exit
.
Type: string
Specifies the codepage for files without a BOM (ACP|OEM|CP#|UTF8|UTF16<LE|BE>
). Equivalent of the -INPUTCHARSET
switch.
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.
:warning: This option is only available on Windows
Type: boolean
Returns output from makensis
as an object
Type: boolean
Disables the current directory change to that of the .nsi file. Equivalent of the -NOCD
switch.
Type: boolean
Disables inclusion of <path to makensis.exe>/nsisconf.nsh
. Equivalent of the -NOCONFIG
switch.
Type: string
Specifies a custom path to makensis
Type: boolean
Pauses after execution. Equivalent of the -PAUSE
switch.
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.
:warning: This option is only available on Windows
Type: boolean
Treat warnings as errors. Equivalent of the -WX
switch.
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.
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.
preExecute: [
'SetCompressor lzma',
'SetCompressorDictSize 16'
];
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.
postExecute: [`!echo "That's all Folks!"`];
Type: string[]
Specifies raw arguments for makensis
.
:warning: These will be added to the compiler arguments last and will hence overwrite any of the NSIS options above!
Type: integer
Verbosity where the value 4=all
, 3=no script
,2=no info
, 1=no warnings
, 0=none
. Equivalent of the -V
switch.
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.
Type: boolean
Runs makensis
on Wine
Type: string
Specifies a custom path to wine
, useful when working with wine32
or wine32on64
.
This module emits three types of events you can hook into using the on()
and once()
methods:
Gives access to an object containing the current line, and whether it contains a warning of the path of the outfile.
Gives access to an object containing the current line.
Gives access to an object containing the exit code, the full stdout
and stderr
, and the number of warnings.
This work is licensed under The MIT License.
FAQs
A Node wrapper for makensis, the NSIS compiler
The npm package makensis receives a total of 320 weekly downloads. As such, makensis popularity was classified as not popular.
We found that makensis demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.