1. Download nw.js
nwjs.io/
2. Decompress the installation package
After downloading, unzip it and open it
The app folder
The app folder
index.html
package.json
{
"name": "first app"."main": "index.html"."version": "1.0"."window": {
"height": 300."width": 360."show": true."title": "first app"."toolbar": true."frame": true."resizable":false."icon": "./icon.png"."transparent":false}}Copy the code
Here’s what each parameter means:
Main: the entry file for the app. Here we use index.html, which is what the first page is when the app launches. Version: indicates the version number, which is used in the upgrade of a later version. Window: Sets the window. Height: indicates the height in pixels. Width: indicates the width in pixels. Show: whether the window is directly displayed when the program is clicked to run. Title: The title of the window. This property is used as the title of the window when the title tag of the entry page is empty. Toolbar: Whether the toolbar is enabled. Frame: Whether to use a border, that is, a border with buttons such as minimize, close, etc. Resizable: Whether the window can be resized. Icon: Icon of a window, also displayed in the quick launch bar. Transparent: Indicates whether the window background is transparent.Copy the code
Then compress all the file project files in the app folder into the app.zip zip file and change it to the app.nw file. Paste app.nw from app into root directory, then open command line tool to merge into exe file:
copy /b "E:\myweb\maomin\nwjs\nw.exe"+"E:\myweb\maomin\nwjs\app.nw" "E:\myweb\maomin\nwjs\app.exe"
Copy the code
Here is just an example, according to their own store path to. After the merge is complete, you will see a file named app.exe in the root directory.
3. Download Enigma Virtual Box
Then you need to download a piece of software called Enigma Virtual Box. Download the link to open it, select app.exe and put the original nw.js file you just downloaded (excluding any files or folders you created or generated yourself). Drag it into the big box below and click Process
4, complete
After the progress bar is complete, there will be an app_boxed.exe file in the root directory, which can be opened anywhere.