Distributing using Node-Webkit for Free (Windows)

1

Stats

2,818 visits, 4,399 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 30 Jan, 2015. Last updated 19 Feb, 2019

Note that distributing using this method is a little unstable.

I don't know how any of this works for Mac, or Linux (considering I don't have those platforms)

Make sure to export your game as HTML5.

NodeJS is required to distribute with Node-Webkit.

Go to http://nodejs.org/ and click the 'INSTALL' button to get the latest version. Open the installer and follow the instructions of the wizard to install NodeJS.

After installing NodeJS, you'll also need the builder, so open the command prompt (make sure you have administrator rights) and enter "npm install node-webkit-builder -g" in the command line and NodeJS will automatically install the builder.

If you happen to get an error that points to "AppData/Roaming/npm", simply navigate to your AppData Roaming folder by typing "%appdata%" in a Windows Explorer bar. In the roaming folder, create a new folder and name it "npm". Open a command prompt and enter the line "npm install" and npm will automatically update itself.

Now, you can install Node-Webkit, by going to [l][https://github.com/nwjs/nw.js][https://github.com/nwjs/nw.js][l], scrolling down to 'Downloads', and downloading the .zip file depending on your operating system.

Create a folder on your desktop (or anywhere else) and name the folder "MyNodeWebkitApps" (or anything else you want). Open the folder and create a subfolder and name it "nw". Extract the .zip folder you have from Node-Webkit into the nw folder and make sure that all the files are at the root of the nw folder, not in a subfolder.

In the root of the MyNodeWebkitApps, create another subfolder and name it whatever you want (no spaces!). Inside of the folder open a command prompt (hold shift and right click Windows Explorer) and enter "npm init" on the command line. This will help you create a basic package.json for your game.

Open the folder where your game is located (the folder with index.html that you exported in Construct 2) and drag and drop all the contents into the folder with package.json.

Go back to the MyNodeWebkitApps folder and open a command prompt inside of it, and type "nwbuild ./<the name of that subfolder you made earlier>". This will then create a new subfolder named "build" with folders inside of that named "win32", "win64", etc. You can now turn these folders into seperate zip files for uploading to websites.

Enjoy your executable!

  • 0 Comments

Want to leave a comment? Login or Register an account!