Archive: Listing installer contents


Listing installer contents
I want to obtain a listing of the contents of installers that I create (zlib compression) so that I can verify and record the contents (contents are dynamically determined at compile time).
Currently I do this manually using 7-zip which handles NSIS installers very well. Winzip on the other hand doesn't support the format.
However, I want to do this from a Java program. Can anyone give me a pointer to decoding NSIS installers using java.util.zip.* (assuming that's possible)? Alternatively, is there documentation on the NSIS installer file format?


This is not an answer to your question, but have you considered making a list during compilation? You can use !tempfile, then !appendfile, and at the end do !system 'copy "${TheTempFile}" "${__FILEDIR__}\FileLog.txt"' or something like that. Or if you want to use File /r or wildcards, you could make an NSIS executable that gets executed during compiletime (using !execute command), and generates a file list for you.

For even more advanced stuff, you could generate a second .nsi file during compiletime, and compile that and execute during compiletime. The sky's the limit.


No, I hadn't thought of that. Its a possible solution.
I would still prefer to actually examine the installer contents. But if I can't make any progress there, I'll consider generating the required listings during compilation.


Future NSIS builds may contain a compiletime function to enumerate files on the compiling system, specifically for generating file lists etc. No idea when this functionality will appear in trunk, though. Anders might have an idea... *cough*


In case you are able and willing to unpack your installer: did you play with http://nsis.sourceforge.net/NfUtils_...essStdSwitches ?
This will enable you to extract your files with a commandline-switch (/x) without actually running the installer's script.

nfUtils.exe itself supports this switch for demo-purposes (see also nfutils.exe /?), see http://nsis.sourceforge.net/NfUtils_header_file#Links

Be sure to use http://nsis.sourceforge.net/NfUtils_...nfu..21AddFile instad of the FILE-instruction in your installer script.


Originally posted by thammr
I want to obtain a listing of the contents of installers that I create (zlib compression) so that I can verify and record the contents (contents are dynamically determined at compile time).
Currently I do this manually using 7-zip which handles NSIS installers very well. Winzip on the other hand doesn't support the format.
However, I want to do this from a Java program. Can anyone give me a pointer to decoding NSIS installers using java.util.zip.* (assuming that's possible)? Alternatively, is there documentation on the NSIS installer file format?
7-Zip has a command-line version and can write its output to the STDOUT, Java can run external applications and capture the STDOUT. So where is the problem? Sure, you Java app won't be platform-independant anymore, as soon as you call external apps. But on the other hand, you can get 7-Zip for all relevant platforms, so this shouldn't be a real issue...

See also:
http://www.rgagnon.com/javadetails/java-0014.html