How to Pack a Node-WebKit (NW.js) Application into a Single Executable

BoxedApp Packer allows you to turn a Node-WebKit (NW.js) app into one self-contained EXE. All JS, HTML, and NW.js runtime files are embedded and loaded from memory - no installation or temp files required.

The Task

Suppose you have a Node-WebKit app and want to:

  • Distribute a single executable instead of multiple files.
  • Protect your application's resources.
  • Change the EXE icon or add a splash screen.

In this tutorial we will pack a simple HTML app that shows an image. You can get the sample on GitHub.

Why the Default Distribution Has Problems

  • No easy way to prepare a single EXE from a Node.js based app.
  • Application sources are exposed for anyone to extract and modify.
  • No built-in way to protect assets or add splash screens.

BoxedApp Packer solves this by packing everything into a single EXE ("packed exe"). Files are not unpacked to disk - they live entirely in memory via the virtual file system.

Prepare the Package

Download NW.js runtime and BoxedApp Packer. Launch Packer, select nw.exe as input, specify output EXE path (any name you want).

To run an NW.js-based app, the folder name is passed to nw.exe:

nw.exe show-image-app

In Packer, click Override command line and type:

<BoxedAppVar:OldCmdLine> show-image-app

Then add NW.js runtime files: in Application Directory, click Add Files and select the runtime files (except nw.exe). Next, import directories: first locales, then your app folder (for example show-image-app).

Build and run. It works!

Screenshots

1. Select nw.exe
1. Select nw.exe
2. Set output name
2. Set output name
3. Override command line
3. Override command line
4. Add files
4. Add files
5. Import directories
5. Import directories
6. Build and run
6. Build and run

Benefits

  • Distribute your NW.js app as one EXE - no need for installation.
  • All files are virtualized - nothing written to disk.
  • Protect your code, HTML, and resources from extraction.
  • Supports adding icons, splash screens, and custom commands.