Fixed update machanism (Fixes #384). Update to 1.3.1.

This commit is contained in:
MetaPrime 2016-12-25 19:40:54 -06:00
parent b5ee49c9db
commit e16544428d
3 changed files with 9 additions and 5 deletions

View File

@ -4,7 +4,7 @@
<groupId>com.rarchives.ripme</groupId>
<artifactId>ripme</artifactId>
<packaging>jar</packaging>
<version>1.3.0</version>
<version>1.3.1</version>
<name>ripme</name>
<url>http://rip.rarchives.com</url>
<properties>

View File

@ -1,7 +1,8 @@
{
"latestVersion" : "1.3.0",
"changeList" : [
"1.3.0: Fix Instagram, Tumblr, 4chan rippers. Some new features.",
"1.3.1: Fix update mechanism. Improved Imgur. Some improvements.",
"1.3.0: Fix Instagram, Tumblr, xHamster, 4chan, 8muses. Some new features.",
"1.2.13: Hotfix for imgur album rips",
"1.2.12: 500px gallery/subgallery support",
"1.2.11: Deviant fav subfolders, and reddituploads support",

View File

@ -21,12 +21,15 @@ import com.rarchives.ripme.utils.Utils;
public class UpdateUtils {
private static final Logger logger = Logger.getLogger(UpdateUtils.class);
private static final String DEFAULT_VERSION = "1.3.0";
private static final String DEFAULT_VERSION = "1.3.1";
private static final String updateJsonURL = "https://cdn.rawgit.com/4pr0n/ripme/master/ripme.json";
private static final String updateJarURL = "https://github.com/4pr0n/ripme/releases/download/" + DEFAULT_VERSION + "/ripme.jar";
private static final String mainFileName = "ripme.jar";
private static final String updateFileName = "ripme.jar.update";
public static String getUpdateJarURL(String latestVersion) {
return "https://github.com/4pr0n/ripme/releases/download/" + latestVersion + "/ripme.jar";
}
public static String getThisJarVersion() {
String thisVersion = UpdateUtils.class.getPackage().getImplementationVersion();
if (thisVersion == null) {
@ -86,7 +89,7 @@ public class UpdateUtils {
configUpdateLabel.setText("<html><font color=\"green\">Downloading new version...</font></html>");
logger.info("New version found, downloading...");
try {
UpdateUtils.downloadJarAndLaunch(updateJarURL);
UpdateUtils.downloadJarAndLaunch(getUpdateJarURL(latestVersion));
} catch (IOException e) {
JOptionPane.showMessageDialog(null,
"Error while updating: " + e.getMessage(),