From: Luis Lavena Date: 2007-10-24T05:30:01+09:00 Subject: Re: Stripping down One-Click Ruby Installer folder for deployment On Oct 23, 4:53 pm, "Jano Svitok" wrote: > On 10/23/07, Philippe Lang wrote: > > > > > This is the script I use. It strips down the c:\ruby directory from 179 > > MB to 51 MB on my computer, and apparently, everything works. It is > > still very big, but acceptable, especially when compressed in RAR: 14.3 > > MB. > > > ------------------------------------------------------------ > > $OLD_PATH = 'c:\\ruby' > > $NEW_PATH = 'c:\\ruby_stripped' > > > require 'fileutils' > > > FileUtils.rm_rf($NEW_PATH) > > FileUtils.mkdir($NEW_PATH) > > FileUtils.cp_r($OLD_PATH + '\\bin', $NEW_PATH + '\\bin') > > FileUtils.cp_r($OLD_PATH + '\\lib', $NEW_PATH + '\\lib') > > FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\doc') > > ------------------------------------------------------------ > > > If anyone is able to strip down the c:\ruby directory for deployment > > even more, your help is welcome! > > You may try (but not I am not sure if this will work, I *guess* it > will be regenerated on demand): > > FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\cache') > FileUtils.rm_rf($NEW_PATH + '\\lib\\ruby\\gems\\1.8\\source_cache') > > If you don't plan on compiling extensions, you may remove *.lib > > Download spacemonger to see what are the largest files/dirs. > > You may strip more stuff, depending on what do you need - there's a > lot of stuff for TK for example, just make sure your stuff still runs > ;-) The other, more complex, will involve use of something like Exerb [1] to trace what files your application use. (inside Exerb there is a tool called mkexy) This will generate a .exy file containing which file and paths (and extensions) are required by your application. You just need to add later the ruby.exe, rubyw.exe (if you are developing GUI applications) and of course msvcrt-libruby18.dll Try to recreate the folder structure listed in the .exy and just put there the files indicated. Use this carefully, I haven't tested enough to confirm work in all cases. Regards, Luis [1] http://exerb.sourceforge.jp/index.en.html