The thing is, I learned nwjs according to some online tutorials. At first, it was all right, but later, after generating app.nw, it was delayed to inside, nw.exe. Later, Baidu found that the actual situation was different from many tutorials. Now, package.json must be taken out separately and placed under the root directory.
In this way, it is possible for me to drag app.nw to inside, nw.exe for execution.
But the generated app.exe cannot be executed
However, I later found out that if I drag app.exe to nw.exe and inside, it can be carried out normally.
I would like to ask why single-point app.exe cannot be implemented normally. What is the solution? Thank you.
Use copy/b nw.exe plus app.nw app.exe
This way of packing has two disadvantages.
At runtime, it will be decompressed to a temporary folder; In this way, your code will be exposed and the speed of opening will be affected.
App.nw cannot be too large, otherwise it will sometimes encounter the problem of decompression failure.
Look at the tutorial I wroteNw.js into the pit guide, code protection, packaging and distribution are mentioned;