HyperSonic
19th April 2007 21:22 UTC
Adding a file to an installer.exe subsequently
Hi there,
I have a installer.exe that is compiled with NSIS. This file can be downloaded from a web-server.
Additionally the application in this installer needs a licence file that is specific for every user - the rest of the installer.exe is the same for all users.
Now, it would be fine, if this licence file could be added to the installer.exe just before the web-server starts the download. As the user can only download the installer after he has logged-in to the web-server, the web-server knows all the data that go into the licence file.
One possibility would be to start the NSIS compiler just before the download starts and put the licence file in a temporary directory and have the compiler to add it in the installer.exe.
But the compilation takes about 30 seconds and I am looking for a way that is faster.
So, another idea would be to pack the installer.exe plus the licence file into another installer_wrapper.exe that compiles very fast because it does not compress the installer.exe again.
When the installer_wrapper.exe is started by the user, it would automatically launch the contained installer.exe and afterwards copy the licence file to the installation directory.
Can this be done with NSIS?
Thanks a lot
Cheers
HyperSonic
kichik
19th April 2007 21:28 UTC
See the following:
http://nsis.sourceforge.net/ReadCustomerData
HyperSonic
19th April 2007 21:46 UTC
yep, this seems to be a solution for my problem.
To be honest, since I am not very familiar with NSIS I don't understand everything in this article.
In my words, this is what I would have to do:
- append the customer data to the end of the installer.exe before the download starts
- add the functions mentioned in the article to my installer script.
When the installer runs, it reads out the customer data from itself.
Is this correct so far?
Now, here are my new questions:
How I can append the customer data to the end of the installer.exe?
Does NSIS have a built-in function for this or do I have to append the data by some other application.
Another problem is, that my application needs the customer data in a file. Is it possible for the installer to write the extracted data into a file?
Thanks again
HyperSonic
kichik
19th April 2007 21:51 UTC
Correct. You add the data at download time with some kind of server-side script and then read it from the installer script. If you need the data in a file, simply write it to a file using FileOpen, FileWrite and FileClose after reading it using ReadCustomerData.
Method of appending the data to the installer depends on your server environment. Generally speaking, you should create a script that handles the download. It should read the installer and pass it as-is to the user and just before closing the connection it should add the personal data.
HyperSonic
19th April 2007 21:54 UTC
ok, as it is a PHP server it should be possible to append the customer data to the download stream.
I will give it a try.
Thanks a lot!