ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been extending my shopping cart to permit online purchase and download of my (windows only) software package.
Now, there are multiple versions of my software available, all built off the same codebase, but configured using one configuration file.
The installation has hundreds of files, so for configuration management reasons I would prefer to not have an unzipped installation available anyplace on my website. Hence, I want to zip up an installation, make it self-extracting (I do this with winzip on a Windows machine) then upload the package, complete and ready to go EXCEPT for the configuration file.
I then will place one configuration file for each downloadable configuration on the site, and when a purchaser makes a choice and pays, I would like to be able to add that one file to the self-extracting zip on the fly, then download it to the purchaser. THis way, the purchaser clicks on the download, it installs itself, we're done.
The only alternatives I see are to either send the configuration file as a separate download (requiring more work and more smarts on the part of the buyer) or have a complete zip file for each configuration that I support (maintenance nightmare).
Now, googling quickly turned up how to construct a zip file and how to add a file to a zip file using PHP. But I haven't found a way to add a file to a self-extracting zip.
Does anyone know how to do this? I am not wedded to winzip; I use it because it does what I need but I'll use any zipper or format so long as it is compatible with Windows and does what I need via PHP.
If you have Windows on the server, I think it's fairly easy - just use the exec function or something, to run a command that does the job. I don't know WinZip, I use WinRar instead. It has a lot more options, compresses better, and everything can be done from the command line. The reason I got it was I needed it to store file permissions as well as the files.
Without Windows I think it's harder. Wine should probably work, I don't think a command line can use that many system calls.
Talking of WinRar, I bought it, and I think their system was kind of cool. Instead of the usual serial numbers, they emailed me a .rar file. Installing the evaluation, it registers .rar files as well as a lot of others. When I opened the rar file in the email, I got a dialogue - "Thank you for your support" - that was it.
That looks very promising indeed. The only shortcomings I see are that it only wants to unzip to the current directory and executing a command after unzipping is a compile time option that is normally disabled. But the source is available and I can live with unzipping into the current directory.
Thanks.
BTW...to Guttorm...the server that hosts my website is Linux. I do everything with Linux, except develop that package. The package is windows only because the database that I use is windows only. But they are deploying a new generation product that will be multi-platform and I'll be following with a multi-platform version of my software.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.