Can a web server dynamically generate an executable on the fly?
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开发者_JAVA百科 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?
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.
Why would a web server not be able to dynamically generate an executable?
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...
精彩评论