This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e7078d9
Showing
7 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="lib" path="D:/Tyrolium/Workspace/launcher/Ficher/LauncherUpdate/openlauncherlib-2.1-SNAPSHOT.jar"/> | ||
<classpathentry kind="lib" path="D:/Tyrolium/Workspace/launcher/Ficher/LauncherUpdate/s-update-3.1.0-BETA.jar"/> | ||
<classpathentry kind="lib" path="D:/Tyrolium/Workspace/launcher/Ficher/LauncherUpdate/swinger-1.0.0-BETA.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>UpLauncher</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package fr.tyrolium.maxime.update; | ||
|
||
import fr.theshark34.openlauncherlib.bootstrap.Bootstrap; | ||
import fr.theshark34.openlauncherlib.bootstrap.LauncherClasspath; | ||
import fr.theshark34.openlauncherlib.bootstrap.LauncherInfos; | ||
import fr.theshark34.openlauncherlib.util.ErrorUtil; | ||
import fr.theshark34.openlauncherlib.util.GameDir; | ||
import fr.theshark34.openlauncherlib.util.SplashScreen; | ||
import fr.theshark34.supdate.BarAPI; | ||
import fr.theshark34.supdate.SUpdate; | ||
import fr.theshark34.swinger.colored.SColoredBar; | ||
|
||
import static fr.theshark34.swinger.Swinger.*; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
public class LauncherUpdate { | ||
|
||
private static SplashScreen splash; | ||
private static SColoredBar bar; | ||
private static Thread barThread; | ||
|
||
private static final LauncherInfos TY_B_INFOS = new LauncherInfos("Tyrolium", "fr.tyrolium.maxime.launcher.LauncherFrame"); | ||
private static final File TY_DIR = GameDir.createGameDir("TyroliumLauncher"); | ||
private static final LauncherClasspath TY_B_CP = new LauncherClasspath(new File(TY_DIR, "Launcher/launcher.jar"), new File(TY_DIR, "Launcher/Libs/")); | ||
|
||
private static ErrorUtil errorUtil = new ErrorUtil(new File(TY_DIR, ("Launcher/crashes"))); | ||
|
||
public static void main(String[] args) { | ||
|
||
setResourcePath("/fr/tyrolium/maxime/update/ressources"); | ||
displaySplash(); | ||
try { | ||
doUpdate(); | ||
} catch (Exception e) { | ||
errorUtil.catchError(e, "Impossible de mettre a jour le launcher !"); | ||
barThread.interrupt(); | ||
} | ||
try { | ||
launchLauncher(); | ||
} catch (IOException e) { | ||
errorUtil.catchError(e, "Impossible de lancer le launcher !"); | ||
barThread.interrupt(); | ||
} | ||
} | ||
|
||
private static void displaySplash() { | ||
|
||
splash = new SplashScreen("Tyrolium", getResource("splash.png")); | ||
|
||
bar = new SColoredBar(getTransparentWhite(100), getTransparentWhite(175)); | ||
bar.setBounds(0, 490, 350, 20); | ||
splash.add(bar); | ||
|
||
splash.setBackground(TRANSPARENT); | ||
splash.getContentPane().setBackground(TRANSPARENT); | ||
splash.setVisible(true); | ||
} | ||
|
||
private static void doUpdate() throws Exception{ | ||
|
||
SUpdate su = new SUpdate("http://tyrolium.fr/s-update-launch", new File(TY_DIR, "Launcher")); | ||
|
||
barThread = new Thread() { | ||
@Override | ||
public void run() { | ||
while(!this.isInterrupted()) { | ||
bar.setValue((int) (BarAPI.getNumberOfTotalDownloadedBytes() / 1000)); | ||
bar.setMaximum((int) (BarAPI.getNumberOfTotalBytesToDownload() / 1000)); | ||
} | ||
} | ||
}; | ||
barThread.start(); | ||
|
||
su.start(); | ||
barThread.interrupt(); | ||
|
||
} | ||
|
||
private static void launchLauncher() throws IOException{ | ||
Bootstrap bootstrap = new Bootstrap(TY_B_CP, TY_B_INFOS); | ||
Process p = bootstrap.launch(); | ||
|
||
splash.setVisible(false); | ||
|
||
try { | ||
p.waitFor(); | ||
} catch (InterruptedException e) { | ||
} | ||
System.exit(0); | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.