JAL-3394 JAL-3420 Temporary measure limits unix file extension to be the shortest... task/JAL-3394_install4j8_option
authorBen Soares <bsoares@dundee.ac.uk>
Fri, 30 Aug 2019 13:32:54 +0000 (14:32 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Fri, 30 Aug 2019 13:32:54 +0000 (14:32 +0100)
utils/install4j/auto_file_associations-i4j8.pl
utils/install4j/file_associations_auto-install4j8.xml
utils/install4j/file_associations_template-install4j8.xml

index 9a607c6..71044fe 100755 (executable)
@@ -178,6 +178,18 @@ for my $shortname (@ordered) {
   $i4jentry =~ s/\$\$MIMETYPE\$\$/$xmimetype/g;
   $i4jentry =~ s/\$\$ICONFILE\$\$/$xiconfile/g;
 
+  my $unixext;
+  for my $ext (sort @extensions) {
+    if (not defined($unixext)) {
+      $unixext = $ext;
+      next;
+    }
+    if (length($ext) < length($unixext)) {
+      $unixext = $ext;
+      next;
+    }
+  }
+
   for my $ext (@extensions) {
     $i4jcount++;
     #print "COUNT: $i4jcount\n";
@@ -185,7 +197,10 @@ for my $shortname (@ordered) {
     #print "PC: $progresspercent\n";
     $progresspercent = 100 if $progresspercent > 100;
     my $xext = xml_escape($ext);
+    my $addunixextension = ($ext eq $unixext)?"true":"false";
+
     my $i4jextentry = $i4jentry;
+    $i4jextentry =~ s/\$\$ADDUNIXEXTENSION\$\$/$addunixextension/g;
     $i4jextentry =~ s/\$\$EXTENSION\$\$/$xext/g;
     $i4jextentry =~ s/\$\$PROGRESSPERCENT\$\$/$progresspercent/g;
     $i4jextentry =~ s/\$\$ID\$\$/$id/g;
index 52438d1..05c307f 100644 (file)
                       <!--<property name="macMimeType" type="string">application/x-jalview-annotations+text</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
                       <!--<property name="macMimeType" type="string">application/x-fasta+txt</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
                       <!--<property name="macMimeType" type="string">application/x-jalview-features+text</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
                       <!--<property name="macMimeType" type="string">application/x-jalview-jnet+text</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
                       <!--<property name="macMimeType" type="string">chemical/x-mcif</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
                       <!--<property name="macMimeType" type="string">chemical/x-pdb</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
                       <!--<property name="macMimeType" type="string">application/x-stockholm+txt</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="false" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>Jalview-File.png</string>
index ee3aec8..cb9ebf8 100644 (file)
@@ -25,7 +25,7 @@
                       <!--<property name="macMimeType" type="string">$$MIMETYPE$$</property>-->
                       <property name="macRole" type="enum" class="com.install4j.runtime.beans.actions.desktop.MacAssociationRole" value="EDITOR" />
                       <property name="restartFinder" type="boolean" value="true" />
-                      <property name="unix" type="boolean" value="true" />
+                      <property name="unix" type="boolean" value="$$ADDUNIXEXTENSION$$" />
                       <property name="unixIconFile">
                         <object class="com.install4j.api.beans.ExternalFile">
                           <string>$$ICONFILE$$.png</string>