makensis-cli v0.6.1-alpha
makensis-cli
CLI for the makensis wrapper on Node
Why?
Admittedly, there are only few reasons why you would want to use a wrapper for an already existing CLI application.
Pros:
- seamless Wine integration
- Unix-like command-line parameters
- normalized output
- optional JSON output
Cons:
- redundancy
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 nsisAlternatively, 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
$ npm install makensis-cli --global
Usage
Sub-Commands
hdrinfo– prints information about what options makensis was compiled with (Aliases:f|flags|i|info)version– prints the makensis version and exits (Alias:v)cmdhelp [item]– prints out help for 'item', or lists all commands
Options
Running nsis --help lists all available options:
Usage: nsis [command] [file.nsi] [options]
Options:
-V, --version output the version number
-i, --input-charset <string> ACP|OEM|CP#|UTF8|UTF16<LE|BE>
-j, --json prints output as JSON
-p, --pause pauses after execution
-o, --output-charset <string> ACP|OEM|CP#|UTF8[SIG]|UTF16<LE|BE>[BOM]
-P, --ppo preprocess to stdout/file
-S, --safe-ppo preprocess to stdout/file
-v, --verbose <n> verbosity where n is 4=all,3=no script,2=no info,1=no warnings,0=none
-w, --wine use Wine to run makenis
-x, --strict treat warnings as errors
-h, --help output usage informationExamples:
Let's start with makensis returning its version
$ nsis version
# Result:
#
# v3.02.1We can also return this as JSON
$ nsis version --json
# Result:
#
# {
# "version": "3.02.1"
# }Try again for makensis on Wine
$ nsis version --json --wine
# Result:
#
# {
# "version": "3.01"
# }In the following steps we're going to need a demo script, so let's create one. Take special note of the !warning inside the section.
$ printf "OutFile demo.exe\n\nSection\n!warning\nSectionEnd" > demo.nsiCompile the script
$ nsis demo.nsi
# Result (omitted):
#
# EXE header size: 36352 / 37888 bytes
# Install code: 399 / 1999 bytes
# Install data: 0 / 0 bytes
# CRC (0x027F605B): 4 / 4 bytes
# Total size: 36755 / 39891 bytes (92.1%)
# 1 warning:
# !warning: (demo.nsi:4)Compile again, but only display warnings and errors
$ nsis demo.nsi --verbose 2
# Result:
#
# warning: !warning: (demo.nsi:4)
# 1 warning:
# !warning: (demo.nsi:4)Complie with strict settings, so our little !warning will be treated as an error.
$ nsis demo.nsi --verbose 2 --strict
# Result:
#
# Exit Code 1
# Error: warning treated as errorLet's output the above as JSON
$ nsis demo.nsi --verbose 2 --strict --json
# Result:
#
# {
# "status": 1,
# "stdout": "warning: !warning: (demo.nsi:4)",
# "stderr": "Error: warning treated as error"
# }License
This work is licensed under The MIT License
Donate
You are welcome support this project using Flattr or Bitcoin 17CXJuPsmhuTzFV2k4RKYwpEHVjskJktRd
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago