From 28017e8103dc183ecea8031c71aef94b47472457 Mon Sep 17 00:00:00 2001 From: Henry Le Grys Date: Sat, 1 Jan 2022 04:34:15 +0000 Subject: [PATCH] Fix edge case in logging config handling If the user cancelled the install process after the temp logging config file was created, but before the installer executes, the pack would fail to install on relaunch. Fix by allowing overwriting of the temp file. --- .../src/main/java/com/skcraft/launcher/update/BaseUpdater.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/src/main/java/com/skcraft/launcher/update/BaseUpdater.java b/launcher/src/main/java/com/skcraft/launcher/update/BaseUpdater.java index 4f35b0de6..e447ef031 100644 --- a/launcher/src/main/java/com/skcraft/launcher/update/BaseUpdater.java +++ b/launcher/src/main/java/com/skcraft/launcher/update/BaseUpdater.java @@ -39,6 +39,7 @@ import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardCopyOption; import java.util.*; import java.util.logging.Level; @@ -298,7 +299,7 @@ protected void installLibraries(@NonNull Installer installer, // Use our embedded replacement Path tempFile = installer.getTempDir().toPath().resolve(file.getId()); - Files.copy(embeddedConfig, tempFile); + Files.copy(embeddedConfig, tempFile, StandardCopyOption.REPLACE_EXISTING); log.info("Substituting embedded logging config " + file.getId()); installer.queue(new FileMover(tempFile.toFile(), targetFile));