This is the command-line tool to automate the build of installer (for Windows) and packages (for Linux) of nw.js applications that use a system-wide installation of the nw runtime files. For more information about this packaging method for nw.js apps, please see the README file at the root of the nw.js-global-install repository.
This tool can build Windows installers based on NSIS and .deb and .rpm packages for Linux in i386 and x86_64 architectures.
To build a Windows installer you need
makensis. On Windows, you can get it by installing NSIS and then adding it's install directory (default is C:\Program Files (x86)\NSIS) to your PATH environment variable. On Linux, you can install the nsis package from your distribution's repositories (for example
sudo apt-get install nsis on Ubuntu and Debian-like distros).
To build Linux packages you need
fpm, a tool written in Ruby that allows to build various types of packages. You can actually build Linux packages only on a Linux machine or maybe with Cygwin. To install
fpm, follow the instructions here (basically, you need to install Ruby with C headers and then install the fpm gem). For RPM packages fpm also needs rpmbuild; if you are on a distro which isn't based on RPM packages, you probably need to install rpm (for example
sudo apt-get install rpm on Ubuntu and similar).
npm install -g nw-global-build(you may need
sudodepending on your node.js installation).
cd) to the root directory of the nw.js application you want to package. The root is where the
package.jsonis located. Make sure you have added the nwjsmanager section with the version filter in
package.jsonas explained here.
nw-global-build init. This will put a
nw-global.jsonfile in the directory, which you can (and should) edit to customize the build process.
nw-global.jsonwith your editor. Read the comments to understand what each field means, and edit the fields according to your needs.
nw-global-build update. If you had to use
sudoat Step 1, you'll need it here too. This builds a cache of the binaries required during the build process (nwjsmanager and applauncher for the various platforms) in a subdirectory of the
nw-global-buildnpm module (since it's installed globally, this is the reason you may need
nw-global-build buildto actually build the packages. This will build the types listed in the
nw-global.json, but can be overridden by listing the package types you want to be built on the command line. For example,
nw-global-build build win deb64builds a Windows installer and an x86_64 package for Debian-like Linux distributions.
Repeat Step 6 every time you want to rebuild the packages. If you get errors saying that binary hashes doesn't match, it means that nwjsmanager and/or applauncher have been updated, but they can't be downloaded to the cache directory due to missing permissions. To solve the issue, rebuild the binary cache with
sudo nw-global-build update.