makensis-cli
CLI for the Node.js makensis wrapper, compiles NSIS scripts
Last updated 4 months ago by idleberg .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install makensis-cli 
SYNC missed versions from official npm registry.

makensis-cli

npm npm CircleCI David

CLI for the Node.js makensis wrapper

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 across different NSIS versions
  • optional JSON output

Cons:

  • redundancy

Prerequisites

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

Windows

Download the NSIS installer from SourceForge and run setup. Once completed, you need to edit your environment variable manually.

Alternatively, you can install NSIS using the Scoop package manager:

$ scoop install nsis/nsis

Linux

Install NSIS from your distribution's default package manager, for example:

# Debian
$ sudo apt-get -t experimental install nsis

# Red Hat
$ sudo dnf install nsis

macOS

Install NSIS using Homebrew or MacPorts:

# Homebrew
$ brew install nsis

# MacPorts
$ port install nsis

Wine

You can setup NSIS in your Wine environment, but keep in mind that Wine writes standard streams while executing makensis. Additional parsing of the compiler output might be necessary.

Installation

$ npm install makensis-cli --global

Usage

You can evoke this wrapper using mn (for makensis).

Sub-Commands

  • hdrinfo – prints information about what options makensis was compiled with (Aliases: flags)
  • version – prints the makensis version and exits
  • license – prints the makensis software license exits
  • cmdhelp [item] – prints out help for 'item', or lists all commands
  • nsisdir – prints path of ${NSISDIR} (Aliases: dir)
  • scaffold – scaffold a new NSIS script in the current working directory (Aliases: new)

Options

Running mn --help lists all available options:

CLI version of node-makensis

Options:
  -V, --version                     output the version number
  -h, --help                        output usage information

Commands:
  hdrinfo|flags                     Print compilation flags
  compile [script]                  Compiles script(s)
  version [options]                 Import repository
  cmdhelp|help [command] [options]  Prints out help for single or all commands
  license [options]                 Prints license
  nsisdir|dir                       Prints NSIS installation folder
  scaffold|new                      Creates custom made NSIS script
  help [cmd]                        display help for [cmd]

Examples:

Let's start with makensis returning its version

$ mn version

# Result:
#
# v3.02.1

We can also return this as JSON

$ mn version --json

# Result:
#
# {
#   "version": "3.02.1"
# }

Try again for makensis on Wine

$ mn 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.nsi

Compile the script

$ mn 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

$ mn demo.nsi --verbose 2

# Result:
#
# warning: !warning:  (demo.nsi:4)
# 1 warning:
#   !warning:  (demo.nsi:4)

Compile with strict settings, so our little !warning will be treated as an error.

$ mn demo.nsi --verbose 2 --strict

# Result:
#
# Exit Code 1
# Error: warning treated as error

Let's output the above as JSON

$ mn demo.nsi --verbose 2 --strict --json

# Result:
#
# {
#   "status": 1,
#   "stdout": "warning: !warning:  (demo.nsi:4)",
#   "stderr": "Error: warning treated as error",
#   "warnings": 1
# }

License

This work is licensed under The MIT License

Donate

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

Current Tags

  • 0.14.1                                ...           latest (4 months ago)
  • 0.12.1-2                                ...           next (a year ago)

53 Versions

  • 0.14.1                                ...           4 months ago
  • 0.14.0                                ...           6 months ago
  • 0.13.0                                ...           6 months ago
  • 0.12.2                                ...           a year ago
  • 0.12.1                                ...           a year ago
  • 0.12.1-2                                ...           a year ago
  • 0.12.1-1                                ...           a year ago
  • 0.12.1-0                                ...           a year ago
  • 0.12.0                                ...           a year ago
  • 0.11.2                                ...           a year ago
  • 0.11.1                                ...           a year ago
  • 0.11.0                                ...           a year ago
  • 0.10.2                                ...           a year ago
  • 0.10.1                                ...           2 years ago
  • 0.10.0                                ...           2 years ago
  • 0.9.1                                ...           2 years ago
  • 0.9.0                                ...           2 years ago
  • 0.8.1                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.2                                ...           2 years ago
  • 0.6.1                                ...           2 years ago
  • 0.6.1-alpha                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.4                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.1-alpha.1                                ...           3 years ago
  • 0.2.1-alpha.0                                ...           3 years ago
  • 0.2.1-alpha                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.2.0-alpha.5                                ...           3 years ago
  • 0.2.0-alpha.4                                ...           3 years ago
  • 0.2.0-alpha.3                                ...           3 years ago
  • 0.2.0-alpha.2                                ...           3 years ago
  • 0.2.0-alpha.1                                ...           3 years ago
  • 0.2.0-alpha.0                                ...           3 years ago
  • 0.2.0-alpha                                ...           3 years ago
  • 0.1.3-alpha.0                                ...           3 years ago
  • 0.1.3-alpha                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.2-alpha.0                                ...           3 years ago
  • 0.1.2-alpha                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 54
Dependencies (7)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |