|
20 | 20 | import lol.hyper.customlauncher.accounts.JSONManager; |
21 | 21 | import lol.hyper.customlauncher.accounts.windows.MainWindow; |
22 | 22 | import lol.hyper.customlauncher.invasiontracker.InvasionTracker; |
23 | | -import lol.hyper.customlauncher.setup.FirstSetup; |
24 | 23 | import lol.hyper.customlauncher.ttrupdater.TTRUpdater; |
25 | 24 | import lol.hyper.customlauncher.updater.UpdateChecker; |
| 25 | +import org.apache.commons.lang3.SystemUtils; |
26 | 26 | import org.apache.logging.log4j.LogManager; |
27 | 27 | import org.apache.logging.log4j.Logger; |
28 | 28 | import org.json.JSONArray; |
@@ -85,28 +85,30 @@ public static void main(String[] args) throws IOException { |
85 | 85 | Main.logger.info("Converting account storage to JSONArray format."); |
86 | 86 | } |
87 | 87 |
|
88 | | - String latestVersion = UpdateChecker.getLatestVersion(); |
89 | | - if (!latestVersion.equals(VERSION)) { |
90 | | - logger.info("A new version is available! Version: " + latestVersion); |
91 | | - int dialogResult = |
92 | | - JOptionPane.showConfirmDialog( |
93 | | - null, |
94 | | - "A new update is available. Would you like to download the new version?", |
95 | | - "New Update", |
96 | | - JOptionPane.YES_NO_OPTION); |
97 | | - if (dialogResult == JOptionPane.YES_OPTION) { |
98 | | - UpdateChecker.downloadLatestVersion(); |
99 | | - int dialogResult2 = |
| 88 | + if (SystemUtils.IS_OS_WINDOWS) { |
| 89 | + String latestVersion = UpdateChecker.getLatestVersion(); |
| 90 | + if (!latestVersion.equals(VERSION)) { |
| 91 | + logger.info("A new version is available! Version: " + latestVersion); |
| 92 | + int dialogResult = |
100 | 93 | JOptionPane.showConfirmDialog( |
101 | 94 | null, |
102 | | - "Version " |
103 | | - + latestVersion |
104 | | - + " was downloaded. Would you like to run this new version?", |
| 95 | + "A new update is available. Would you like to download the new version?", |
105 | 96 | "New Update", |
106 | 97 | JOptionPane.YES_NO_OPTION); |
107 | | - if (dialogResult2 == JOptionPane.YES_OPTION) { |
108 | | - UpdateChecker.launchNewVersion(latestVersion); |
109 | | - System.exit(0); |
| 98 | + if (dialogResult == JOptionPane.YES_OPTION) { |
| 99 | + UpdateChecker.downloadLatestVersion(); |
| 100 | + int dialogResult2 = |
| 101 | + JOptionPane.showConfirmDialog( |
| 102 | + null, |
| 103 | + "Version " |
| 104 | + + latestVersion |
| 105 | + + " was downloaded. Would you like to run this new version?", |
| 106 | + "New Update", |
| 107 | + JOptionPane.YES_NO_OPTION); |
| 108 | + if (dialogResult2 == JOptionPane.YES_OPTION) { |
| 109 | + UpdateChecker.launchNewVersion(latestVersion); |
| 110 | + System.exit(0); |
| 111 | + } |
110 | 112 | } |
111 | 113 | } |
112 | 114 | } |
|
0 commit comments