From b831a65e06cb39cac1de962e75c92f4a7946c423 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 2 Nov 2022 21:36:46 +0000 Subject: [PATCH] JAL-4054 Altered file association templates and generated install4j xml and Info.plist snippets. --- build.gradle | 2 +- gradle.properties | 6 +- utils/install4j/auto_file_associations-i4j10.pl | 227 +++ .../file_associations_auto-Info_plist.xml | 50 + .../file_associations_auto-install4j10.xml | 1125 +++++++++++++++ .../file_associations_template-Info_plist.xml | 2 + .../file_associations_template-install4j10.xml | 45 + utils/install4j/install4j10_template.install4j | 1511 ++++++++++++++++++++ 8 files changed, 2964 insertions(+), 4 deletions(-) create mode 100755 utils/install4j/auto_file_associations-i4j10.pl create mode 100644 utils/install4j/file_associations_auto-install4j10.xml create mode 100644 utils/install4j/file_associations_template-install4j10.xml create mode 100644 utils/install4j/install4j10_template.install4j diff --git a/build.gradle b/build.gradle index f25088b..851c5f6 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ plugins { id 'eclipse' id "com.diffplug.gradle.spotless" version "3.28.0" id 'com.github.johnrengelman.shadow' version '4.0.3' - id 'com.install4j.gradle' version '9.0.6' + id 'com.install4j.gradle' version '10.0.3' id 'com.dorongold.task-tree' version '2.1.0' // only needed to display task dependency tree with gradle task1 [task2 ...] taskTree id 'com.palantir.git-version' version '0.13.0' apply false } diff --git a/gradle.properties b/gradle.properties index acb65e9..e42f8b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -129,14 +129,14 @@ flexmark_css = utils/doc/github.css channel_properties_dir = utils/channels channel_props = channel.props -install4j_home_dir = ~/buildtools/install4j9 +install4j_home_dir = ~/buildtools/install4j10 install4j_copyright_message = ... install4j_bundle_id = org.jalview.jalview-desktop install4j_utils_dir = utils/install4j install4j_images_dir = utils/install4j -install4j_template = install4j9_template.install4j +install4j_template = install4j10_template.install4j install4j_info_plist_file_associations = file_associations_auto-Info_plist.xml -install4j_installer_file_associations = file_associations_auto-install4j8.xml +install4j_installer_file_associations = file_associations_auto-install4j10.xml #install4j_DMG_uninstaller_app_files = uninstall_old_jalview_files.xml install4j_build_dir = build/install4j install4j_executable_name = jalviewg diff --git a/utils/install4j/auto_file_associations-i4j10.pl b/utils/install4j/auto_file_associations-i4j10.pl new file mode 100755 index 0000000..f7e17a1 --- /dev/null +++ b/utils/install4j/auto_file_associations-i4j10.pl @@ -0,0 +1,227 @@ +#!/usr/bin/env perl + +use strict; + +my $i4jversion = 10; +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+$/; +} + +my $fileformats = $ARGV[0]; +$fileformats = "../../src/jalview/io/FileFormat.java" unless $fileformats; + +# default mimetype will be text/x-$shortname +# TODO: find an actual extension for mat, see JAL-Xxxxx for outstanding issues too +# TODO: look up standard mime type used for BLASTfmt matrices, etc +my $mimetypes = { + rnaml => "application/rnaml+xml", + biojson => "application/x-jalview-biojson+json", + jnet => "application/x-jalview-jnet+text", + features => "application/x-jalview-features+text", + scorematrix => "application/x-jalview-scorematrix+text", + pdb => "chemical/x-pdb", + mmcif => "chemical/x-cif", + mmcif2 => "chemical/x-mmcif", + jalview => "application/x-jalview+xml+zip", + jvl => "application/x-jalview-jvl+text", + annotations => "application/x-jalview-annotations+text", +}; + +my @dontaddshortname = qw(features json); +my @dontaddextension = qw(html xml json jar mfa fastq); +my $add_associations = { + biojson => {shortname=>"biojson",name=>"BioJSON",extensions=>["biojson"]}, + gff2 => {shortname=>"gff2",name=>"Generic Features Format v2",extensions=>["gff2"]}, + gff3 => {shortname=>"gff3",name=>"Generic Features Format v3",extensions=>["gff3"]}, + features => {shortname=>"features",name=>"Jalview Features",extensions=>["features","jvfeatures"]}, + annotations => {shortname=>"annotations",name=>"Jalview Annotations",extensions=>["annotations","jvannotations"]}, + mmcif => {shortname=>"mmcif",name=>"CIF",extensions=>["cif"]}, + mmcif2 => {shortname=>"mmcif2",name=>"mmCIF",extensions=>["mcif","mmcif"]}, + jvl => {shortname=>"jvl",name=>"Jalview Launch",extensions=>["jvl"],iconfile=>"jvl_file"}, + jnet => {shortname=>"jnet",name=>"JnetFile",extensions=>["concise","jnet"]}, + scorematrix => {shortname=>"scorematrix",name=>"Substitution Matrix",extensions=>["mat"]}, +}; +my $add_extensions = { + blc => ["blc"], +}; +my @put_first = qw(jalview jvl); +my @owner = @put_first; + +my @non_primary = qw(mmcif mmcif2 pdb); + +my $v = ($i4jversion >= 8)?$i4jversion:""; +my $i4jtemplatefile = "file_associations_template-install4j${v}.xml"; +my $i4jtemplate; +my $mactemplatefile = "file_associations_template-Info_plist.xml"; +my $mactemplate; + +open(MT,"<$mactemplatefile") or die("Could not open '$mactemplatefile' for reading"); +while(){ + $mactemplate .= $_; +} +close(MT); +open(IT,"<$i4jtemplatefile") or die("Could not open '$i4jtemplatefile' for reading"); +while(){ + $i4jtemplate .= $_; +} +close(IT); +my $macauto; +my $i4jauto; + +my $macautofile = $mactemplatefile; +$macautofile =~ s/template/auto$1/; + +my $i4jautofile = $i4jtemplatefile; +$i4jautofile =~ s/template/auto$1/; + +for my $key (sort keys %$add_associations) { + my $a = $add_associations->{$key}; + warn("Known file association for $a->{shortname} (".join(",",@{$a->{extensions}}).")\n"); +} + +open(MA,">$macautofile") or die ("Could not open '$macautofile' for writing"); +print MA "CFBundleDocumentTypes\n\n\n"; + +open(IA,">$i4jautofile") or die ("Could not open '$i4jautofile' for writing"); + +open(IN, "<$fileformats") or die ("Could not open '$fileformats' for reading"); +my $id = 10000; +my $file_associations = {}; +while(my $line = ) { + $line =~ s/\s+/ /g; + $line =~ s/(^ | $)//g; + if ($line =~ m/^(\w+) ?\( ?"([^"]*)" ?, ?"([^"]*)" ?, ?(true|false) ?, ?(true|false) ?\)$/i) { + my $shortname = lc($1); + next if (grep($_ eq $shortname, @dontaddshortname)); + my $name = $2; + my $extensions = $3; + $extensions =~ s/\s+//g; + my @possextensions = map(lc($_),split(m/,/,$extensions)); + my @extensions; + my $addext = $add_extensions->{$shortname}; + if (ref($addext) eq "ARRAY") { + push(@possextensions, @$addext); + } + for my $possext (@possextensions) { + next if grep($_ eq $possext, @extensions); + next if grep($_ eq $possext, @dontaddextension); + push(@extensions,$possext); + } + next unless scalar(@extensions); + $file_associations->{$shortname} = { + shortname => $shortname, + name => $name, + extensions => \@extensions + }; + warn("Reading file association for $shortname (".join(",",@extensions).")\n"); + } +} +close(IN); + +my %all_associations = (%$file_associations, %$add_associations); + +my @ordered = (@put_first, @non_primary); +for my $key (sort keys %all_associations) { + next if grep($_ eq $key, @ordered); + push(@ordered, $key); +} +my $num = $#ordered + 1; + +warn("--\n"); + +my $i4jcount = 0; +for my $shortname (@ordered) { + my $a = $all_associations{$shortname}; + next if (ref($a) ne "HASH"); + + my $name = $a->{name}; + my $extensions = $a->{extensions}; + my $mimetype = $mimetypes->{$shortname}; + $mimetype = "application/x-$shortname+txt" unless $mimetype; + + my $iconfile = $a->{iconfile}; + $iconfile = "Jalview-File" unless $iconfile; + + my $owner = grep($_ eq $shortname, @owner); + my $primary = (! grep($_ eq $shortname, @non_primary)); + my $primarystring = $primary?"true":"false"; + #my $role = $owner?"Owner":($primary?"Editor":"Viewer"); + my $role = $primary?"Editor":"Viewer"; + my $rank = $owner?"Owner":($primary?"Default":"Alternate"); + + my @extensions = @$extensions; + + my $xname = xml_escape($name); + my $xmimetype = xml_escape($mimetype); + my $xshortname = xml_escape($shortname); + my $xiconfile = xml_escape($iconfile); + my $xrole = xml_escape($role); + my $xROLE = xml_escape(uc($role)); + my $xrank = xml_escape($rank); + my $xprimarystring = xml_escape($primarystring); + + my $macentry = $mactemplate; + $macentry =~ s/\$\$NAME\$\$/$xname/g; + $macentry =~ s/\$\$SHORTNAME\$\$/$xshortname/g; + $macentry =~ s/\$\$MIMETYPE\$\$/$xmimetype/g; + $macentry =~ s/\$\$ICONFILE\$\$/$xiconfile/g; + $macentry =~ s/\$\$ROLE\$\$/$xrole/g; + $macentry =~ s/\$\$RANK\$\$/$xrank/g; + $macentry =~ s/\$\$PRIMARY\$\$/$xprimarystring/g; + while ($macentry =~ m/\$\$([^\$]*)EXTENSIONS([^\$]*)\$\$/) { + my $pre = $1; + my $post = $2; + my $macextensions; + for my $ext (@extensions) { + my $xext = xml_escape($ext); + $macextensions .= $pre.$xext.$post; + } + $macentry =~ s/\$\$${pre}EXTENSIONS${post}\$\$/$macextensions/g; + } + print MA $macentry; + + my $i4jentry = $i4jtemplate; + $i4jentry =~ s/\$\$NAME\$\$/$xname/g; + $i4jentry =~ s/\$\$SHORTNAME\$\$/$xshortname/g; + $i4jentry =~ s/\$\$MIMETYPE\$\$/$xmimetype/g; + $i4jentry =~ s/\$\$ICONFILE\$\$/$xiconfile/g; + $i4jentry =~ s/\$\$PRIMARY\$\$/$xprimarystring/g; + $i4jentry =~ s/\$\$MACASSOCIATIONROLE\$\$/$xROLE/g; + + my $ext = join(",",sort(@extensions)); + my $xdisplayext = xml_escape(join(", ", map(".$_",sort(@extensions)))); + my $progresspercent = int(($i4jcount/$num)*100); + $progresspercent = 100 if $progresspercent > 100; + $i4jcount++; + my $xext = xml_escape($ext); + my $addunixextension = "true"; + + $i4jentry =~ s/\$\$ADDUNIXEXTENSION\$\$/$addunixextension/g; + $i4jentry =~ s/\$\$EXTENSION\$\$/$xext/g; + $i4jentry =~ s/\$\$DISPLAYEXTENSION\$\$/$xdisplayext/g; + $i4jentry =~ s/\$\$PROGRESSPERCENT\$\$/$progresspercent/g; + $i4jentry =~ s/\$\$ID\$\$/$id/g; + $id++; + $i4jentry =~ s/\$\$ID1\$\$/$id/g; + $id++; + $i4jentry =~ s/\$\$ID2\$\$/$id/g; + $id++; + + print IA $i4jentry; + + delete $all_associations{$shortname}; + warn("Writing entry for $name (".join(",",@$extensions).": $mimetype)\n"); +} + +close(IA); +print MA "\n"; +close(MA); + +sub xml_escape { + my $x = shift; + # stolen from Pod::Simple::XMLOutStream in base distro + $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}a-zA-Z0-9])/'&#'.(ord($1)).';'/eg; + return $x; +} diff --git a/utils/install4j/file_associations_auto-Info_plist.xml b/utils/install4j/file_associations_auto-Info_plist.xml index 0b927a8..2e23321 100644 --- a/utils/install4j/file_associations_auto-Info_plist.xml +++ b/utils/install4j/file_associations_auto-Info_plist.xml @@ -12,6 +12,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Owner CFBundleTypeMIMETypes application/x-jalview+xml+zip @@ -31,6 +33,8 @@ jvl_file.icns CFBundleTypeRole Editor +LSHandlerRank +Owner CFBundleTypeMIMETypes application/x-jalview-jvl+text @@ -50,6 +54,8 @@ Jalview-File.icns CFBundleTypeRole Viewer +LSHandlerRank +Alternate CFBundleTypeMIMETypes chemical/x-cif @@ -70,6 +76,8 @@ Jalview-File.icns CFBundleTypeRole Viewer +LSHandlerRank +Alternate CFBundleTypeMIMETypes chemical/x-mmcif @@ -90,6 +98,8 @@ Jalview-File.icns CFBundleTypeRole Viewer +LSHandlerRank +Alternate CFBundleTypeMIMETypes chemical/x-pdb @@ -109,6 +119,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-amsa+txt @@ -129,6 +141,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-jalview-annotations+text @@ -148,6 +162,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-jalview-biojson+json @@ -167,6 +183,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-blc+txt @@ -186,6 +204,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-clustal+txt @@ -205,6 +225,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-embl+txt @@ -225,6 +247,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-fasta+txt @@ -245,6 +269,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-jalview-features+text @@ -265,6 +291,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-genbank+txt @@ -284,6 +312,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-gff2+txt @@ -303,6 +333,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-gff3+txt @@ -323,6 +355,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-jalview-jnet+text @@ -342,6 +376,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-msf+txt @@ -361,6 +397,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-pfam+txt @@ -380,6 +418,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-phylip+txt @@ -399,6 +439,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-pileup+txt @@ -418,6 +460,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-pir+txt @@ -437,6 +481,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/rnaml+xml @@ -456,6 +502,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-jalview-scorematrix+text @@ -476,6 +524,8 @@ Jalview-File.icns CFBundleTypeRole Editor +LSHandlerRank +Default CFBundleTypeMIMETypes application/x-stockholm+txt diff --git a/utils/install4j/file_associations_auto-install4j10.xml b/utils/install4j/file_associations_auto-install4j10.xml new file mode 100644 index 0000000..ee70251 --- /dev/null +++ b/utils/install4j/file_associations_auto-install4j10.xml @@ -0,0 +1,1125 @@ + + + + Jalview (.jvp) + Creating file associations... + + + + + + + + + + + + + + Jalview File + jvp + JALVIEW + + + + + + + Jalview-File.png + + + application/x-jalview+xml+zip + + + Jalview-File.ico + + + + + + + + + + Jalview Launch (.jvl) + Creating file associations... + + + + + + + + + + + + + + Jalview Launch File + jvl + JALVIEW + + + + + + + jvl_file.png + + + application/x-jalview-jvl+text + + + jvl_file.ico + + + + + + + + + + CIF (.cif) + Creating file associations... + + + + + + + + + + + + + + CIF File + cif + JALVIEW + + + + + + + Jalview-File.png + + + chemical/x-cif + + + Jalview-File.ico + + + + + + + + + + mmCIF (.mcif, .mmcif) + Creating file associations... + + + + + + + + + + + + + + mmCIF File + mcif,mmcif + JALVIEW + + + + + + + Jalview-File.png + + + chemical/x-mmcif + + + Jalview-File.ico + + + + + + + + + + PDB (.ent, .pdb) + Creating file associations... + + + + + + + + + + + + + + PDB File + ent,pdb + JALVIEW + + + + + + + Jalview-File.png + + + chemical/x-pdb + + + Jalview-File.ico + + + + + + + + + + AMSA (.amsa) + Creating file associations... + + + + + + + + + + + + + + AMSA File + amsa + JALVIEW + + + + + + + Jalview-File.png + + + application/x-amsa+txt + + + Jalview-File.ico + + + + + + + + + + Jalview Annotations (.annotations, .jvannotations) + Creating file associations... + + + + + + + + + + + + + + Jalview Annotations File + annotations,jvannotations + JALVIEW + + + + + + + Jalview-File.png + + + application/x-jalview-annotations+text + + + Jalview-File.ico + + + + + + + + + + BioJSON (.biojson) + Creating file associations... + + + + + + + + + + + + + + BioJSON File + biojson + JALVIEW + + + + + + + Jalview-File.png + + + application/x-jalview-biojson+json + + + Jalview-File.ico + + + + + + + + + + BLC (.blc) + Creating file associations... + + + + + + + + + + + + + + BLC File + blc + JALVIEW + + + + + + + Jalview-File.png + + + application/x-blc+txt + + + Jalview-File.ico + + + + + + + + + + Clustal (.aln) + Creating file associations... + + + + + + + + + + + + + + Clustal File + aln + JALVIEW + + + + + + + Jalview-File.png + + + application/x-clustal+txt + + + Jalview-File.ico + + + + + + + + + + ENA Flatfile (.txt) + Creating file associations... + + + + + + + + + + + + + + ENA Flatfile File + txt + JALVIEW + + + + + + + Jalview-File.png + + + application/x-embl+txt + + + Jalview-File.ico + + + + + + + + + + Fasta (.fa, .fasta) + Creating file associations... + + + + + + + + + + + + + + Fasta File + fa,fasta + JALVIEW + + + + + + + Jalview-File.png + + + application/x-fasta+txt + + + Jalview-File.ico + + + + + + + + + + Jalview Features (.features, .jvfeatures) + Creating file associations... + + + + + + + + + + + + + + Jalview Features File + features,jvfeatures + JALVIEW + + + + + + + Jalview-File.png + + + application/x-jalview-features+text + + + Jalview-File.ico + + + + + + + + + + GenBank Flatfile (.gb, .gbk) + Creating file associations... + + + + + + + + + + + + + + GenBank Flatfile File + gb,gbk + JALVIEW + + + + + + + Jalview-File.png + + + application/x-genbank+txt + + + Jalview-File.ico + + + + + + + + + + Generic Features Format v2 (.gff2) + Creating file associations... + + + + + + + + + + + + + + Generic Features Format v2 File + gff2 + JALVIEW + + + + + + + Jalview-File.png + + + application/x-gff2+txt + + + Jalview-File.ico + + + + + + + + + + Generic Features Format v3 (.gff3) + Creating file associations... + + + + + + + + + + + + + + Generic Features Format v3 File + gff3 + JALVIEW + + + + + + + Jalview-File.png + + + application/x-gff3+txt + + + Jalview-File.ico + + + + + + + + + + JnetFile (.concise, .jnet) + Creating file associations... + + + + + + + + + + + + + + JnetFile File + concise,jnet + JALVIEW + + + + + + + Jalview-File.png + + + application/x-jalview-jnet+text + + + Jalview-File.ico + + + + + + + + + + MSF (.msf) + Creating file associations... + + + + + + + + + + + + + + MSF File + msf + JALVIEW + + + + + + + Jalview-File.png + + + application/x-msf+txt + + + Jalview-File.ico + + + + + + + + + + PFAM (.pfam) + Creating file associations... + + + + + + + + + + + + + + PFAM File + pfam + JALVIEW + + + + + + + Jalview-File.png + + + application/x-pfam+txt + + + Jalview-File.ico + + + + + + + + + + PHYLIP (.phy) + Creating file associations... + + + + + + + + + + + + + + PHYLIP File + phy + JALVIEW + + + + + + + Jalview-File.png + + + application/x-phylip+txt + + + Jalview-File.ico + + + + + + + + + + PileUp (.pileup) + Creating file associations... + + + + + + + + + + + + + + PileUp File + pileup + JALVIEW + + + + + + + Jalview-File.png + + + application/x-pileup+txt + + + Jalview-File.ico + + + + + + + + + + PIR (.pir) + Creating file associations... + + + + + + + + + + + + + + PIR File + pir + JALVIEW + + + + + + + Jalview-File.png + + + application/x-pir+txt + + + Jalview-File.ico + + + + + + + + + + RNAML (.rnaml) + Creating file associations... + + + + + + + + + + + + + + RNAML File + rnaml + JALVIEW + + + + + + + Jalview-File.png + + + application/rnaml+xml + + + Jalview-File.ico + + + + + + + + + + Substitution Matrix (.mat) + Creating file associations... + + + + + + + + + + + + + + Substitution Matrix File + mat + JALVIEW + + + + + + + Jalview-File.png + + + application/x-jalview-scorematrix+text + + + Jalview-File.ico + + + + + + + + + + Stockholm (.stk, .sto) + Creating file associations... + + + + + + + + + + + + + + Stockholm File + stk,sto + JALVIEW + + + + + + + Jalview-File.png + + + application/x-stockholm+txt + + + Jalview-File.ico + + + + + + diff --git a/utils/install4j/file_associations_template-Info_plist.xml b/utils/install4j/file_associations_template-Info_plist.xml index a260658..afac20c 100644 --- a/utils/install4j/file_associations_template-Info_plist.xml +++ b/utils/install4j/file_associations_template-Info_plist.xml @@ -9,6 +9,8 @@ $$ $$ICONFILE$$.icns CFBundleTypeRole $$ROLE$$ +LSHandlerRank +$$RANK$$ CFBundleTypeMIMETypes $$MIMETYPE$$ diff --git a/utils/install4j/file_associations_template-install4j10.xml b/utils/install4j/file_associations_template-install4j10.xml new file mode 100644 index 0000000..8663ed9 --- /dev/null +++ b/utils/install4j/file_associations_template-install4j10.xml @@ -0,0 +1,45 @@ + + + + $$NAME$$ ($$DISPLAYEXTENSION$$) + Creating file associations... + + + + + + + + + + + + + + $$NAME$$ File + $$EXTENSION$$ + JALVIEW + + + + + + + $$ICONFILE$$.png + + + $$MIMETYPE$$ + + + $$ICONFILE$$.ico + + + + + + diff --git a/utils/install4j/install4j10_template.install4j b/utils/install4j/install4j10_template.install4j new file mode 100644 index 0000000..c7d0131 --- /dev/null +++ b/utils/install4j/install4j10_template.install4j @@ -0,0 +1,1511 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + *.dylib + *.so + *.jnilib + unpack200 + tnameserv + servertool + rmiregistry + rmid + policytool + pack200 + orbd + keytool + jjs + java + jspawnhelper + libfreetype.dylib.6 + applet + jaotc + jfr + jrunscript + libjli.dylib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${compiler:file("${compiler:INFO_PLIST_FILE_ASSOCIATIONS_FILE}")} + + + + + + + + + + + + + + + + + + + 255 + 255 + 255 + 255 + + + 49 + 52 + 53 + 255 + + + + + + + + + + + 255 + 255 + 255 + 255 + + + + + + ${compiler:JALVIEW_DIR}/${compiler:BACKGROUND} + + + + + 5 + 10 + 10 + 10 + + + + + imageAnchor + imageEdgeBackgroundColor + imageFile + + + + + + + + + + labelText + + + + + + + + + + + + + + + + + String userHome = (String)context.getVariable("sys.userHome"); + +ArrayList<String> tryPaths = new ArrayList<> (); +tryPaths.add(userHome + File.separator + "bin"); +tryPaths.add(userHome + File.separator + ".local" + File.separator + "bin"); +tryPaths.add(userHome + File.separator + "local" + File.separator + "bin"); +tryPaths.add(userHome + File.separator + "opt" + File.separator + "bin"); + +if (Util.isMacOS()) { // && root permission? + tryPaths.add(File.separator + "usr" + File.separator + "local" + File.separator + "bin"); +} + +for (int i = 0; i < tryPaths.size(); i++) { + String tryPath = tryPaths.get(i); + File unixUserBinDir = new File(tryPath); + if (unixUserBinDir.exists()) { + return tryPath; + } +} + +return null; + + + + unixUserBinDir + + Util.isLinux() || Util.isUnixInstaller() || Util.isMacOS() + + + + + + String javaHome = System.getProperty("java.home"); +String appName = ((String)context.getCompilerVariable("JALVIEW_APPLICATION_NAME")) + ".app"; +int i = javaHome.indexOf(appName); +String wrapperLink = null; +if (i > -1) { + wrapperLink = javaHome.substring(0, i) + appName + File.separator + "Contents" + File.separator + "MacOS" + File.separator + ((String)context.getCompilerVariable("WRAPPER_LINK")); +} +return wrapperLink; + + + + macWrapperLinkLocation + + Util.isMacOS() + + + + + + + + + + + + + + 255 + 255 + 255 + 255 + + + 49 + 52 + 53 + 255 + + + + + + + + + + + + 25 + 143 + 220 + 255 + + + 0 + 74 + 151 + 255 + + + + + + + ${compiler:JALVIEW_DIR}/${compiler:BACKGROUND} + + + + + 5 + 10 + 10 + 10 + + + + + imageAnchor + imageEdgeBackgroundColor + imageFile + + + + + + + + + sys.installationDir + + + context.getBooleanVariable("sys.confirmedUpdateInstallation") + + + + + + ${form:welcomeMessage} + + !context.isConsole() + + + + + + String message = context.getMessage("ConsoleWelcomeLabel", context.getApplicationName()); +return console.askOkCancel(message, true); + + + + + + + + updateCheck + + + + + ${i18n:ClickNext} + + + + + + !context.getBooleanVariable("sys.confirmedUpdateInstallation") + + + + + sys.installationDir + + + context.getVariable("sys.responseFile") == null + + + + + + ${i18n:SelectDirLabel(${compiler:sys.fullName})} + + + + + + + + allowSpacesOnUnix + checkFreeSpace + checkWritable + existingDirWarning + manualEntryAllowed + showFreeDiskSpace + showRequiredDiskSpace + standardValidation + suggestAppDir + validateApplicationId + validationScript + + + + + + + + + ${i18n:SelectComponentsLabel2} + + !context.isConsole() + + + + + + + selectionChangedScript + + + + + + + + + ${i18n:SelectAssociationsLabel} + + + + + + + + + + showSelectionButtons + selectionButtonPosition + + + + + + + + + + + ${compiler:APPLICATION_CATEGORIES} + + + + Examples + + + examples + + + + + + ${compiler:JALVIEW_NAME} + ${i18n:UninstallerMenuEntry(${compiler:sys.fullName})} + + !context.getBooleanVariable("sys.programGroupDisabled") + + + + + ${compiler:APPLICATION_CATEGORIES} + ${compiler:JALVIEW_NAME} + ${i18n:UninstallerMenuEntry(${compiler:sys.fullName})} + + !context.getBooleanVariable("sys.programGroupDisabled") + + + + ${compiler:sys.fullName} ${compiler:sys.version} + + + + + + + + + + + + true + + + + 121 + + + + + + + + Creating file associations... + + + + + + + + + + + + + + This action, identified by its name "EXTENSIONS_REPLACED_BY_GRADLE", will be replaced by gradle with the contents of file 'file_associations_auto_install4j.xml'. + extensions_to_be_replaced_by_gradle + JALVIEW + + + + + + + Finished creating file associations + + + + + + + + + + + + + + JALVIEW + jalview + + + + + JALVIEW + jalviews + + + + + JALVIEW + ${compiler:EXTRA_SCHEME} + + + + + + + ${i18n:WizardPreparing} + + + + + + + + + + ${compiler:APPLICATION_CATEGORIES} + ${compiler:JALVIEW_APPLICATION_NAME} + + + ${installer:sys.contentDir}/${compiler:EXECUTABLE_NAME} + + + + + ${compiler:JALVIEW_DIR}/${compiler:WINDOWS_ICONS_FILE} + + + ${compiler:JALVIEW_NAME} + + + ${compiler:JALVIEW_DIR}/${compiler:PNG_ICON_FILE} + + + + !context.getBooleanVariable("sys.programGroupDisabled") + + + + + ${compiler:JALVIEW_APPLICATION_NAME} + + + ${installer:sys.contentDir}/${compiler:EXECUTABLE_NAME} + + + ${compiler:JALVIEW_APPLICATION_NAME} + + + ${compiler:JALVIEW_DIR}/${compiler:PNG_ICON_FILE} + + + + + ${compiler:JALVIEW_DIR}/${compiler:WINDOWS_ICONS_FILE} + + + + context.getBooleanVariable("createDesktopLinkAction") + + + + + + ${compiler:JALVIEW_APPLICATION_NAME}.app + + + + context.getBooleanVariable("addToDockAction") + + + + + + ${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT} + + + + + ${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:WRAPPER_LINK} + + + + Util.isLinux() || Util.isUnixInstaller() || Util.isMacOS() + + + + + ${installer:sys.contentDir}\${compiler:WRAPPER_SCRIPT_BIN_DIR} + Path + + context.getBooleanVariable("appendToPathAction") + + + + + + ${installer:sys.contentDir}/${compiler:WRAPPER_SCRIPT_BIN_DIR}/${compiler:BASH_WRAPPER_SCRIPT} + + + + + ${installer:unixUserBinDir}/${compiler:WRAPPER_LINK} + + + + context.getBooleanVariable("makeSymbolicLinkAction") && ( Util.isLinux() || Util.isUnixInstaller() ) && ( context.getVariable("unixUserBinDir") != null ) + + + + + + ${installer:macWrapperLinkLocation} + + + + + ${installer:unixUserBinDir}/${compiler:WRAPPER_LINK} + + + + context.getBooleanVariable("makeSymbolicLinkAction") && Util.isMacOS() && ( context.getVariable("unixUserBinDir") != null ) && ( context.getVariable("macWrapperLinkLocation") != null ) + + + + + + ${form:finishedMessage} + + + + + ${i18n:CreateDesktopIcon} + + createDesktopLinkAction + + !Util.isMacOS() + + + + ${i18n:AddToDock} + + addToDockAction + + Util.isMacOS() + + + + Add ${compiler:JALVIEW_APPLICATION_NAME}'s bin folder to the Path environment variable + + appendToPathAction + + Util.isWindows() + + + + Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixUserBinDir} + + makeSymbolicLinkAction + + ( Util.isLinux() || Util.isUnixInstaller() || ( Util.isMacOS() && ( context.getVariable("macWrapperLinkLocation") != null ) ) ) && ( context.getVariable("unixUserBinDir") != null ) + + + + + + + + ${i18n:UninstallerMenuEntry(${compiler:sys.fullName})} + + + + + + + + + + 255 + 255 + 255 + 255 + + + 49 + 52 + 53 + 255 + + + + + + + + + + + 192 + 192 + 192 + 255 + + + + + + ${compiler:JALVIEW_DIR}/${compiler:BACKGROUND} + + + + + 5 + 10 + 10 + 10 + + + + + imageAnchor + imageEdgeBackgroundColor + imageFile + + + + + + + + + + + + + + + + + + ${form:welcomeMessage} + + !context.isConsole() + + + + + + String message = context.getMessage("ConfirmUninstall", context.getApplicationName()); +return console.askYesNo(message, true); + + + + + + + + + + + + + + + + + + + + + + + + + + jre + + + + + jre.jar + + + + + .install4j + + + + + getdown-launcher.jar + + + + + getdown-launcher-old.jar + + + + + getdown-launcher-new.jar + + + + + gettingdown.lock + + + + + jre.zip + + + + + digest.txt + + + + + digest2.txt + + + + + getdown-launcher.jarv + + + + + getdown-launcher-new.jarv + + + + + launcher.log + + + + + proxy.txt + + + + + build_properties + + + + + channel_launch*.jvl + + + + + jalview*.jvl + + + + + *.jarv + + + + + *.log + + + + + *.txt + + + + + *_new + + + + + hs_err_*.* + + + + + ${compiler:GETDOWN_DIST_DIR} + + + + + ${compiler:GETDOWN_ALT_DIR} + + + + + ${compiler:GETDOWN_RESOURCE_DIR} + + + + + META-INF + + + + + install + + + + + resource + + + + + dist + + + + + release + + + + + alt + + + + + dev + + + + + build + + + + + alt_* + + + + + dev_* + + + + + build_* + + + + + ${compiler:WRAPPER_SCRIPT_BIN_DIR} + + + + + bin + + + + + channel.props + + + + + channel.propsv + + + + + + + + + + + + + + + + ${i18n:UninstallerPreparing} + + + + + + + + + + ${form:successMessage} + + + + + + + + + + + . + + + ${compiler:WRAPPER_LINK}_setup + ${compiler:sys.fullName} + + + + + + + + + + + + + + Running ${i18n:SetupAppTitle} + + + + + + + + + ${i18n:FinishedLabel(${compiler:JALVIEW_APPLICATION_NAME})} + + + + + ${i18n:AddToDock} + + addToDockAction + + Util.isMacOS() + + + + Make a ${compiler:WRAPPER_LINK} symbolic link in ${installer:unixUserBinDir} + + makeSymbolicLinkAction + + ( Util.isLinux() || Util.isUnixInstaller() || ( Util.isMacOS() && ( context.getVariable("macWrapperLinkLocation") != null ) ) ) && ( context.getVariable("unixUserBinDir") != null ) + + + + +${i18n:ClickFinish} + +${compiler:JALVIEW_APPLICATION_NAME} will now launch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.7.10.2