diff --git a/readme.md b/readme.md index feb3ca4..bd86b07 100644 --- a/readme.md +++ b/readme.md @@ -12,12 +12,14 @@ Set your game automatically up for use with CreamAPI. ## Installation **Make sure you have Java 8 installed.** -Download the latest release and extract it into any folder (e.g. `%USERPROFILE%\Desktop\auto-cream-api`). +Download the latest release and extract it into any folder (e.g. `%USERPROFILE%\Desktop\auto-cream-api`). +*The included CreamAPI version may be outdated, get the most recent version and + **extract the DLL files from the nonlog_build folder to the Auto-CreamAPI folder!*** ## Usage -* Double-click `auto-cream-api.jar` to open the application. (When starting it for the first time, it might take a few -seconds since it needs to cache a list of games available on the Steam Store.) +* Double-click `auto-cream-api.jar` to open the application. (When starting it for the first time, it might take a few + seconds since it needs to cache a list of games available on the Steam Store.) * Alternatively, open a CMD window in the location of the application, and run it by entering the following: ```shell script java -jar auto-cream-api.jar diff --git a/src/main/java/Controller.java b/src/main/java/Controller.java index e167065..ea94846 100644 --- a/src/main/java/Controller.java +++ b/src/main/java/Controller.java @@ -1,10 +1,10 @@ import com.jfoenix.controls.*; -import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView; import javafx.beans.value.ChangeListener; import javafx.collections.FXCollections; import javafx.concurrent.Service; import javafx.concurrent.Task; import javafx.fxml.FXML; +import javafx.scene.control.Alert; import javafx.scene.control.Label; import javafx.scene.control.Tooltip; import javafx.stage.FileChooser; @@ -30,7 +30,21 @@ public class Controller { private static final String REGEX = "(?steam_api(?:64)?.dll)$"; public FontAwesomeIconView creamApiDllAppliedIcon; public FontAwesomeIconView creamApiConfigExists; - private final CreamApiDllHandler handler = CreamApiDllHandler.getInstance(); + private CreamApiDllHandler handler = null; + { + try { + handler = CreamApiDllHandler.getInstance(); + } catch (IOException e) { + Alert alert = new Alert(Alert.AlertType.ERROR); + alert.setTitle("CreamAPI DLLs missing!"); + alert.setHeaderText("CreamAPI DLL files can't be found!"); + alert.setContentText("Please download CreamAPI and extract the non-log " + + "version in the same folder as Auto-CreamAPI!\nThe program will now close."); + alert.showAndWait(); + System.exit(10); + } + } + private final CreamApiConfig config = CreamApiConfig.getInstance(); private final SteamAppsListCache cache = new SteamAppsListCache(); @FXML @@ -73,7 +87,6 @@ public class Controller { generate_tooltips(); fix_dlc_textarea_prompt_text(); reset(true); - state_label.setText("Ready."); } private void read() { diff --git a/src/main/java/util/CreamApiDllHandler.java b/src/main/java/util/CreamApiDllHandler.java index 8027047..c9f88a0 100644 --- a/src/main/java/util/CreamApiDllHandler.java +++ b/src/main/java/util/CreamApiDllHandler.java @@ -15,24 +15,14 @@ public class CreamApiDllHandler { private final String steamApiDllMd5; private final String steamApi64DllMd5; - private CreamApiDllHandler() { - String steamApiDllMd5 = ""; - String steamApi64DllMd5 = ""; - try { - steamApiDllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApiDllPath)); - } catch (IOException e) { - System.err.println("File missing: " + steamApiDllPath.toAbsolutePath().toString()); - } - try { - steamApi64DllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApi64DllPath)); - } catch (IOException e) { - System.err.println("File missing: " + steamApi64DllPath.toAbsolutePath().toString()); - } + private CreamApiDllHandler() throws IOException { + String steamApiDllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApiDllPath)); + String steamApi64DllMd5 = DigestUtils.md5Hex(Files.newInputStream(steamApi64DllPath)); this.steamApiDllMd5 = steamApiDllMd5; this.steamApi64DllMd5 = steamApi64DllMd5; } - public static synchronized CreamApiDllHandler getInstance() { + public static synchronized CreamApiDllHandler getInstance() throws IOException { if (creamApiDllHandlerInstance == null) { creamApiDllHandlerInstance = new CreamApiDllHandler(); } diff --git a/steam_api.dll b/steam_api.dll index 117c18f..9e780d3 100644 Binary files a/steam_api.dll and b/steam_api.dll differ diff --git a/steam_api64.dll b/steam_api64.dll index f27c80f..bcb85c4 100644 Binary files a/steam_api64.dll and b/steam_api64.dll differ diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..f64808e --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +4.4.0.0 \ No newline at end of file