title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Selecting Directories

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kgifford

    • Dec 2005
    • 2

    Selecting Directories

    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
    Last edited by kgifford; December 20, 2005, 12:02 AM.
  • kgifford

    • Dec 2005
    • 2

    #2
    Re: Selecting Directories

    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.

    Code:
    #!/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";
              }
          }
    
    }

    Comment

    • Spoon
      Administrator
      • Apr 2002
      • 44509

      #3
      Re: Selecting Directories

      Indeed the spi file is a simple for such modificaions.
      Spoon
      www.dbpoweramp.com

      Comment

      • Willb

        • Dec 2005
        • 1

        #4
        Re: Selecting Directories

        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:

        Comment

        • Spoon
          Administrator
          • Apr 2002
          • 44509

          #5
          Re: Selecting Directories

          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.
          Spoon
          www.dbpoweramp.com

          Comment

          Working...

          ]]>