Self updater problems
Benj2005 opened this issue ยท 8 comments
On Windows, the self updater (added in #504) fails to replace the Wynntils jar file because it's already in use.
(Presumably by the mod loader?)
Full log: https://pastebin.com/efMeiLSY
Relevant Part:
[09:12:38] [Thread-50/ERROR]: Cannot apply update!
java.nio.file.FileSystemException: I:\MultiMC\instances\Wynncraft--\.minecraft\mods\wynntils-1.1.0+386.MC1.18.2-fabric.jar: The process cannot access the file because it is being used by another process
at Not Enough Crashes deobfuscated stack trace.(1.18.2+build.4) ~[?:?]
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92) ~[?:?]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:171) ~[?:?]
at sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:284) ~[?:?]
at java.nio.file.Files.copy(Files.java:1305) ~[?:?]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:850) ~[commons-io-2.11.0.jar:?]
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:756) ~[commons-io-2.11.0.jar:?]
at com.wynntils.core.managers.UpdateManager.lambda$addShutdownHook$1(UpdateManager.java:146) ~[wynntils-1.1.0+386.MC1.18.2-fabric.jar:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Additional Information:
Mod Loader: Fabric 0.14.9 (MC 1.18.2)
Launcher: MultiMC 5 - Version 0.7.0-develop-3524
Wynntils Build: 386 / 84ea2bf (Currently second newest to test updating to build 387)
Another problem is that we are dependent on the mod jar name to find the build number, however we do not rename the mod jar when updating.
Another problem is that we are dependent on the mod jar name to find the build number, however we do not rename the mod jar when updating.
We are?
Another problem is that we are dependent on the mod jar name to find the build number, however we do not rename the mod jar when updating.
We are?
I think we are
Another problem is that we are dependent on the mod jar name to find the build number, however we do not rename the mod jar when updating.
We are?
I think we are
How so? We use the mod version for the appropriate version?
Another problem is that we are dependent on the mod jar name to find the build number, however we do not rename the mod jar when updating.
We are?
I think we are
How so? We use the mod version for the appropriate version?
Where do we parse mod version from? I hope its not from mod name
The loader does from mod.json or mod.toml
Another problem is that we are dependent on the mod jar name to find the build number, however we do not rename the mod jar when updating.
We are?
I think we are
How so? We use the mod version for the appropriate version?
Where do we parse mod version from? I hope its not from mod name
Hm. If the mod jar file has a name which include the version number, then we should overwrite it with a different version with the same name. That'd be ... disingenuous. Maybe we should always name the auto-updated mod like "wynntils-auto-updated.jar"; so if we start with a specific build, we'll remove it and replace with the wynntils-auto-updated.jar
, but for further updates, we'll overwrite this file..?