X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Finstall4j%2Fauto_file_associations.pl;h=76137783553cb3707267a19e36c783a96629cadd;hb=6f88432059289564bc5349f16123b25021796af0;hp=e59044fcc1cc2fe28a69b03aac8fbac5750e00ac;hpb=8b9d90df012b9561fda5142c48a5e26946401fa3;p=jalview.git diff --git a/utils/install4j/auto_file_associations.pl b/utils/install4j/auto_file_associations.pl index e59044f..7613778 100755 --- a/utils/install4j/auto_file_associations.pl +++ b/utils/install4j/auto_file_associations.pl @@ -2,6 +2,15 @@ use strict; +my $i4jversion = 7; +if ($ARGV[0] eq "-v") { + shift @ARGV; + $i4jversion = shift @ARGV; + die("-v i4jversion must be an integer [probably 7 or 8]") unless $i4jversion =~ m/^\d+$/; +} +# backwards compatibility +$i4jversion = "" if $i4jversion < 8; + my $fileformats = $ARGV[0]; $fileformats = "../../src/jalview/io/FileFormat.java" unless $fileformats; @@ -41,7 +50,7 @@ my $add_extensions = { my @put_first = qw(jalview jvl); my $mactemplatefile = "file_associations_template-Info_plist.xml"; -my $i4jtemplatefile = "file_associations_template-install4j.xml"; +my $i4jtemplatefile = ($i4jversion >= 8)?"file_associations_template-install4j${i4jversion}.xml"; my $mactemplate; my $i4jtemplate; open(MT,"<$mactemplatefile") or dir("Could not open '$mactemplatefile' for reading");