The first example code is very simple, you can add some of your most familiar JS code, such as this:
Packaging and distribution
For example, it is clear that these DLLs and Pak files are indispensable for our application to run (for what each file is for, see the official description document).
So, for the simple application of the example1 we do, how can we let our users run it? Of course, let our users to download Node-webkit and then unzip the operation, this is also a way, so we just throw the Example1.zip file to him on it.
But it always feels a bit strange, if you can package all the relevant content into a separate EXE file, such as packaged into Example1.exe, so that users can directly double-click to run, which is obviously excellent.
Ok,let ' s go!
First, we will merge Example1.zip and Nw.exe to form a new file named Example1.exe, which we can do with the copy command under Windows command line:
copy /b nw.exe+example1.zip example1.exe
Note that the nw.exe must be placed in front of the + sign.
This generates a file named Example1.exe, double-click the file to see the same effect as the first example. Obviously, this example1.exe is still dependent on those DLL files to run, so we need a packaging tool to help us package these example1.exe and DLL files together, it's Enigma Virtual Box, You can click here to download the installation:
Http://enigmaprotector.com/assets/files/enigmavb.exe
After the installation is complete, you see the following interface:
Packaging process (Follow the configuration in the diagram):
Click the process button in the lower right corner to start packing and finally get a file named Example1_boxed.exe. Copy this file to any other directory to double-click, if you can run smoothly, the packaging success! You can distribute it to your users!
The official documentation also describes several other packaging distribution methods, but it does not look very practical and interesting to see here:
Https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps
Node-webkit Getting Started