Can a web server dynamically generate an executable on the fly?

淺唱寂寞╮ 提交于 2019-12-31 05:28:15

问题


Ninite.com seems to be doing it currently. I'm wondering how.

While it's possible for them to have every combination of app pre-generated, it seems unlikely/hacky.

[EDIT]

Is compiling a Windows executable using this method resource-intensive? Can it be done ~100k times a day without exorbitant cost? I'm asking because Ninite announced that they're going paid-only... can it be costing them that much?

[EDIT2]

The downloads aren't huge, it's just a small hundred KB web-based downloader+installer app that knows which apps to install.

^^ Regarding this, the EXE file served up by the webapp is named something like Ninite AIMP Audacity Chrome Digsby FastStone Installer.exe when given 20+ apps to install. It's probably likely that the server is serving up the same file under different filenames, and the app is then configuring itself based on the filename, no?


回答1:


The site doesn't seem to create executable but just provide them for download.

[EDIT] Creating those huge downloads on the fly would create a huge burden on the server. Moreover it could create buggy software. So my guess is, if these people know what they're doing, they have a server which prepackages everything, tests it and then dumps it in the download directory of the web server.

But of course, nothing stops a server from invoking any kind of program (with maybe the exception of the patience of the surfer). So they can run compilers, archivers, whatever.




回答2:


Why would a web server not be able to dynamically generate an executable?




回答3:


Sure, just run a compiler on the server with exec().

I do something similar with generating PDF files from LaTeX sources, since that is basically compiling as well...



来源:https://stackoverflow.com/questions/3520555/can-a-web-server-dynamically-generate-an-executable-on-the-fly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!