Archive: Post compilation changes


Post compilation changes
Hi all,

we would like to change the bitmaps after the installer.exe is created. This is because some of our customers are OEMs and want to do some branding of our installer.

Is it possible to unpack the installer, modify the embedded bitmaps and repack with the modified bmps? If 'yes', how can we do this?

Regards,
Franz


One option: http://nsis.sourceforge.net/ReadCustomerData
You should be able to store the raw bytes and extract them.

Stu


Thank you for answering. As it seems ReadCustomerData supports only plain text and no binary image. I'm able to unpack by using 7-zip, but it is not possible to repack a changed bitmap to the existing exe :-(.

Fx


Originally posted by franz.reitner
I'm able to unpack by using 7-zip, but it is not possible to repack a changed bitmap to the existing exe :-(.
If you're encouraging your clients to use 7zip to pull apart your own installer, why not just give them your installer scripts straight away? Then they can compile their own installer the proper way.

7-Zip is able to extract the files to install and some hidden folders, containing the bitmaps I'll want the customer to edit. The script itself will be not extracted by 7-zip. It stays inside the installer executable. Seems that I'm stuck...


the customerdata route should work: The wiki example just points out the possibility, and gives a typical use case which involves standard text data - but there's nothing stopping you from using FileReadByte instead of FileRead to get the raw data. Combine that with FileWriteByte to write the bytes out to e.g. mybitmap.bmp that you can then use in the installer, and voila.


Originally posted by franz.reitner
7-Zip is able to extract the files to install and some hidden folders, containing the bitmaps I'll want the customer to edit. The script itself will be not extracted by 7-zip. It stays inside the installer executable.
It will if you add the script to the installer somewhere. Most straight-forward method would be to File installer.nsi, though I'm sure there are smoother ways to do it. But that's really not my point. What I mean is: Why are you encouraging your users to tear apart your installer? Just give them the installer script and a rar with the necessary files and they'll be able to do things properly, instead of having to go to extremely hackjob "solutions" like 7zip.