ho-dev / HattrickOrganizer

Assistant for Hattrick online football manager
https://ho-dev.github.io/HattrickOrganizer/
GNU Lesser General Public License v3.0
190 stars 77 forks source link

[BUG] Portable Version AutoUpgrade Can't find Java #1681

Closed Synthespian closed 1 year ago

Synthespian commented 1 year ago

Describe the bug When trying to load HO, using a portable version (64 inc JVM), the error is show that it can't find the JVM on the system.

To Reproduce Use portable Load HO

Screenshots image

Platform information: Windows 10

Additional context Just did an auto-upgrade today. Can't see which version it's taken me to cos the splash screen doesn't load. Possibly linked to https://github.com/akasolace/HO/issues/1654 and some code bundling of the portable version? Have tried to overlay 6.1.384 but that has same issue.

Synthespian commented 1 year ago

Also, tried updating Java to 8.351 but that still doesn't help it run.

masterpatje commented 1 year ago

Checked it. And got the same issue: (so it has nothing to do with the JRE version) Updating HO from the menu and restarting gives:

Footnote: the foldername HO-7.0.366.0-portable-win-DEV-JRE (previous version) remains the same. So maybe it is not possible to auto-update it?!

image

masterpatje commented 1 year ago

When I download HO-7.0.396.0-portable-win-DEV-JRE I got on opening the application after unzipping the folder with 7-zip: image

masterpatje commented 1 year ago

Also on updating the application did not close by itself. Just checked with HO6 version when auto-updating. 1) auto update via menu 2) choose direct installation 3) application closes by itself 4) asked to deinstall previous version 5) updated the version

So maybe with the portable version things works a bit differently when updating? Or there is something wrong with HO 7.0.369?

Synthespian commented 1 year ago

hey. So ... 1) yes, used JRE of course. Maybe you looked before my edit of the post. I said I used JRE, and then tested without JRE to see if it can find the JAVA. It couldn't. Neither version of SIX (6) portable works.
2) auto-update doesn't close by itself but it did ask me to restart HO to apply changes, and nothing else.

your v7 issue is very similar to the error as posted on the item I linked.

wsbrenk commented 1 year ago

update failed !java.io.FileNotFoundException: C:\Users\wolfg\Documents\ho6-portable..install4j\i4jinst.dll (Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird) at java.base/java.io.FileOutputStream.open0(Native Method) at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293) at java.base/java.io.FileOutputStream.(FileOutputStream.java:235) at java.base/java.io.FileOutputStream.(FileOutputStream.java:184) at core.HOLauncher.update(HOLauncher.java:179) at core.HOLauncher.main(HOLauncher.java:47) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94) at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25) java.lang.UnsatisfiedLinkError: no awt in system library path: c:\users\wolfg\documents\ho6-portable\jre\bin at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2403) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818) at java.base/java.lang.System.loadLibrary(System.java:1989) at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1388) at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1386) at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1385) at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1423) at java.desktop/java.awt.Toolkit.(Toolkit.java:1397) at java.desktop/java.awt.Component.(Component.java:624) at core.HO.main(HO.java:141) at core.HOLauncher.main(HOLauncher.java:77) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94) at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)

chelodegli commented 1 year ago

I'm having today the same issue as @Synthespian I updated with "auto-update" option from HO_3.0.2.2728.

My notebook is running on Windows 8.1 64bits.

What should I do to fix this? Thanks for your help.

wsbrenk commented 1 year ago

auto update of portable installation is defective.

workaround:

if you replace files in existing portable installation folder, check that the file update.piz does NOT exist. Delete it if you find it in your installation (it is a relict of an buggy update)!

masterpatje commented 1 year ago

Confirmation, small addition:

wsbrenk commented 1 year ago

exclude .install4j folder from deletion. i'm not sure if the unpacking of .install4j from update packet will correctly replace the install4j files.

wsbrenk commented 1 year ago

