Skip to content

Commit

Permalink
change build number, fix lib download
Browse files Browse the repository at this point in the history
  • Loading branch information
robin4002 committed Jun 13, 2016
1 parent d642afc commit bc69fed
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
14 changes: 7 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repositories {

group = 'net.minecraftforgefrance'
archivesBaseName = 'installer'
version = '2.1.3'
version = '2.2.0'
targetCompatibility = '1.6'
sourceCompatibility = '1.6'

Expand Down Expand Up @@ -82,11 +82,11 @@ task updaterJar(type: Jar, dependsOn: "jar"){
task fullUpdaterJar(type: Jar, dependsOn: "updaterJar"){
inputs.file jar.archivePath
from(configurations.compile.collect { zipTree(it).matching {
include 'org/tukaani/**/*.class'
include 'utybo/minkj/**/*.class'
include 'argo/**/*.class'
} })
archiveName = "updater-${project.version}-full.jar"
include 'org/tukaani/**/*.class'
include 'utybo/minkj/**/*.class'
include 'argo/**/*.class'
}})
archiveName = "updater-${project.version}.jar"
}

fullUpdaterJar.doFirst {
Expand All @@ -108,5 +108,5 @@ jar {
}

task wrapper(type: Wrapper) {
gradleVersion = '1.12'
gradleVersion = '2.7'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
34 changes: 26 additions & 8 deletions src/main/java/fr/minecraftforgefrance/common/ProcessInstall.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class ProcessInstall implements Runnable

public final File mcDir;
public final File modPackDir;

private boolean error = false;

public ProcessInstall(FileChecker file, IInstallRunner runner, File mcDir, String preset)
{
Expand Down Expand Up @@ -103,7 +105,10 @@ public void run()
{
this.downloadPreset();
}
this.finish();
if(!error)
{
this.finish();
}
}

public void deleteDeprecated()
Expand All @@ -125,6 +130,7 @@ public void deleteDeprecated()

/**
* Check for missing libraries
*
* @return the sum of all missing libs's size
*/
private int checkMissingLibs()
Expand Down Expand Up @@ -175,7 +181,7 @@ public String apply(JsonNode node)
String libURL = DownloadUtils.LIBRARIES_URL;
if(library.isStringValue("url"))
{
libURL = library.getStringValue("url") + "/";
libURL = library.getStringValue("url") + (!library.getStringValue("url").endsWith("/") ? "/" : "");
}
if(libPath.exists() && DownloadUtils.checksumValid(libPath, checksums))
{
Expand All @@ -202,7 +208,7 @@ public String apply(JsonNode node)
URLConnection connection = url.openConnection();
int fileLength = connection.getContentLength();
max += fileLength;
missingLibs.add(new LibEntry(libURL, libName, libPath, pack, fileLength, xz));
this.missingLibs.add(new LibEntry(libURL, libName, libPath, pack, fileLength, xz));
}
catch(IOException e)
{
Expand All @@ -215,6 +221,7 @@ public String apply(JsonNode node)

/**
* Get the sum of all files's size to download
*
* @return the size
*/
private int getTotalDownloadSize()
Expand Down Expand Up @@ -249,6 +256,8 @@ public void downloadMod()
this.installFrame.dispose();
JOptionPane.showMessageDialog(null, LANG.getTranslation("err.cannotdownload") + " : " + entry.getUrl().toString(), LANG.getTranslation("misc.error"), JOptionPane.ERROR_MESSAGE);
Thread.currentThread().interrupt();
this.error = true;
return;
}
}
}
Expand All @@ -262,11 +271,14 @@ public void downloadLib()
this.changeCurrentDownloadText(String.format(LANG.getTranslation("proc.downloadinglib"), entry.getName()));
try
{
if(!DownloadUtils.downloadFile(new URL(entry.getUrl()), entry.getPackDest(), this.installFrame))
File filePath = entry.isXZ() ? entry.getPackDest() : entry.getDest();
if(!DownloadUtils.downloadFile(new URL(entry.getUrl()), filePath, this.installFrame))
{
this.installFrame.dispose();
JOptionPane.showMessageDialog(null, LANG.getTranslation("err.cannotdownload") + " : " + entry.getUrl().toString() + DownloadUtils.PACK_NAME, LANG.getTranslation("misc.error"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, LANG.getTranslation("err.cannotdownload") + " : " + entry.getUrl().toString() + (entry.isXZ() ? DownloadUtils.PACK_NAME : ""), LANG.getTranslation("misc.error"), JOptionPane.ERROR_MESSAGE);
Thread.currentThread().interrupt();
this.error = true;
return;
}
else if(entry.isXZ())
{
Expand Down Expand Up @@ -329,6 +341,8 @@ public int size()
this.installFrame.dispose();
JOptionPane.showMessageDialog(null, LANG.getTranslation("err.cannotdownload") + " : " + RemoteInfoReader.instance().getPresetUrl() + this.preset + "/" + DownloadUtils.escapeURIPathParam(file), LANG.getTranslation("misc.error"), JOptionPane.ERROR_MESSAGE);
Thread.currentThread().interrupt();
this.error = true;
return;
}
}
catch(HeadlessException e)
Expand Down Expand Up @@ -401,9 +415,13 @@ private void createOrUpdateProfile()

/**
* determine if the profile exist and if it is valid in the file launcher_profiles.json
* @param profiles JsonRootNode of the file launcher_profiles.json
* @param modpackName name of the modpack
* @param displayName display name of the modpack
*
* @param profiles
* JsonRootNode of the file launcher_profiles.json
* @param modpackName
* name of the modpack
* @param displayName
* display name of the modpack
* @return true if the profile exist and is valid
*/
private boolean isProfileValid(JsonRootNode profiles, String modpackName, String displayName)
Expand Down

0 comments on commit bc69fed

Please sign in to comment.