| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.bin; |
| 22 |
|
|
| 23 |
|
import java.io.File; |
| 24 |
|
|
| 25 |
|
import com.threerings.getdown.data.EnvConfig; |
| 26 |
|
import com.threerings.getdown.util.LaunchUtil; |
| 27 |
|
|
| |
|
| 0% |
Uncovered Elements: 41 (41) |
Complexity: 11 |
Complexity Density: 0.5 |
|
| 28 |
|
public class GetdownLauncherUpdate |
| 29 |
|
{ |
| |
|
| 0% |
Uncovered Elements: 40 (40) |
Complexity: 11 |
Complexity Density: 0.5 |
|
| 30 |
0 |
public static void main(String[] args)... |
| 31 |
|
{ |
| 32 |
0 |
EnvConfig.setVarsFromProperties(); |
| 33 |
|
|
| 34 |
0 |
String appdir = args.length > 0 ? args[0] : null; |
| 35 |
0 |
if (appdir == null || appdir.length() == 0) |
| 36 |
|
{ |
| 37 |
0 |
appdir = System.getProperty("launcher.appdir", null); |
| 38 |
|
} |
| 39 |
0 |
if (appdir == null) |
| 40 |
|
{ |
| 41 |
0 |
appdir = EnvConfig.getUserAppdir(); |
| 42 |
|
} |
| 43 |
0 |
if (appdir == null) |
| 44 |
|
{ |
| 45 |
0 |
System.err.println("Not running upgradeGetdown"); |
| 46 |
0 |
return; |
| 47 |
|
} |
| 48 |
0 |
boolean debug = false; |
| 49 |
0 |
for (int i = 0; i < args.length; i++) |
| 50 |
|
{ |
| 51 |
0 |
if ("--debug".equals(args[i])) |
| 52 |
|
{ |
| 53 |
0 |
debug = true; |
| 54 |
0 |
break; |
| 55 |
|
} |
| 56 |
|
} |
| 57 |
0 |
if (debug) |
| 58 |
|
{ |
| 59 |
0 |
System.err.println("Running upgradeGetdown"); |
| 60 |
|
} |
| 61 |
0 |
File appdirFile = new File(appdir); |
| 62 |
0 |
if (!appdirFile.exists()) |
| 63 |
|
{ |
| 64 |
0 |
System.err.println("Directory '" + appdirFile.getAbsolutePath() |
| 65 |
|
+ "' doesn't exist, cannot update getdown-launcher.jar."); |
| 66 |
0 |
if (Boolean.valueOf(System.getProperty("launcher.update"))) |
| 67 |
|
{ |
| 68 |
0 |
System.exit(1); |
| 69 |
|
} |
| 70 |
|
} |
| 71 |
0 |
LaunchUtil.upgradeGetdown(new File(appdir, "getdown-launcher-old.jar"), |
| 72 |
|
new File(appdir, "getdown-launcher.jar"), |
| 73 |
|
new File(appdir, "getdown-launcher-new.jar")); |
| 74 |
|
} |
| 75 |
|
} |