打包 Node.js 脚本 +将 node.exe 转换为单个可执行文件
由于 Node.js 现在也可以在 Windows 上使用,因此我想分享我的脚本,但不包含 node.exe。是否可以将脚本(没有更多文件)与node.exe一起打包到单个可执行文件中?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您绝对可以,而且使用 JXcore 非常简单。
一旦你在 Windows 上安装了 JXcore,你所要做的就是运行:
这将生成一个 .exe 文件,你可以分发该文件,并且可以在没有任何外部依赖的情况下执行它(你甚至不需要 JXcore 或 Node.js系统)。
以下是有关该功能的文档: https://github.com/jxcore/jxcore/blob/master/doc/api/jxcore-feature-packaging-code-protection.markdown
(https://stackoverflow.com/a/27551233/810830)
You absolutely can, and it's pretty easy with JXcore.
Once you have JXcore installed on windows, all you have to do is run:
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)
你试过WinRAR吗?它应该让您有机会创建一个可自解压的可执行文件,将所有文件解压到 TEMP 文件夹。完成此操作后,您可以设置运行存档中的一个 exe 文件。此外,您可以隐藏“解包”对话框。
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.
实际上我认为你可以使用adobe air来完成这个,不需要包含node.exe
你曾经尝试过使用QtWebKit开发混合应用程序,我认为这对你来说可能是一个非常好的方向。希望这会有所帮助。
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.