Package org.ka2ddo.yaac.gui
Class UpgradeLauncher
java.lang.Object
org.ka2ddo.yaac.gui.UpgradeLauncher
This class provides services to:
- test if the currently running version of YAAC is out-of-date,
- download a new distribution of YAAC, start the upgrader utility, and shut down this instance of YAAC,
- remove the used new distribution file once the new instance is started.
- Author:
- Andrew Pavlin, KA2DDO
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.ka2ddo.yaac.gui.UpgradeLauncher.JavaExeFilter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkForUpdates
(boolean interactive) Check whether a newer release of YAAC and/or the currently used plugins is available, displaying status.static boolean
downloadNewReleases
(List<Provider> providerList, String[] versions, String protocol, int numNeedsUpgrade, String[] pluginDistroName, String[] pluginDistroType, boolean useSourceForge) Download the distributions of the new versions of YAAC and/or the supported plugins in a place expected by the upgrade.jar program.static File
Locate the directory where YAAC is installed.static void
Start up the upgrader.jar program and shut down YAAC to get it out of the way.
-
Field Details
-
JAVA_EXE_FILTER
public static final org.ka2ddo.yaac.gui.UpgradeLauncher.JavaExeFilter JAVA_EXE_FILTER
-
-
Constructor Details
-
UpgradeLauncher
public UpgradeLauncher()
-
-
Method Details
-
checkForUpdates
public static void checkForUpdates(boolean interactive) Check whether a newer release of YAAC and/or the currently used plugins is available, displaying status. Note this method should be run in a separate thread from the GUI thread, as it may take a while to collect the information needed to report the results (especially if clicked on a system that is offline from the Internet and therefore will have to wait for network timeouts to confirm that it can't find out its upgrade status).- Parameters:
interactive
- boolean true if no-upgrade-needed status should be reported (out-of-date status is always reported)
-
getInstallRootDirectory
Locate the directory where YAAC is installed.- Returns:
- File of the YAAC installation directory
-
downloadNewReleases
public static boolean downloadNewReleases(List<Provider> providerList, String[] versions, String protocol, int numNeedsUpgrade, String[] pluginDistroName, String[] pluginDistroType, boolean useSourceForge) Download the distributions of the new versions of YAAC and/or the supported plugins in a place expected by the upgrade.jar program.- Parameters:
providerList
- List of Provider objects currently installed in YAAC, providing their currently installed version numbersversions
- String array of versions of available upgrades for the Providers in the providerList in the same order (null version string if not available for upgrade)protocol
- String of URL schema (protocol) to usenumNeedsUpgrade
- number of elements in the providerList that are candidates for upgrade (newer versions available)pluginDistroName
- String base name of the distribution file for YAAC or a pluginpluginDistroType
- String file type of the distribution file for YAAC or a pluginuseSourceForge
- boolean true if the SourceForge repository should be used as a download source @return boolean true if download succeeded for at least one upgradable file- Returns:
- boolean true if new software was successfully downloaded
-
transferToLauncher
Start up the upgrader.jar program and shut down YAAC to get it out of the way.- Throws:
IOException
- if upgrade.jar could not be started or YAAC wouldn't shut down
-