cannot delete file animated-gif-lib-1.4.jar cannot delete file annotations-23.0.0.jar cannot delete file commons-lang3-3.12.0.jar cannot delete file commons-logging-1.2.jar cannot delete file commons-text-1.10.0.jar cannot delete file darklaf-compatibility-3.0.2.jar cannot delete file darklaf-core-3.0.2.jar cannot delete file darklaf-iconset-3.0.2.jar cannot delete file darklaf-macos-3.0.2.jar cannot delete file darklaf-native-utils-3.0.2.jar cannot delete file darklaf-platform-base-3.0.2.jar cannot delete file darklaf-platform-decorations-3.0.2.jar cannot delete file darklaf-platform-preferences-3.0.2.jar cannot delete file darklaf-property-loader-3.0.2.jar cannot delete file darklaf-theme-3.0.2.jar cannot delete file darklaf-theme-spec-3.0.2.jar cannot delete file darklaf-utils-3.0.2.jar cannot delete file darklaf-windows-3.0.2.jar cannot delete file fontbox-2.0.24.jar cannot delete file graphics2d-0.32.jar cannot delete file gson-2.9.0.jar cannot delete file HO.exe cannot delete file HO.jar cannot delete file hsqldb-2.7.1.jar cannot delete file install4j-runtime-8.0.7.jar cannot delete file jackson-annotations-2.13.4.jar cannot delete file jackson-core-2.13.4.jar cannot delete file jackson-databind-2.13.4.jar cannot delete file javatuples-1.2.jar cannot delete file java.dll cannot delete file jimage.dll cannot delete file management.dll cannot delete file management_ext.dll cannot delete file net.dll cannot delete file nio.dll cannot delete file prefs.dll cannot delete file jvm.dll cannot delete file vcruntime140_1.dll cannot delete file zip.dll cannot delete file modules cannot delete file jsoup-1.15.3.jar cannot delete file jsvg-0.0.9.jar cannot delete file kotlin-stdlib-1.6.20.jar cannot delete file kotlin-stdlib-common-1.6.20.jar cannot delete file kotlin-stdlib-jdk7-1.6.10.jar cannot delete file kotlin-stdlib-jdk8-1.6.10.jar cannot delete file logging-interceptor-4.10.0.jar cannot delete file okhttp-4.10.0.jar cannot delete file okhttp-tls-4.10.0.jar cannot delete file okio-jvm-3.0.0.jar cannot delete file pdfbox-2.0.24.jar cannot delete file scribejava-core-8.3.2.jar cannot delete file scribejava-java8-8.3.2.jar cannot delete file swing-extensions-laf-support-0.1.3.jar cannot delete file swing-extensions-visual-padding-0.1.3.jar cannot delete file VectorGraphics2D-0.13.jar cannot delete file xchart-3.8.1.jar [Info] HO: VERSION: 7.0 versionType: DEV RevisionNumber: 405

wsbrenk commented 1 year ago

the exception happens when install4j is unpacked.

wsbrenk commented 1 year ago

JVM could not found when HO is restarted - the old jre was deleted and the new one not yet unpacked

wsbrenk commented 1 year ago

as far as i understand until now, the install4j does not support auto updates for archives (HO portables).

Idea: Disable the auto update option for portable versions. users of the portables should be able to update HO manually. otherwise we have to reinvent the wheel (install4j)

masterpatje commented 1 year ago

I would go for disabling the auto-update function.

Or maybe even better; when clicking the auto-update; give a pop-up message (or something similar) indicating that portable versions should be manually updated and the steps how to update it manually (downloading, unpacking, copying db (and img) folder from previous installation).

I am confident that you will present something suitable.

And maybe you can have a long term project (on hold) for new people that want to do development work.

Synthespian commented 1 year ago

I agree. Disable. Definitely want a "new version is available" message. But then disable and correct install flow.

wsbrenk commented 1 year ago

updates are found and downloaded on request unpacking has to be done by hand.

Synthespian commented 1 year ago

Reoccured with the update to v7 today Same error.