Archive: Manipulating Installers from PHP


Manipulating Installers from PHP
Hello,

I am trying to find out if there is a way to manipulate NSIS installers from a PHP script? I want to be able to do the following: on-the-fly on a web site be able to replace some files within a NSIS installer. The files are just resources files like images, text files. I know the installer EXE is actually an archive but I can not seem to be able to manipulate it using PHP Zip archive library.

Is there any way to accomplish this? Is there any way to create an NSIS installer that will be comparible with PHP Zip and allow a PHP script to on-the-fly replace some of the files in the script (without recomplication).

Thanks!


You cannot modify the installer's files after compilation, as you'll destroy the CRC validity. You can however append data at the end of the exe file and read that at runtime. See for example ReadCustomerData. You might want to add some form of error checking on your appended data as well, since it's not included in the installer's own CRC check.


Thanks! Sounds like exactly what I needed and like you said a much better and cleaner way. I'll check ReadCustomerData.