Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a Self-Extracting Executable Using PHP

The self-extracting executable that I'm attempting to develop is an installer. An end-user will visit a site, then they will be prompted to register on the site and a download will be provided to them. That download is the self-extracting executable that will install the software on the end-user's computer along with a config file that will have the user's unique id in it. The software is a Windows Service so it will not be able to simply ask the user their username and password.

To be able to insert the registered user's unique id into the installer, I would have to generate the installer on the fly. After researching and using my own experience, I decided that a self-extracting executable would be the best option. The question I have now is how can I generate one using PHP? After researching this problem, I found that the most common solution was to install a executable that could create self-extracting executables on the server machine and then invoke it from PHP. However, executing a executable is not possible with my web host, so this is not a viable solution.

like image 217
Dylan Avatar asked Feb 11 '11 22:02

Dylan


1 Answers

However, executing a executable is not possible with my web host, so this is not a viable solution.

I think in that case, you will need to switch to a web host that lets you do this (or rent a dedicated or virtual server). You can create ZIP files from within PHP when the necessary libraries are installed, but that is about it. Producing Self-extracting executables is not on the menu.

If that is not an option, you would have to find a way to pre-produce the self-extracting executable and inject the user ID into it afterwards. That is surely possible, but I expect you would have to build a custom self-extractor for this.

like image 135
Pekka Avatar answered Oct 30 '22 23:10

Pekka