PDA

View Full Version : Selecting Directories



kgifford
12-19-2005, 07:56 PM
Spoon Installer: This program seems to be exactly what I require.
I am wondering if it is possible to select an entire directory and subdirectories at once. I have a folder of generated html and images with many files and subfolders. It would be time consuming to manually select everything. Is it possible to do this within the program or perhaps to manually edit a file to insert a file listing...?

Thank you

kgifford
12-19-2005, 10:27 PM
I couldnt get the gui to do what I wanted. I checked out the .spi file and wrote/modified a perl script to output the required text. Someone might find this useful someday.


*!/usr/bin/perl -w

use strict;

my $input_dir = "C:/Program Files/Wherever";

MAIN:
{
my @tree;
dirwalk ($input_dir,\@tree);


}

sub dirwalk
{
my ($dir,$tree) = @_ ;

push @{$tree},($dir =~ m*([^/]+$)*);

opendir DIR, $dir || die "Couldnt open $dir - $!\n";
my @entries = grep !/^\.{1,2}$/, readdir(DIR);
closedir (DIR);

foreach my $item (@entries)
{
my $fullpath = "$dir/$item";

if ( -d $fullpath )
{
dirwalk ( $fullpath,\@{$tree->[@{$tree}]});
}
else
{
print "[CopyFile]\n";
print "ToSet\n";
print "$fullpath\n\n";
}
}

}

Spoon
12-20-2005, 03:33 PM
Indeed the spi file is a simple for such modificaions.

Willb
12-22-2005, 08:08 AM
Hi,

Thanks for this wonderful piece of free software! Its very easy to use and flexibile at the same time :) One thing though, I too would like the select an entire dirctory, I'm not familiar with Perl scripts (I think i've used them once before, ages ago!) Would someone please inform me of how I can select an entire directory? (Maybe it's an idea for future versions?)

While on the topid of future versions (I don't know if you plan to release anymore) What I think I would like to see is a feature where the installer looks up the value of a specific registry key (Say the install path of another program) and then uses that value to determine the SpoonInstaller created installer's installation path. This would be very handy for installing modifications to games, for example.

Thanks for the help :smile2:

Spoon
12-22-2005, 04:06 PM
My Music Converter looks up the path of an icon and uses that, occasionally it seems to fail (as posted on this forum) so I have been thinking of such a registry value.

Another feature soon to be added is one that will install files specific to a Windows Version, so for XP 64 a file is installed, on XP another.