Archive: How to "recurse" a project with so many subdirectories and files?


How to "recurse" a project with so many subdirectories and files?
Currently I only use NSIS to configure 80 files but in comparison to INNO on the same 80 files, INNOs size weighs in at a wopping 600KB while NSIS weighs in at half that = 300KB.

I originally didn't wish to compile all files and folders in my project as INNO would end up at 46MB but if on a smaller scale NSIS is able to cut that size down to half then where possibly looking at an installation of about 23MB with NSIS (3MB better than WinRAR, 23 Better than INNO).

I've searched for how to include a sub-directory but unfortunately I came up empty except for this link http://nsis.sourceforge.net/archive/...php?pageid=270 but I think even this link is way off my topic...

Isn't there a really simple way to include a directory and all sub directories within it? I would really like to test and see if NSIS is able to dramatically cut down the whole setup size.

I tried a few things in which I cannot say exactly as I've tried them earlier before fully heading for a configuration installation only. But after a simple comparison so far, I am very curious if NSIS can possibly crush the size.

Thank you in advance. Thank you very much.


Sure there is a simple way. The documentation for the File Instruction says:-

If the /r switch is used, files and directories are added recursively. If is no trailing wildcard (e.g. File /r C:\whatever\mydir), then the whole tree of mydir will go in $OUTDIR\mydir. To put it in $OUTDIR, use File /r C:\whatever\mydir\*.*

Thank you Sunjammer,

I tried it and here is the results.

INNO 46MB
NSIS 42MB

Though their is only a 4MB difference their is no doubt a huge difference in the speed in which NSIS does its unpackaging.

INNO takes more than five minutes.
NSIS takes less than one minute.

This was tested on my 1.2GHz notebook. I didn't compare times to the exact second and it is just a rough estimate with as little exaggeration as possible.

Currently I use WinRAR to package up the beef of my project and bury NSIS inside of it which only takes care of the configuration files. Is their any tricks in getting NSIS to package lighter?

Just curious, thanks again in advance :)


You can use NSIS for the compression and the BZIP2 compression method.

If you include already compressed files, turn off the NSIS compression.


Thank you Joost,

I just now applied the bZIP2 compression and here are the new results.

9,200 files average with a dry weight of 130MB.

Inno 3.0.6.3   -  46MB Extracts at over 5 minutes
NSIS 2.0b4 - 33MB Extracts in under 1 minute
It is pretty obvious NSIS is the winner hands down in these two fields. Is their anyway to tell NSIS which files not to compress (e.g. *.exe)?

I am really trying to get the compression to right under 30MB or even 31MB as then that will match the WinRAR EXE feature with a recovery option of 10.

BTW, Does NSIS have a recovery option? I noticed upon launching the 33MB file it did a verification which was really cool. I am really just curious if NSIS has a native and hidden option for recovery.

Thank you Joost

What about 7zip?
You would have to use the command-line 7zip program (www.7zip.org (site is down :()) , there would be no extraction process, but it's a great compression method!

-Stu


I knew about 7zip for a while and do agree it being great if not the best compression on the globe at the moment. I was hoping though, using just one EXE (NSIS) I can somehow crush my installation to its max.

I believe I reached that threshold though with NSIS and here is a another comparison tested on a 1.2GHz, 512RAM, Athlon XP system.

Inno 3.0.6.3   -  46MB Extracts at over 5 minutes
NSIS 2.0b4 - 33MB Extracts in under 1 minute
7ZIP 2.30Beta - 24MB Extracts in under 1 minute
One thing which I didn't compare was the speeds in which all packages compress. Here is a rough estimate...
Inno 3.0.6.3   -  9,200 Files 130MB compression takes 20 minutes
NSIS 2.0b4 - 9,200 Files 130MB Compression takes but a few minutes
7ZIP 2.30Beta - 9,200 Files 130MB Compression takes 15 minutes
Come to think about it and NSIS leads except in the fact its final compressed size is not as awesome as 7ZIP. It is obvious 7ZIP wins in the final compressed arena but is their a dark horse solution involving NSIS alone?

Afrow UK, I like 7ZIP indeed I do but how would 7ZIP be applied with NSIS? Do I simply 7ZIP first and then wrap it with NSIS? Can NSIS pass parameters to 7ZIP and hide it from displaying? Can NSIS unwrap the 7ZIP directly as according to install?

I would indeed like to save 9MB across the wire but can you offer me an idea about how best to make it look as NSIS as possible without putting 2 24MB files on the users system? (e.g NSIS extracts everything) and not another executable for the user to execute.

Thank you Afrow UK, 7ZIP does sound like a good temporary solution until NSIS is able to conquer it. I look forward to reading your reply. Thanks again :)

I remember kichik was working implementing 7zip to NSIS. But I remember he told us he had to manually rewrite all code to C.

You can pack the 7zip uncompressor and execute it with nsEXEC so it won't show a dos window.

So, you unpack the un7zipper and the .7z file to a temp folder and send with nsEXEC a command line. This would double the time (one minute to unpack the .7z file from nsis and another to un7zip it), but you'll have one single exe to give away :weird:

btw, the website for 7zip is www.7-zip.org, I always forget the dash too.:rolleyes:


lol thanks :)
I used the 7-zip command line app (7za) to make up just standard zip files for people that want to zip up their Quake2 D-Day maps and then upload them to the web.
I should have used a smaller command-line app, but it doesn't matter because the installer exe was still only 300kb

If you would like to look at my app, it's here: http://dynamic.gamespy.com/~dday/ib3...t=ST;f=2;t=983

-Stu


ok its official, I've 7zipped the meat of the package with "7za.exe" thanks Afrow UK and n0On3 and zlibbed it up with NSIS. Believe it or not it takes NSIS just "One Second" to extract it and the entire installer stills takes under one minute to finish on my machine.

That is in a word breathtaking. My installer currently stands at 24MB instead of 33MB and still extracts just as fast. In another word, amazing.

Just one question for you 7ZIP heads out there. 7za.exe is the right program which should run on most Window platforms correct?

Thats it, I should be done with NSIS and am very happy with the outcome. Truly amazing. I will post my source back to NSIS as my project is open source anyway. Hopefully it can help others :)

Thank you to everyone :)


Yep, 7-zip supports all Win32 versions.