I wondered if anyone could help shed some light on something I am trying to achieve,

I will try and explain as clearly as I can.
Basically using PHP I would like to be able to compile an exe (windows executable)
programmatically on the server in real-time, I know this is possible, but at the moment
am not quite sure how. To explain; basically we will have a file on our server,
and when the customer has made a successful payment online, using PHP we would
programmatically add a unique code to this file and then compile it to produce a
unique executable (something.exe) in realtime for them to download and install on a Windows PC.

I hope this makes sense, can anyone help?

    PHP can execute system commands, so if you know the command to invoke the compiler, you can use one of the [man]exec[/man] functions to run the compiler/linker/etc. to create the file.

      we do that with exec to create outlook signature installers for some corporates, couple of things to consider, where the created file is located, is it secure, if your going to keep the file, for how long.

        Thank you for your help.

        The part I am struggling with is:
        I need to embed a pre-created text file (customer.txt from the server) into an executable,
        this executable when ran on a Windows PC must then place the embedded
        text file into a specified location e.g. "C\Program Files\Something\customer.txt"

        So my problems are:
        1) To embed a text file into an executable. (programmatically in real-time on the server)
        and
        2) I need to program the exe to place this file somewhere when ran.

        Can anyone help in this area?

          All that is the job of the compiler/packager. So it depends entirely on how that can work and be controlled from the command line (this is Windows, so ... Visual Studio? You can put together a project there and use the project properties dialogue to assemble the command lines for the different parts of the chain (cl.exe, link.exe etc. for a C++ app).

          All PHP would do is issue the commands to each part and serve the final result.

            sounds a bit like what we do with the ionCube Bundler, on execution on clients pc it runs a batch file that extracts files to certain locations. (pc only)

              Write a Reply...