coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.83k stars 356 forks source link

Question: Is it possible to split .exe creation and service creation #348

Closed raikm closed 1 year ago

raikm commented 1 year ago

Is it possible to use this library to create a .exe file for shipping to customers where the service gets onside created? So I would like to avoid shipping the whole node project and would rather send the .exe file to the customer.

Thanks in advance!

coreybutler commented 1 year ago

This library provides a service runner, not a bundler. The exe produced by this library is just a service runner, not a standalone app.

If you want a standalone bundle (i.e. a single exe), use a bundler like pkg. Alternatively, Node.js 20.0.0 shipped with experimental single executable application (SEA) support. Beware that these processes merely merge your code with the node executable, so the file size is large, even for a simple "hello world" script (~60MB for pkg/~90MB for SEA). Electron has some optimization capabilities that can get executables down to ~45MB after unnecessary extras are stripped out.