0

I'm making installer program using VMware InstallBuilder (previously named Bitrock InstallBuilder), and need to ensure the non-existence of some files in target directory. Here I describe its logic in Perl fake code:

sub validate_target_dir
{
    my $target_dir = shift;
    # find all candidate check files
    foreach my $file ( glob( "$target_dir/*_vol0.dat" ) )
    {
        my $fname = basename($file);
        # fail if has any data file other than myproduct
        if ($fname ne "myproduct_vol0.dat") { return 0; }
    }
    return 1;
}

However I don't know how to implement similar logic in InstallBuilder, as its findFile action don't return multiple matching files (only the first one).

jiandingzhe
  • 1,881
  • 15
  • 35

1 Answers1

0

At current, I find a somewhat twisted way to do it: implement the function in a shell script. InstallBuilder allows you to unpack contents programmatically, so I can pack the script into the installer package and unpack&run it at needed time.

I still seek if there's possible way that purely implemented by InstallBuilder itself.

jiandingzhe
  • 1,881
  • 15
  • 35