So I've got the following problem: My project (this one) depends on two different nw.js applications bundled using web2exe. One of them is for setup and the other is GUI-less and should run in the background on startup. The second application also relies on nw to implement operations such as showing tray icons and hiding windows that would otherwise require platform-specific scripts such as batch files or shell scripts. This solution works fine, but I can't compress the executable since the system needs to access some normal files in the tree. Even if it could, the largest files would be the dll and locale files. Bundling two separate, uncompressed web applications with additional node modules would result in a file size of around 800mb, which is completely unrealistic for what I want to achieve with my application.
I'm considering using another framework, such as Neutralinojs, but that means having to rewrite the code and losing some new specific functionality in the process. I'm more interested in sharing new files between my two applications. The second one is in a subfolder of the first one. Most nw files (except the executable itself) are identical to the files in the root nw directory. In particular, sharing the nw.dll and locales folders between them has reduced the size by about 200mb.
I've been looking for ways to do this, but so far I haven't found any good methods. Maybe there's a solution here that I'm missing. Another solution I can imagine is to use some smaller subset or reimplement nw using native webview. Maybe there is something similar out there, but I haven't found it yet.
The easiest solution is to simply combine them into one application.
main
inpackage.json
to a JS file instead of an HTML file.open
event: https://nwjs.readthedocs.io/en/latest/References/App/#event-openargsopen
event handler, usenw.Window.open()
to display the window (FelizJueves.html). This event is fired when someone attempts to start an application that is already running. So the first launch just starts the background checker. The UI window will pop up the second time you start it.