thammr
13th November 2012 12:29 UTC
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?
MSG
13th November 2012 17:10 UTC
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.
thammr
14th November 2012 08:17 UTC
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.
MSG
14th November 2012 15:39 UTC
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*
niteflyer
19th November 2012 15:11 UTC
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.
LoRd_MuldeR
20th November 2012 00:45 UTC
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