def getdownResourceDir = project.ext.getdownResourceDir
def getdownAppDir = project.ext.getdownAppDir
def getdownResourceFilenames = []
+
+ copy {
+ from "$classes/$buildPropertiesFile"
+ rename(buildPropertiesFile, getdown_install_build_properties)
+ into project.ext.getdownWebsiteDir
+ }
+ getdownResourceFilenames += getdown_current_build_properties
+
doFirst {
// go through properties looking for getdown_txt_...
def props = project.properties.sort { it.key }
props.put("getdown_txt_java_min_version", getdown_alt_java_min_version)
props.put("getdown_txt_multi_java_location", getdown_alt_multi_java_location)
+ props.put("getdown_txt_resource", "$classes/$buildPropertiesFile")
if (getdown_local == "true") {
getdown_app_base = file(getdownWebsiteDir).toURI().toString()
}
} else {
// file values rationalised
- if (val.indexOf('/') > -1) {
+ if (val.indexOf('/') > -1 || prop.startsWith("getdown_txt_resource")) {
def r = null
if (val.indexOf('/') == 0) {
// absolute path
getdownResourceFilenames += r.getPath()
}
}
- def line = prop.substring(12) + " = " + val + "\n"
- getdownTextString += line
+ if (! prop.startsWith("getdown_txt_resource")) {
+ def line = prop.substring(12) + " = " + val + "\n"
+ getdownTextString += line
+ }
}
}
}
def getdown_txt = file(project.ext.getdownWebsiteDir + "/getdown.txt")
getdown_txt.write(getdownTextString)
+
+ def launch_jvl = file(project.ext.getdownWebsiteDir + "/" + getdown_launch_jvl)
+ launch_jvl.write("appbase="+props.get("getdown_txt_appbase"))
copy {
from getdown_txt
+ from launch_jvl
+ from project.ext.getdownWebsiteDir+"/"+getdown_current_build_properties
+ from project.ext.getdownWebsiteDir+"/"+getdown_install_build_properties
into project.ext.getdownFilesDir
}
/** The paths (relative to the appdir) of images for the window icon. */
public final List<String> iconImages;
+ /** The path (relative to the appdir) to a single background image to appear first. */
+ public final String instantBackgroundImage;
+
/** The path (relative to the appdir) to a single background image. */
public final String backgroundImage;
/** Whether progress text should be hidden or not. */
public final boolean hideProgressText;
+ /** Whether the splash screen should retain focus. */
+ public final boolean keepOnTop;
+
+ /** Whether to display the appbase. */
+ public final boolean displayAppbase;
+
/** The minimum number of seconds to display the GUI. This is to prevent the GUI from
* flashing up on the screen and immediately disappearing, which can be confusing to the
* user. */
@Override
public String toString ()
{
- return "[name=" + name + ", bg=" + background + ", bg=" + backgroundImage +
+ return "[name=" + name + ", bg=" + background + ", bg=" + backgroundImage + ", instant_bg=" + instantBackgroundImage +
", pi=" + progressImage + ", prect=" + progress + ", pt=" + progressText +
", pb=" + progressBar + ", srect=" + status + ", st=" + statusText +
", shadow=" + textShadow + ", err=" + installError + ", nrect=" + patchNotes +
", notes=" + patchNotesUrl + ", stepPercentages=" + stepPercentages +
- ", hideProgressText" + hideProgressText + ", minShow=" + minShowSeconds + "]";
+ ", hideProgressText=" + hideProgressText + ", keepOnTop=" + keepOnTop + ", minShow=" + minShowSeconds + "]";
}
public UpdateInterface (Config config)
this.progress = config.getRect("ui.progress", new Rectangle(5, 5, 300, 15));
this.progressText = config.getColor("ui.progress_text", Color.BLACK);
this.hideProgressText = config.getBoolean("ui.hide_progress_text");
+ this.keepOnTop = config.getBoolean("ui.keep_on_top");
+ this.displayAppbase = config.getBoolean("ui.display_appbase");
this.minShowSeconds = config.getInt("ui.min_show_seconds", 5);
this.progressBar = config.getColor("ui.progress_bar", 0x6699CC);
this.status = config.getRect("ui.status", new Rectangle(5, 25, 500, 100));
this.textShadow = config.getColor("ui.text_shadow", Color.CLEAR);
this.hideDecorations = config.getBoolean("ui.hide_decorations");
this.backgroundImage = config.getString("ui.background_image");
+ this.instantBackgroundImage = config.getString("ui.instant_background_image");
// default to black or white bg color, depending on the brightness of the progressText
int defaultBackground = (0.5f < Color.brightness(this.progressText)) ?
Color.BLACK : Color.WHITE;
return locatorConfig;
}
+ public String getAppbase() {
+ return _appbase;
+ }
+
protected final EnvConfig _envc;
protected File _config;
protected Digest _digest;
Config config = _app.init(true);
if (preloads) doPredownloads(_app.getResources());
_ifc = new Application.UpdateInterface(config);
+ _status.setAppbase(_app.getAppbase());
}
/**
} else {
proc = _app.createProcess(false);
}
-
+
// close standard in to avoid choking standard out of the launched process
proc.getInputStream().close();
// close standard out, since we're not going to write to anything to it anyway
}
}
+ _container.setVisible(true);
+ _container.validate();
+
// if we have a UI open and we haven't been around for at least 5 seconds (the default
// for min_show_seconds), don't stick a fork in ourselves straight away but give our
// lovely user a chance to see what we're doing
try {
readConfig(false);
Graphics g = _container.getGraphics();
- String imageFile = _ifc.backgroundImage;
- BufferedImage bgImage = loadImage(_ifc.backgroundImage);
- int bwidth = bgImage.getWidth();
- int bheight = bgImage.getHeight();
-
- instantSplashPane = new JPanel() {
- @Override
- protected void paintComponent(Graphics g)
- {
- super.paintComponent(g);
- // attempt to draw a background image...
- if (bgImage != null) {
- g.drawImage(bgImage, 0, 0, this);
- }
- }
- };
-
- instantSplashPane.setSize(bwidth,bheight);
- instantSplashPane.setPreferredSize(new Dimension(bwidth,bheight));
-
- _layers.add(instantSplashPane, Integer.valueOf(0));
-
- _container.setPreferredSize(new Dimension(bwidth,bheight));
+ BufferedImage iBgImage = loadImage(_ifc.instantBackgroundImage);
+ boolean ibg = true;
+ if (iBgImage == null) {
+ iBgImage = loadImage(_ifc.backgroundImage);
+ ibg = false;
+ }
+ if (iBgImage != null) {
+ final BufferedImage bgImage = iBgImage;
+ int bwidth = bgImage.getWidth();
+ int bheight = bgImage.getHeight();
+
+ log.info("Displaying instant background image", ibg?"instant_background_image":"background_image");
+
+ instantSplashPane = new JPanel() {
+ @Override
+ protected void paintComponent(Graphics g)
+ {
+ super.paintComponent(g);
+ // attempt to draw a background image...
+ if (bgImage != null) {
+ g.drawImage(bgImage, 0, 0, this);
+ }
+ }
+ };
+
+ instantSplashPane.setSize(bwidth,bheight);
+ instantSplashPane.setPreferredSize(new Dimension(bwidth,bheight));
+
+ _layers.add(instantSplashPane, Integer.valueOf(0));
+
+ _container.setPreferredSize(new Dimension(bwidth,bheight));
+ }
} catch (Exception e) {
- log.warning("Failed to set instant background image", "bg", _ifc.backgroundImage);
+ log.warning("Failed to set instant background image", "ibg", _ifc.instantBackgroundImage);
}
-
-
_container.add(_layers, BorderLayout.CENTER);
_patchNotes = new JButton(new AbstractAction(_msgs.getString("m.patch_notes")) {
_status.init(_ifc, _background, getProgressImage());
Dimension size = _status.getPreferredSize();
_status.setSize(size);
+ //_status.updateStatusLabel();
_layers.setPreferredSize(size);
_patchNotes.setBounds(_ifc.patchNotes.x, _ifc.patchNotes.y,
}
if (abort) System.exit(-1);
- log.info("Starting ....");
+ log.info("Starting .....");
try
{
jalview.bin.StartupNotificationListener.setListener();
handleWindowClose();
}
});
+
+ // keep_on_top
+ try {
+ readConfig(false);
+ } catch (Exception e) {
+ log.warning("Error reading config for keep_on_top");
+ }
+ // move window to top, always on top
+ if (_ifc.keepOnTop) {
+ log.info("Keep on top set to ", "keep_on_top", _ifc.keepOnTop);
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ _frame.toFront();
+ _frame.repaint();
+ }
+ });
+ _frame.setAlwaysOnTop(true);
+ }
+
// handle close on ESC
String cancelId = "Cancel"; // $NON-NLS-1$
_frame.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
status += " .";
}
}
- _newlab = createLabel(status, new Color(_ifc.statusText, true));
+
+ StringBuilder labelText = new StringBuilder();
+ if (_ifc.displayAppbase) {
+ labelText.append(" appbase: "+_appbase);
+ labelText.append("\n");
+ }
+ labelText.append(status);
+
+ _newlab = createLabel(labelText.toString(), new Color(_ifc.statusText, true));
// set the width of the label to the width specified
int width = _ifc.status.width;
if (width == 0) {
return key;
}
}
+
+ public void setAppbase(String appbase) {
+ _appbase = appbase;
+ }
protected Image _barimg;
protected RotatingBackgrounds _bg;
protected Throttle _rthrottle = new Throttle(1, 1000L);
protected static final Font FONT = new Font("SansSerif", Font.BOLD, 12);
+
+ public String _appbase;
}
getdown_launcher = getdown/lib/getdown-launcher.jar
getdown_launcher_new = getdown-launcher-new.jar
getdown_core = getdown/lib/getdown-core-1.8.3-SNAPSHOT.jar
-getdown_base_txt = getdown/files/getdown.txt
+getdown_launch_jvl = channel_launch.jvl
+getdown_current_build_properties = build_properties
+getdown_install_build_properties = build_properties.install
getdown_txt_title = Jalview
getdown_channel_base = http://www.jalview.org/getdown/jalview
getdown_channel_name = TEST
getdown_txt_strict_comments = true
getdown_txt_title = Jalview
getdown_txt_ui.name = Jalview
+getdown_txt_ui.keep_on_top = true
+getdown_txt_ui.display_appbase = true
getdown_txt_ui.background = FFFFFF
getdown_txt_ui.background_image = resources/images/jalview_logo_background_getdown-640x480.png
+getdown_txt_ui.instant_background_image = resources/images/jalview_logo_background_getdown_instant-640x480.png
getdown_txt_ui.error_background = resources/images/jetset_jalview_splash.png
getdown_txt_ui.progress_image = resources/images/jalview_logo_background_getdown-progress.png
getdown_txt_ui.icon = resources/images/JalviewLogo_Huge.png
getdown_txt_ui.progress_text = 000000
getdown_txt_ui.status = 20, 380, 600, 58
getdown_txt_ui.status_text = 000066
-getdown_txt_ui.text_shadow = EEEEFF
-getdown_txt_ui.install_error = http://www.jalview.org/download/error
+#getdown_txt_ui.text_shadow = FFFFFF
+getdown_txt_ui.install_error = http://www.jalview.org/faq/getdownerror
getdown_txt_ui.mac_dock_icon = resources/images/jalview_logos.ico
getdown_alt_java8_min_version = 01080000
getdown_alt_java11_min_version = 11000000
<key>CFBundleIconFile</key>
<string>applet</string>
<key>CFBundleIdentifier</key>
- <string>com.apple.ScriptEditor.id.Uninstall-Old-Jalview--optional</string>
+ <string>com.apple.ScriptEditor.id.Uninstall-Old-Jalview</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>Uninstall Old Jalview (optional)</string>
+ <string>Uninstall Old Jalview</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
</dict>
<key>LSRequiresCarbon</key>
<true/>
+ <key>NSAppleEventsUsageDescription</key>
+ <string>This script needs to control other applications to run.</string>
+ <key>NSAppleMusicUsageDescription</key>
+ <string>This script needs access to your music to run.</string>
+ <key>NSCalendarsUsageDescription</key>
+ <string>This script needs access to your calendars to run.</string>
+ <key>NSCameraUsageDescription</key>
+ <string>This script needs access to your camera to run.</string>
+ <key>NSContactsUsageDescription</key>
+ <string>This script needs access to your contacts to run.</string>
+ <key>NSHomeKitUsageDescription</key>
+ <string>This script needs access to your HomeKit Home to run.</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>This script needs access to your microphone to run.</string>
+ <key>NSPhotoLibraryUsageDescription</key>
+ <string>This script needs access to your photos to run.</string>
+ <key>NSRemindersUsageDescription</key>
+ <string>This script needs access to your reminders to run.</string>
+ <key>NSSiriUsageDescription</key>
+ <string>This script needs access to Siri to run.</string>
+ <key>NSSystemAdministrationUsageDescription</key>
+ <string>This script needs access to administer this system to run.</string>
<key>WindowState</key>
<dict>
<key>bundleDividerCollapsed</key>
<key>bundlePositionOfDivider</key>
<real>0.0</real>
<key>dividerCollapsed</key>
- <false/>
+ <true/>
<key>eventLogLevel</key>
<integer>2</integer>
<key>name</key>
<key>positionOfDivider</key>
<real>421</real>
<key>savedFrame</key>
- <string>20 1180 700 672 0 0 3360 1867 </string>
+ <string>272 342 1754 910 0 0 3360 1867 </string>
<key>selectedTab</key>
- <string>description</string>
+ <string>result</string>
</dict>
</dict>
</plist>
-{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600
+{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf500
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>files</key>
- <dict>
- <key>Resources/Scripts/main.scpt</key>
- <data>
- fqUypmAyNT7kgykBjNqtdjMM1Mg=
- </data>
- <key>Resources/applet.icns</key>
- <data>
- vIRz6m6+ZxDNfi4iTsXj5rdcZUA=
- </data>
- <key>Resources/applet.rsrc</key>
- <data>
- aTN+E9yPFzj2wRwcmefcTGGpQYM=
- </data>
- <key>Resources/description.rtfd/TXT.rtf</key>
- <data>
- O79gUM5bdy3TK5k10nzhees3tLA=
- </data>
- </dict>
- <key>files2</key>
- <dict>
- <key>Resources/Scripts/main.scpt</key>
- <dict>
- <key>hash</key>
- <data>
- fqUypmAyNT7kgykBjNqtdjMM1Mg=
- </data>
- <key>hash2</key>
- <data>
- EQiIOT1XOBWGSwXZlfTXIrxNy+61mjRDze6gR+e3c2U=
- </data>
- </dict>
- <key>Resources/applet.icns</key>
- <dict>
- <key>hash</key>
- <data>
- vIRz6m6+ZxDNfi4iTsXj5rdcZUA=
- </data>
- <key>hash2</key>
- <data>
- D7gig1wJlOzR/Iy+y6TESLN0j/cIpjThUyO1pj5fZEc=
- </data>
- </dict>
- <key>Resources/applet.rsrc</key>
- <dict>
- <key>hash</key>
- <data>
- aTN+E9yPFzj2wRwcmefcTGGpQYM=
- </data>
- <key>hash2</key>
- <data>
- fQhBZ0v2JeXFde/OYcgUVYOfUcp426odn5rtdTkcdjc=
- </data>
- </dict>
- <key>Resources/description.rtfd/TXT.rtf</key>
- <dict>
- <key>hash</key>
- <data>
- O79gUM5bdy3TK5k10nzhees3tLA=
- </data>
- <key>hash2</key>
- <data>
- qxVBcYejHswAjMa99pSek5Vgi52JP4dlQMTiIzbCkBs=
- </data>
- </dict>
- </dict>
- <key>rules</key>
- <dict>
- <key>^Resources/</key>
- <true/>
- <key>^Resources/.*\.lproj/</key>
- <dict>
- <key>optional</key>
- <true/>
- <key>weight</key>
- <real>1000</real>
- </dict>
- <key>^Resources/.*\.lproj/locversion.plist$</key>
- <dict>
- <key>omit</key>
- <true/>
- <key>weight</key>
- <real>1100</real>
- </dict>
- <key>^Resources/Base\.lproj/</key>
- <dict>
- <key>weight</key>
- <real>1010</real>
- </dict>
- <key>^version.plist$</key>
- <true/>
- </dict>
- <key>rules2</key>
- <dict>
- <key>.*\.dSYM($|/)</key>
- <dict>
- <key>weight</key>
- <real>11</real>
- </dict>
- <key>^(.*/)?\.DS_Store$</key>
- <dict>
- <key>omit</key>
- <true/>
- <key>weight</key>
- <real>2000</real>
- </dict>
- <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
- <dict>
- <key>nested</key>
- <true/>
- <key>weight</key>
- <real>10</real>
- </dict>
- <key>^.*</key>
- <true/>
- <key>^Info\.plist$</key>
- <dict>
- <key>omit</key>
- <true/>
- <key>weight</key>
- <real>20</real>
- </dict>
- <key>^PkgInfo$</key>
- <dict>
- <key>omit</key>
- <true/>
- <key>weight</key>
- <real>20</real>
- </dict>
- <key>^Resources/</key>
- <dict>
- <key>weight</key>
- <real>20</real>
- </dict>
- <key>^Resources/.*\.lproj/</key>
- <dict>
- <key>optional</key>
- <true/>
- <key>weight</key>
- <real>1000</real>
- </dict>
- <key>^Resources/.*\.lproj/locversion.plist$</key>
- <dict>
- <key>omit</key>
- <true/>
- <key>weight</key>
- <real>1100</real>
- </dict>
- <key>^Resources/Base\.lproj/</key>
- <dict>
- <key>weight</key>
- <real>1010</real>
- </dict>
- <key>^[^/]+$</key>
- <dict>
- <key>nested</key>
- <true/>
- <key>weight</key>
- <real>10</real>
- </dict>
- <key>^embedded\.provisionprofile$</key>
- <dict>
- <key>weight</key>
- <real>20</real>
- </dict>
- <key>^version\.plist$</key>
- <dict>
- <key>weight</key>
- <real>20</real>
- </dict>
- </dict>
-</dict>
-</plist>
<java class="java.beans.XMLDecoder">
<object class="com.install4j.runtime.beans.actions.files.DeleteFileAction">
<void property="files">
- <array class="java.io.File" length="17">
+ <array class="java.io.File" length="20">
<void index="0">
<object class="java.io.File">
<string>jre</string>
</void>
<void index="1">
<object class="java.io.File">
- <string>.install4j</string>
+ <string>jre.jar</string>
</object>
</void>
<void index="2">
<object class="java.io.File">
- <string>dist</string>
+ <string>.install4j</string>
</object>
</void>
<void index="3">
<object class="java.io.File">
- <string>resource</string>
+ <string>dist</string>
</object>
</void>
<void index="4">
<object class="java.io.File">
- <string>getdown-launcher.jar</string>
+ <string>resource</string>
</object>
</void>
<void index="5">
<object class="java.io.File">
- <string>getdown-launcher-old.jar</string>
+ <string>getdown-launcher.jar</string>
</object>
</void>
<void index="6">
<object class="java.io.File">
- <string>getdown-launcher-new.jar</string>
+ <string>getdown-launcher-old.jar</string>
</object>
</void>
<void index="7">
<object class="java.io.File">
- <string>*.jarv</string>
+ <string>getdown-launcher-new.jar</string>
</object>
</void>
<void index="8">
<object class="java.io.File">
- <string>gettingdown.lock</string>
+ <string>*.jarv</string>
</object>
</void>
<void index="9">
<object class="java.io.File">
- <string>*.log</string>
+ <string>gettingdown.lock</string>
</object>
</void>
<void index="10">
<object class="java.io.File">
- <string>*.txt</string>
+ <string>*.log</string>
</object>
</void>
<void index="11">
<object class="java.io.File">
- <string>*_new</string>
+ <string>*.txt</string>
</object>
</void>
<void index="12">
<object class="java.io.File">
- <string>digest.txt</string>
+ <string>*_new</string>
</object>
</void>
<void index="13">
<object class="java.io.File">
- <string>digest2.txt</string>
+ <string>digest.txt</string>
</object>
</void>
<void index="14">
<object class="java.io.File">
- <string>getdown-launcher.jarv</string>
+ <string>digest2.txt</string>
</object>
</void>
<void index="15">
<object class="java.io.File">
- <string>launcher.log</string>
+ <string>getdown-launcher.jarv</string>
</object>
</void>
<void index="16">
<object class="java.io.File">
+ <string>getdown-launcher-new.jarv</string>
+ </object>
+ </void>
+ <void index="17">
+ <object class="java.io.File">
+ <string>launcher.log</string>
+ </object>
+ </void>
+ <void index="18">
+ <object class="java.io.File">
<string>proxy.txt</string>
</object>
</void>
+ <void index="19">
+ <object class="java.io.File">
+ <string>META-INF</string>
+ </object>
+ </void>
</array>
</void>
<void property="recursive">