cscooper
8th April 2010 14:06 UTC
Can I programmatically extract contents of NSIS installer?
I have a third party tool that creates an NSIS installer for me. The problem is, the third party is no longer in business and I find that one of the files being included in the NSIS installer EXE is the wrong version. What I would love to do, is to write a small utility that opens up the installer EXE, replaces the file with the correct version, and then puts the installer EXE back together again.
Is there any way to do this?
Any NSIS API library or something?
Thanks,
Chris
p.s. No, I can't just replace the third party tool with something else, it does a million other things before finally creating the NSIS installer, so it's not just a simple matter of writing my own NSI script and dumping the third party tool ...
Animaether
8th April 2010 14:47 UTC
Surely you can just replace the file with the correct version in the location that third party tool (what tool is that?) gets its files from, and then run the tool again?
anyway.. I'm not 100% sure on this, but I know 7zip and some other archive handling programs can extract files from NSIS installers. It stands to reason that, in theory, they might also be able to -add- files back in. Though checking 7zip against a simple test installer shows that it doesn't support this ("no interface" something something).
Presuming you find a packer that -can- add files to the installer executable, the installer -cannot- use the CRCCheck attribute, though - as any modification would cause the CRC check to fail.
So I really would explore the top suggestion first :>
Anders
8th April 2010 16:41 UTC
No, there is no way to add/replace files AFAIK, but it is open source so there is nothing stopping you from rolling your own