diff --git a/.gitignore b/.gitignore index f79f7e7..ebc62ff 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,8 @@ covers/ backup/ vice/ images/ +saves/ +pcuae-install/ pcu.properties diff --git a/src/main/java/se/lantz/PCUAEManager.java b/src/main/java/se/lantz/PCUAEManager.java index c8c137b..b50eec0 100644 --- a/src/main/java/se/lantz/PCUAEManager.java +++ b/src/main/java/se/lantz/PCUAEManager.java @@ -11,7 +11,7 @@ import javax.swing.SwingUtilities; import javax.swing.UIManager; import se.lantz.gui.MainWindow; -import se.lantz.gui.install.VersionDownloadDialog; +import se.lantz.gui.install.ManagerDownloadDialog; import se.lantz.util.ExceptionHandler; import se.lantz.util.FileManager; import se.lantz.util.ManagerVersionChecker; @@ -71,7 +71,7 @@ public class PCUAEManager ManagerVersionChecker.fetchLatestVersionFromGithub(); if (ManagerVersionChecker.isNewVersionAvailable()) { - VersionDownloadDialog dialog = new VersionDownloadDialog(MainWindow.getInstance()); + ManagerDownloadDialog dialog = new ManagerDownloadDialog(MainWindow.getInstance()); dialog.pack(); dialog.setLocationRelativeTo(MainWindow.getInstance()); if (dialog.showDialog()) diff --git a/src/main/java/se/lantz/gui/MenuManager.java b/src/main/java/se/lantz/gui/MenuManager.java index 76feac4..099df1a 100644 --- a/src/main/java/se/lantz/gui/MenuManager.java +++ b/src/main/java/se/lantz/gui/MenuManager.java @@ -42,13 +42,18 @@ import se.lantz.gui.imports.ImportOptionsDialog; import se.lantz.gui.imports.ImportProgressDialog; import se.lantz.gui.imports.ImportSavedStatesDialog; import se.lantz.gui.imports.ImportSavedStatesWorker; -import se.lantz.gui.install.VersionDownloadDialog; +import se.lantz.gui.install.ManagerDownloadDialog; import se.lantz.manager.BackupManager; import se.lantz.manager.ExportManager; import se.lantz.manager.ImportManager; import se.lantz.manager.RestoreManager; import se.lantz.manager.SavedStatesManager; +import se.lantz.manager.pcuae.AmigaModeInstallManager; +import se.lantz.manager.pcuae.AtariModeInstallManager; +import se.lantz.manager.pcuae.LinuxModeInstallManager; import se.lantz.manager.pcuae.PCUAEInstallManager; +import se.lantz.manager.pcuae.RetroarchModeInstallManager; +import se.lantz.manager.pcuae.ViceModeInstallManager; import se.lantz.model.MainViewModel; import se.lantz.model.data.GameListData; import se.lantz.model.data.GameView; @@ -64,6 +69,7 @@ public class MenuManager private JMenu editMenu; private JMenu toolsMenu; private JMenu pcuaeMenu; + private JMenu pcuaeModeMenu; private JMenu helpMenu; private JMenuItem addGameItem; @@ -109,6 +115,11 @@ public class MenuManager private JMenuItem palNtscFixItem; private JMenuItem installPCUAEItem; + private JMenuItem installAmigaModeItem; + private JMenuItem installAtariModeItem; + private JMenuItem installLinuxModeItem; + private JMenuItem installRetroarchModeItem; + private JMenuItem installViceModeItem; private JMenuItem helpItem; private JMenuItem aboutItem; @@ -123,6 +134,11 @@ public class MenuManager private RestoreManager restoreManager; private SavedStatesManager savedStatesManager; private PCUAEInstallManager installPCUAEManager; + private AmigaModeInstallManager installAmigaManager; + private AtariModeInstallManager installAtariManager; + private LinuxModeInstallManager installLinuxManager; + private RetroarchModeInstallManager installRetroarchManager; + private ViceModeInstallManager installViceManager; private MainWindow mainWindow; public MenuManager(final MainViewModel uiModel, MainWindow mainWindow) @@ -136,6 +152,11 @@ public class MenuManager this.restoreManager = new RestoreManager(uiModel); this.savedStatesManager = new SavedStatesManager(uiModel, getPalNtscFixMenuItem()); this.installPCUAEManager = new PCUAEInstallManager(getExportItem()); + this.installAmigaManager = new AmigaModeInstallManager(); + this.installAtariManager = new AtariModeInstallManager(); + this.installLinuxManager = new LinuxModeInstallManager(); + this.installRetroarchManager = new RetroarchModeInstallManager(); + this.installViceManager = new ViceModeInstallManager(); uiModel.setSavedStatesManager(savedStatesManager); setupMenues(); } @@ -208,6 +229,13 @@ public class MenuManager pcuaeMenu = new JMenu("PCUAE"); pcuaeMenu.add(getInstallPCUAEItem()); + pcuaeModeMenu = new JMenu("Mode Packs"); + pcuaeModeMenu.add(getInstallAmigaModeItem()); + pcuaeModeMenu.add(getInstallAtariModeItem()); + pcuaeModeMenu.add(getInstallLinuxModeItem()); + pcuaeModeMenu.add(getInstallRetroarchModeItem()); + pcuaeModeMenu.add(getInstallViceModeItem()); + pcuaeMenu.add(pcuaeModeMenu); helpMenu = new JMenu("Help"); helpMenu.setMnemonic('H'); @@ -697,6 +725,62 @@ public class MenuManager return installPCUAEItem; } + private JMenuItem getInstallAmigaModeItem() + { + if (installAmigaModeItem == null) + { + installAmigaModeItem = new JMenuItem("Install Amiga mode..."); + installAmigaModeItem.setMnemonic('a'); + installAmigaModeItem.addActionListener(e -> installAmigaMode()); + } + return installAmigaModeItem; + } + + private JMenuItem getInstallAtariModeItem() + { + if (installAtariModeItem == null) + { + installAtariModeItem = new JMenuItem("Install Atari mode..."); + installAtariModeItem.setMnemonic('t'); + installAtariModeItem.addActionListener(e -> installAtariMode()); + } + return installAtariModeItem; + } + + private JMenuItem getInstallLinuxModeItem() + { + if (installLinuxModeItem == null) + { + installLinuxModeItem = new JMenuItem("Install Linux mode..."); + installLinuxModeItem.setMnemonic('l'); + installLinuxModeItem.addActionListener(e -> installLinuxMode()); + } + return installLinuxModeItem; + } + + private JMenuItem getInstallRetroarchModeItem() + { + if (installRetroarchModeItem == null) + { + installRetroarchModeItem = new JMenuItem("Install Retroarch mode..."); + installRetroarchModeItem.setMnemonic('r'); + installRetroarchModeItem.addActionListener(e -> installRetroarchMode()); + } + return installRetroarchModeItem; + } + + private JMenuItem getInstallViceModeItem() + { + if (installViceModeItem == null) + { + installViceModeItem = new JMenuItem("Install Vice mode..."); + installViceModeItem.setMnemonic('v'); + installViceModeItem.addActionListener(e -> installViceMode()); + } + return installViceModeItem; + } + + private JMenuItem getHelpItem() { helpItem = new JMenuItem("Help"); @@ -1034,6 +1118,31 @@ public class MenuManager installPCUAEManager.installPCUAE(); } + private void installAmigaMode() + { + installAmigaManager.installAmigaMode(); + } + + private void installAtariMode() + { + installAtariManager.installAtariMode(); + } + + private void installLinuxMode() + { + installLinuxManager.installLinuxMode(); + } + + private void installRetroarchMode() + { + installRetroarchManager.installRetroarchMode(); + } + + private void installViceMode() + { + installViceManager.installViceMode(); + } + private JEditorPane getPalNtscEditorPane() { String message = @@ -1082,7 +1191,7 @@ public class MenuManager ManagerVersionChecker.fetchLatestVersionFromGithub(); if (ManagerVersionChecker.isNewVersionAvailable()) { - VersionDownloadDialog dialog = new VersionDownloadDialog(MainWindow.getInstance()); + ManagerDownloadDialog dialog = new ManagerDownloadDialog(MainWindow.getInstance()); dialog.pack(); dialog.setLocationRelativeTo(MainWindow.getInstance()); if (dialog.showDialog()) diff --git a/src/main/java/se/lantz/gui/install/VersionDownloadDialog.java b/src/main/java/se/lantz/gui/install/ManagerDownloadDialog.java similarity index 77% rename from src/main/java/se/lantz/gui/install/VersionDownloadDialog.java rename to src/main/java/se/lantz/gui/install/ManagerDownloadDialog.java index 5c66629..383fa9a 100644 --- a/src/main/java/se/lantz/gui/install/VersionDownloadDialog.java +++ b/src/main/java/se/lantz/gui/install/ManagerDownloadDialog.java @@ -6,11 +6,11 @@ import java.awt.Frame; import se.lantz.gui.BaseDialog; import se.lantz.util.ManagerVersionChecker; -public class VersionDownloadDialog extends BaseDialog +public class ManagerDownloadDialog extends BaseDialog { - private VersionDownloadPanel panel; + private ManagerDownloadPanel panel; - public VersionDownloadDialog(Frame owner) + public ManagerDownloadDialog(Frame owner) { super(owner); setTitle("New version available"); @@ -22,12 +22,12 @@ public class VersionDownloadDialog extends BaseDialog getCancelButton().setPreferredSize(new Dimension(73, 23)); } - private VersionDownloadPanel getVersionDownloadPanel() { + private ManagerDownloadPanel getVersionDownloadPanel() { if (panel == null) { String downloadUrl = ManagerVersionChecker.getDownloadUrl(); String message = "There is a new version of PCUAE Manager available: " + ManagerVersionChecker.getLatestVersion() + "
" + "Do you want to update to the new version now?"; - panel = new VersionDownloadPanel(message); + panel = new ManagerDownloadPanel(message); } return panel; } diff --git a/src/main/java/se/lantz/gui/install/VersionDownloadPanel.java b/src/main/java/se/lantz/gui/install/ManagerDownloadPanel.java similarity index 95% rename from src/main/java/se/lantz/gui/install/VersionDownloadPanel.java rename to src/main/java/se/lantz/gui/install/ManagerDownloadPanel.java index 947e510..1f789d1 100644 --- a/src/main/java/se/lantz/gui/install/VersionDownloadPanel.java +++ b/src/main/java/se/lantz/gui/install/ManagerDownloadPanel.java @@ -15,12 +15,12 @@ import javax.swing.event.HyperlinkEvent; import se.lantz.util.ExceptionHandler; import se.lantz.util.ManagerVersionChecker; -public class VersionDownloadPanel extends JPanel +public class ManagerDownloadPanel extends JPanel { private JEditorPane editorPane; private String message; - public VersionDownloadPanel(String message) + public ManagerDownloadPanel(String message) { this.message = message; GridBagLayout gridBagLayout = new GridBagLayout(); diff --git a/src/main/java/se/lantz/gui/install/PCUAEProductDownloadDialog.java b/src/main/java/se/lantz/gui/install/PCUAEProductDownloadDialog.java new file mode 100644 index 0000000..4c7ce8b --- /dev/null +++ b/src/main/java/se/lantz/gui/install/PCUAEProductDownloadDialog.java @@ -0,0 +1,54 @@ +package se.lantz.gui.install; + +import java.awt.Dimension; + +import se.lantz.gui.BaseDialog; +import se.lantz.gui.MainWindow; +import se.lantz.manager.pcuae.BaseInstallManger; + +public class PCUAEProductDownloadDialog extends BaseDialog +{ + private ManagerDownloadPanel panel; + private boolean firstDownload; + private String productText; + private BaseInstallManger manager; + + public PCUAEProductDownloadDialog(final boolean firstDownload, final BaseInstallManger manager, String productName) + { + super(MainWindow.getInstance()); + this.firstDownload = firstDownload; + this.manager = manager; + this.productText = productName; + setTitle(firstDownload ? "Download " + productName : "New version available"); + addContent(getVersionDownloadPanel()); + this.setResizable(false); + getOkButton().setText("Yes"); + getCancelButton().setText("No"); + getOkButton().setPreferredSize(new Dimension(73, 23)); + getCancelButton().setPreferredSize(new Dimension(73, 23)); + } + + private ManagerDownloadPanel getVersionDownloadPanel() + { + if (panel == null) + { + String downloadUrl = manager.getDownloadUrl(); + String message = ""; + if (firstDownload) + { + message = "You have to download " + productText + " before installing it. The latest version is " + manager.getLatestVersion() + "
Do you want to download now?"; + } + else + { + message = "PCUAE " + manager.getLatestVersion() + + " is available.
(Current install file: " + manager.getLatestInInstallFolder() +
+ ").
Do you want to download and install the new version?";
+ }
+
+ panel = new ManagerDownloadPanel(message);
+ }
+ return panel;
+ }
+
+}
diff --git a/src/main/java/se/lantz/gui/install/PCUAEVersionDownloadDialog.java b/src/main/java/se/lantz/gui/install/PCUAEVersionDownloadDialog.java
deleted file mode 100644
index 61d1e7e..0000000
--- a/src/main/java/se/lantz/gui/install/PCUAEVersionDownloadDialog.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package se.lantz.gui.install;
-
-import java.awt.Dimension;
-import java.awt.Frame;
-
-import se.lantz.gui.BaseDialog;
-import se.lantz.manager.pcuae.PCUAEInstallManager;
-
-public class PCUAEVersionDownloadDialog extends BaseDialog
-{
- private VersionDownloadPanel panel;
- private boolean firstDownload;
-
- public PCUAEVersionDownloadDialog(Frame owner, boolean firstDownload)
- {
- super(owner);
- this.firstDownload = firstDownload;
- setTitle(firstDownload ? "Download PCUAE" : "New version available");
- addContent(getVersionDownloadPanel());
- this.setResizable(false);
- getOkButton().setText("Yes");
- getCancelButton().setText("No");
- getOkButton().setPreferredSize(new Dimension(73, 23));
- getCancelButton().setPreferredSize(new Dimension(73, 23));
- }
-
- private VersionDownloadPanel getVersionDownloadPanel()
- {
- if (panel == null)
- {
- String downloadUrl = PCUAEInstallManager.getDownloadUrl();
- String message = "";
- if (firstDownload)
- {
- message = "You have to download PCUAE before installing it. The latest version is " + PCUAEInstallManager.getLatestVersion() + "
Do you want to download now?"; - } - else - { - message = "PCUAE " + PCUAEInstallManager.getLatestVersion() + - " is available.
(Current install file: " + PCUAEInstallManager.getLatestInInstallFolder() +
- ").
Do you want to download and install the new version?";
- }
-
- panel = new VersionDownloadPanel(message);
- }
- return panel;
- }
-
-}
diff --git a/src/main/java/se/lantz/manager/pcuae/AmigaModeInstallManager.java b/src/main/java/se/lantz/manager/pcuae/AmigaModeInstallManager.java
new file mode 100644
index 0000000..b2585b7
--- /dev/null
+++ b/src/main/java/se/lantz/manager/pcuae/AmigaModeInstallManager.java
@@ -0,0 +1,36 @@
+package se.lantz.manager.pcuae;
+
+import javax.swing.JOptionPane;
+
+import se.lantz.gui.MainWindow;
+
+public class AmigaModeInstallManager extends BaseInstallManger
+{
+ private static final String PRODUCT_NAME = "Amiga mode";
+
+ public AmigaModeInstallManager()
+ {
+ }
+
+ public void installAmigaMode()
+ {
+ readVersionFromInstallFolder(AMIGA_MODE_INSTALL_NAME);
+ if (isNewVersionAvailable(AMIGA_MODE_INSTALL_NAME))
+ {
+ askAndStartDownload(PRODUCT_NAME);
+ }
+ else
+ {
+ askToInstallExistingVersion(PRODUCT_NAME);
+ }
+ }
+
+ @Override
+ protected void executeAfterInstallation()
+ {
+ JOptionPane.showMessageDialog(MainWindow.getInstance(),
+ PRODUCT_NAME + " installed successfully.",
+ "Installation complete",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+}
diff --git a/src/main/java/se/lantz/manager/pcuae/AtariModeInstallManager.java b/src/main/java/se/lantz/manager/pcuae/AtariModeInstallManager.java
new file mode 100644
index 0000000..83e76e2
--- /dev/null
+++ b/src/main/java/se/lantz/manager/pcuae/AtariModeInstallManager.java
@@ -0,0 +1,36 @@
+package se.lantz.manager.pcuae;
+
+import javax.swing.JOptionPane;
+
+import se.lantz.gui.MainWindow;
+
+public class AtariModeInstallManager extends BaseInstallManger
+{
+ private static final String PRODUCT_NAME = "Atari mode";
+
+ public AtariModeInstallManager()
+ {
+ }
+
+ public void installAtariMode()
+ {
+ readVersionFromInstallFolder(ATARI_MODE_INSTALL_NAME);
+ if (isNewVersionAvailable(ATARI_MODE_INSTALL_NAME))
+ {
+ askAndStartDownload(PRODUCT_NAME);
+ }
+ else
+ {
+ askToInstallExistingVersion(PRODUCT_NAME);
+ }
+ }
+
+ @Override
+ protected void executeAfterInstallation()
+ {
+ JOptionPane.showMessageDialog(MainWindow.getInstance(),
+ PRODUCT_NAME + " installed successfully.",
+ "Installation complete",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+}
diff --git a/src/main/java/se/lantz/manager/pcuae/BaseInstallManger.java b/src/main/java/se/lantz/manager/pcuae/BaseInstallManger.java
index eb5c2b8..170d055 100644
--- a/src/main/java/se/lantz/manager/pcuae/BaseInstallManger.java
+++ b/src/main/java/se/lantz/manager/pcuae/BaseInstallManger.java
@@ -19,9 +19,11 @@ import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
+import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
@@ -31,15 +33,28 @@ import dyorgio.runtime.out.process.CallableSerializable;
import dyorgio.runtime.run.as.root.RootExecutor;
import se.lantz.gui.MainWindow;
import se.lantz.gui.download.DownloadDialog;
+import se.lantz.gui.install.PCUAEProductDownloadDialog;
import se.lantz.util.ExceptionHandler;
+import se.lantz.util.ManagerVersionChecker;
public abstract class BaseInstallManger implements AWTEventListener
{
public static final String INSTALL_FOLDER = "./pcuae-install/";
+ protected static final String PCUAE_INSTALL_NAME = "pcuae";
+ protected static final String AMIGA_MODE_INSTALL_NAME = "amiga";
+ protected static final String ATARI_MODE_INSTALL_NAME = "atari";
+ protected static final String LINUX_MODE_INSTALL_NAME = "linux";
+ protected static final String RETROARCH_MODE_INSTALL_NAME = "retroarch";
+ protected static final String VICE_MODE_INSTALL_NAME = "vice";
+
private boolean blockEvents = false;
protected ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
+ protected String latestInInstallFolder = "";
+
+ protected GithubAssetInformation gitHubReleaseInformation = new GithubAssetInformation();
+
protected volatile boolean downloadIterrupted = false;
public BaseInstallManger()
@@ -91,15 +106,25 @@ public abstract class BaseInstallManger implements AWTEventListener
frame.getGlassPane().setVisible(false);
}
- protected String readVersionFromInstallFolder(String installFileName)
+ protected void readVersionFromInstallFolder(String installFileName)
{
- String latestInInstallFolder = "";
+ latestInInstallFolder = "";
FilenameFilter filter = new FilenameFilter()
{
@Override
public boolean accept(File f, String name)
{
- return name.contains(installFileName) && name.endsWith(".exe");
+ if (PCUAE_INSTALL_NAME.equals(installFileName))
+ {
+ //Check so that no other is part of the name
+ return !(name.contains(AMIGA_MODE_INSTALL_NAME) || name.contains(ATARI_MODE_INSTALL_NAME) ||
+ name.contains(LINUX_MODE_INSTALL_NAME) || name.contains(RETROARCH_MODE_INSTALL_NAME) ||
+ name.contains(VICE_MODE_INSTALL_NAME)) && name.endsWith(".exe");
+ }
+ else
+ {
+ return name.contains(installFileName) && name.endsWith(".exe");
+ }
}
};
File installFolder = new File(INSTALL_FOLDER);
@@ -120,7 +145,6 @@ public abstract class BaseInstallManger implements AWTEventListener
{
latestInInstallFolder = latestFile.getName();
}
- return latestInInstallFolder;
}
public GithubAssetInformation fetchLatestVersionFromGithub(String assetsName)
@@ -131,7 +155,7 @@ public abstract class BaseInstallManger implements AWTEventListener
//TODO: To get all releases, use "https://CommodoreOS@api.github.com/repos/CommodoreOS/PCUAE/releases"-
//Get all releases, check which one contains the latest file with assetName (part of the name)
- URL url = new URL("https://CommodoreOS@api.github.com/repos/CommodoreOS/PCUAE/releases/latest");
+ URL url = new URL("https://CommodoreOS@api.github.com/repos/CommodoreOS/PCUAE/releases");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestProperty("accept", "application/vnd.github.v3+json");
@@ -148,14 +172,89 @@ public abstract class BaseInstallManger implements AWTEventListener
JsonReader reader = new JsonReader(new StringReader(builder.toString()));
reader.setLenient(true);
JsonElement root = new JsonParser().parse(reader);
- JsonObject jsonObject = root.getAsJsonObject();
- githubInfo.setLatestVersion(jsonObject.get("tag_name").getAsString());
- githubInfo.setReleaseTagUrl(jsonObject.get("html_url").getAsString());
- //TODO: fix
- String downloadUrl =
- jsonObject.get("assets").getAsJsonArray().get(0).getAsJsonObject().get("browser_download_url").getAsString();
- githubInfo.setDownloadUrl(downloadUrl);
- githubInfo.setInstallFile(downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1));
+ JsonArray releases = root.getAsJsonArray();
+ //Find the latest one containing in assetName. Releases seem to be return in the right order (latest first)
+ boolean foundRelease = false;
+ for (JsonElement release : releases)
+ {
+ if (foundRelease)
+ {
+ break;
+ }
+ JsonObject jsonObject = release.getAsJsonObject();
+ JsonArray assets = jsonObject.get("assets").getAsJsonArray();
+ String downloadUrl = "";
+
+ for (JsonElement asset : assets)
+ {
+ String assetName = asset.getAsJsonObject().get("name").getAsString();
+ switch (assetsName)
+ {
+ case AMIGA_MODE_INSTALL_NAME:
+ {
+ if (assetName.contains(AMIGA_MODE_INSTALL_NAME))
+ {
+ downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
+ }
+ break;
+ }
+ case ATARI_MODE_INSTALL_NAME:
+ {
+ if (assetName.contains(ATARI_MODE_INSTALL_NAME))
+ {
+ downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
+ }
+ break;
+ }
+ case LINUX_MODE_INSTALL_NAME:
+ {
+ if (assetName.contains(LINUX_MODE_INSTALL_NAME))
+ {
+ downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
+ }
+ break;
+ }
+ case RETROARCH_MODE_INSTALL_NAME:
+ {
+ if (assetName.contains(RETROARCH_MODE_INSTALL_NAME))
+ {
+ downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
+ }
+ break;
+ }
+ case VICE_MODE_INSTALL_NAME:
+ {
+ if (assetName.contains(VICE_MODE_INSTALL_NAME))
+ {
+ downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
+ }
+ break;
+ }
+ case PCUAE_INSTALL_NAME:
+ {
+ if (!(assetName.contains(AMIGA_MODE_INSTALL_NAME) || assetName.contains(ATARI_MODE_INSTALL_NAME) ||
+ assetName.contains(LINUX_MODE_INSTALL_NAME) || assetName.contains(RETROARCH_MODE_INSTALL_NAME) ||
+ assetName.contains(VICE_MODE_INSTALL_NAME)))
+ {
+ downloadUrl = asset.getAsJsonObject().get("browser_download_url").getAsString();
+ }
+ break;
+ }
+ default:
+ throw new IllegalArgumentException("Unexpected value: " + assetsName);
+ }
+
+ if (!downloadUrl.isEmpty())
+ {
+ githubInfo.setLatestVersion(release.getAsJsonObject().get("tag_name").getAsString());
+ githubInfo.setReleaseTagUrl(release.getAsJsonObject().get("html_url").getAsString());
+ githubInfo.setInstallFile(assetName);
+ githubInfo.setDownloadUrl(downloadUrl);
+ foundRelease = true;
+ break;
+ }
+ }
+ }
}
catch (IOException ex)
{
@@ -164,7 +263,7 @@ public abstract class BaseInstallManger implements AWTEventListener
return githubInfo;
}
- protected void runAndWaitForInstallation(String fileToInstall)
+ protected void runAndWaitForInstallation()
{
switchToBusyCursor(MainWindow.getInstance());
RootExecutor rootExecutor;
@@ -172,19 +271,19 @@ public abstract class BaseInstallManger implements AWTEventListener
{
rootExecutor = new RootExecutor("-Xmx64m");
// Execute privileged action without return
- CallableSerializable