Today we will be shipping out an example application developed on Mac π OSX to a Win64 OS. π»
Please note: this tutorial is based on an instructional lecture originally presented by Rick Patci.
Feel free to use this guide to walk through these steps at your leisure.
- Please ensure you are using a version of node compatible with the latest NW.js build (at the time of
this initial documentation, node-v6.1.0). - If you have nvm, nodenv, etc. you may also add that particular node version.
-
Fork and clone this repo
-
cd nwjs-tutorial -
npm i -
Open in editor.
-
####The following steps will enable you to develop and test this app before bundling it up for desktop use.
-
Navigate to
package.json -
Recommended: append some explicit
windowoptions after the scripts option.javascript "window": { "title": "Sample NW.js App", "toolbar": false, "fullscreen": false, "width": 700, "height": 400, "resizable": false },
-
In your browser, navigate to nwjs.io
-
We want to specifically build for Windows 64 in this example, which can be found by clicking on
DOWNLOADS:
-
On the resulting page, select the
NORMALWindows 64-bit option to begin download:
-
Next, unzip the contents. The destination of the zip extracts is not crucial in this step.
-
Create a new directory (ex:
mkdir sample-nw-v0.1.0) that will ultimately be the finished product folder we send off to our user. The location of this directory is not crucial, just somewhere you can remember π -
Copy all of the extracted contents of the nwjs zip binaries into this new user directory.
-
Now back in our tutorial directory, we need to bundle up our app's files (index.html, styles directory, and the package.json) into a package.nw file.
zip -r package.nw index.html styles package.jsonwithin the directory containing these files. -
mv package.nw ../your-path/to/the/user/dir. The user's directory should now contain our nw.js binaries and the resultingpackage.nwarchive. -
Rename the nw.exe file to an app name of your choosing! ex:
our-cool-example-app.exe -
We are now ready to bundle this up officially! You may use the
zip -rcommand for recursive directory zip, or, to encrypt with apassword you can pass an extra flagzip -er. Once these are bundled up, we are ready to send away! The end-user unzips, and runs the executable π

