Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
A Node wrapper for makensis
, the compiler for NSIS installers. Supports both, native and Wine.
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.
yarn add makensis || npm install makensis
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}`);
}
Usage: compile(script, [options])
Compiles specified script with MakeNSIS. The script can be omitted in favor of preExecute
/ postExecute
.
Usage: compileSync(script, [options])
Compiles specified script with MakeNSIS. The script can be omitted in favor of preExecute
/ postExecute
..
Usage: version([options])
Returns version of MakeNSIS. Equivalent of the -VERSION
switch.
Usage: versionSync([options])
Returns version of MakeNSIS. Equivalent of the -VERSION
switch.
Usage: hdrInfo([options])
Returns information about which options were used to compile MakeNSIS. Equivalent of the -HDRINFO
switch.
Usage: hdrInfoSync([options])
Returns information about which options were used to compile MakeNSIS. Equivalent of the -HDRINFO
switch.
Usage: cmdHelp([command], [options])
Returns usage information for a specific command, or a list all commands. Equivalent of the -CMDHELP
switch.
Usage: cmdHelpSync([command], [options])
Returns usage information for a specific command, or a list all commands. Equivalent of the -CMDHELP
switch.
Note: Some of these options are limited to NSIS v3 (see the changelog for details)
Type: integer
Verbosity where x is 4=all,3=no script,2=no info,1=no warnings,0=none. Equivalent of the -V
switch.
Type: boolean
Pauses after execution. Equivalent of the -PAUSE
switch.
Type: boolean
Disables the current directory change to that of the .nsi file. Equivalent of the -NOCD
switch.
Alias: nocd
Type: boolean
Disables inclusion of <path to makensis.exe>/nsisconf.nsh
. Equivalent of the -NOCONFIG
switch.
Alias: noconfig
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
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
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.
Alias: PPO
/ safeppo
Type: Object
Defines symbols for the script [to value]. Equivalent of the -D
switch.
Example:
define: {
"SPECIAL_BUILD": true,
"LANGUAGE": "English"
}
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
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"
]
Type: boolean
Run makensis
on Wine
Type: string
Current working directory of the child process
Type: boolean
Prepare child to run independently of its parent process. Specific behavior depends on the platform, see options.detached
.
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.
Type: boolean
Return output from makensis
as an object
Type: string
Specifies a custom path to makensis
This work is licensed under The MIT License
You are welcome support this project using Flattr or Bitcoin 17CXJuPsmhuTzFV2k4RKYwpEHVjskJktRd
FAQs
A Node wrapper for makensis, the NSIS compiler
The npm package makensis receives a total of 139 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.