4

I am using Node Webkit to create desktop app. I now need to create a single executable file so have installed the following: https://github.com/nwjs/nw-builder

I am struggling understanding the instructions, especially the command line stuff. The documentation states the below:

Usage: nwbuild [options] [path]

Options: -p, --platforms Platforms to build, comma-sperated, can be: win32,win64,osx32,osx64,linux32,linux64 ['osx32', 'osx64', 'win32', 'win64'] -v, --version The nw version, eg. 0.8.4
[default: "latest"] -r, --run Runs NW.js for the current platform [default: false] -o, --buildDir The build folder [default: "./build"] -f, --forceDownload Force download of NW.js
[default: false] --cacheDir The cache folder --quiet
Disables logging
[default: false]

I have two folders, one containing the app files and the package.json, the other folder containing all the NW files. I have also created a third folder that merges the these two folders and where I have changed the .zip file of the app to a .nw file.

Where do I run the buildDir command from?

and what would the exact command be? I have tried the below commands:

nwbuild -o build

nwbuild --buildDir /build

nwbuild -o, --buildDir /build

but all come back showing the above usage info and none of the folders contain a /build/ folder

Can anyone please help? Many thanks

LeeTee
  • 6,401
  • 16
  • 79
  • 139

1 Answers1

7

You don't need to set the buildDir, just pass in the path like this:

nwbuild -p win64 <PATH TO APP FILES>

The options are all optional, so you don't need to set any if you don't want. You can change the build platform that I set in the example if you prefer.

Aurora0001
  • 13,139
  • 5
  • 50
  • 53
  • Hey,Sorry for the late response. I ran the command and it created a build folder. However, isnt it supposed to create a single executable file instead of creating a new folder with all the files? I can already do that without using nw-builder. What is the purpose of nw-builder exactly? – LeeTee Jul 29 '16 at 16:32
  • Wasn't an `app.nw` file created? According to the docs, it should be in your build directory. – Aurora0001 Jul 29 '16 at 16:34
  • 1
    The first few lines of the [README](https://github.com/nwjs/nw-builder/blob/master/README.md) - "It will download the prebuilt binaries for a newest version, unpacks it, creates a release folder, create the app.nw file for a specified directory and copies the app.nw file where it belongs." – Aurora0001 Jul 29 '16 at 16:46