5

Because Node.js now also available on Windows, I would like to share my scripts without including node.exe. Is it possible to pack the script (no more files) together with the node.exe into a single executable file?

  • 2
    This appears to be part of a Duplicate Pool: http://stackoverflow.com/questions/6145561/is-there-a-way-to-compile-node-js-source-files, http://stackoverflow.com/questions/7557364/packing-node-js-scripts-node-exe-into-a-single-executable, http://stackoverflow.com/questions/8173232/make-exe-from-node-js-app, http://stackoverflow.com/questions/8794140/is-it-possible-to-create-desktop-applications-with-node-js, http://stackoverflow.com/questions/9724817/how-to-create-a-stand-alone-command-line-application-with-node-js, http://stackoverflow.com/questions/13388108/standalone-node-js-application – Mogsdad Mar 10 '13 at 12:49
  • The first one is not exactly the same. Compiling javascript and bundling the node.js interpreter and a script in an executeable file are two different things. And the other questions are older than mine. –  Mar 12 '13 at 11:36
  • A good list of tools is here: http://stackoverflow.com/a/12486874/32679 – GrGr Jun 30 '13 at 09:14

3 Answers3

2

You absolutely can, and it's pretty easy with JXcore.

Once you have JXcore installed on windows, all you have to do is run:

jx package app.js "myAppName" -native

This will produce a .exe file that you can distribute and can be executed without any external dependencies whatsoever (you don't even need JXcore nor Node.js on the system).

Here's the documentation on that functionality: https://github.com/jxcore/jxcore/blob/master/doc/api/jxcore-feature-packaging-code-protection.markdown

(Duplicate of https://stackoverflow.com/a/27551233/810830)

Community
  • 1
  • 1
Nepoxx
  • 4,849
  • 5
  • 42
  • 61
0

Have you tried WinRAR? It should give you the opportunity to create a self-extractable executable which unpacks all files to the TEMP folder. After doing this you can setup to run one exe file in the archive. Furthermore you can hide the "Unpack" dialog.

Christian Ivicevic
  • 10,071
  • 7
  • 39
  • 74
-1

actually I think you can use adobe air to accomplish this, no need to include node.exe

have you ever tried to develop hybrid applications with QtWebKit, which I think might be a very good direction for you., hope this helps.

haohello
  • 99
  • 1
  • 1
  • 10