PhoenicisOrg / scripts

Phoenicis scripts
GNU Lesser General Public License v3.0
64 stars 49 forks source link

Add Heroes of Might and Magic IV #1144

Open Zemogiter opened 4 years ago

Zemogiter commented 4 years ago

Description

When the wineprefix is created and just before the selected .exe file is launched, installation crashes with this error:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - Input/Output error
    at java.base/java.io.FileInputStream.readBytes(Native Method)
    at java.base/java.io.FileInputStream.read(FileInputStream.java:257)
    at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:78)
    at org.phoenicis.win32.pe.PEReader.readDosHeader(PEReader.java:93)
    at org.phoenicis.win32.pe.PEReader.parseExecutable(PEReader.java:30)
    at org.phoenicis.tools.win32.ExeAnalyser.isArchitecture(ExeAnalyser.java:62)
    at org.phoenicis.tools.win32.ExeAnalyser.is64Bits(ExeAnalyser.java:46)
    at <js> run(Unnamed:413:15444-15490)
    at <js> run(Unnamed:171:5412-5502)
    at <js> go(Unnamed:88:3412-3493)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy66.go(Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by host exception: java.io.IOException: Błąd wejścia/wyjścia

[WARNING] 
org.graalvm.polyglot.PolyglotException: Input/Output error
    at java.io.FileInputStream.readBytes (Native Method)
    at java.io.FileInputStream.read (FileInputStream.java:257)
    at org.apache.commons.io.input.ProxyInputStream.read (ProxyInputStream.java:78)
    at org.phoenicis.win32.pe.PEReader.readDosHeader (PEReader.java:93)
    at org.phoenicis.win32.pe.PEReader.parseExecutable (PEReader.java:30)
    at org.phoenicis.tools.win32.ExeAnalyser.isArchitecture (ExeAnalyser.java:62)
    at org.phoenicis.tools.win32.ExeAnalyser.is64Bits (ExeAnalyser.java:46)
    at <js>.run (Unnamed:413)
    at <js>.run (Unnamed:171)
    at <js>.go (Unnamed:88)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy66.go (Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

This error is caused by the setup.exe file in my cd disc being weird. Not corrupted because installation from it works in Windows. However I tried a local GOG installer and it works just fine.

The main objective is to get this game to work and install this mod: https://equilibris.celestialheavens.com/eng/downloads.html To fix game balance and bugs.

What works

Installation using GOG installation file and the game itself

What was not tested

Running the Equilibris mod due to the script searching for H4mod.exe file right after the game installation process ends. This file is created after the mod installation is finished. Fixed by #1170 Now it's the equi.aop file download that crashes the script:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - Download of https://equilibris.celestialheavens.com/downloads/equi.aop has failed
    at org.phoenicis.tools.http.Downloader.get(Downloader.java:108)
    at org.phoenicis.tools.http.Downloader.get(Downloader.java:81)
    at <js> get(Unnamed:135-144:3540-3841)
    at <js> :=>(Unnamed:37-42:1612-1857)
    at <js> go(Unnamed:98:3725-3760)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy68.go(Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by host exception: org.phoenicis.tools.http.DownloadException: Download of https://equilibris.celestialheavens.com/downloads/equi.aop has failed

[WARNING] 
org.graalvm.polyglot.PolyglotException: Download of https://equilibris.celestialheavens.com/downloads/equi.aop has failed
    at org.phoenicis.tools.http.Downloader.get (Downloader.java:108)
    at org.phoenicis.tools.http.Downloader.get (Downloader.java:81)
    at <js>.get (Unnamed:135)
    at <js>.:=> (Unnamed:37)
    at <js>.go (Unnamed:98)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy68.go (Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)

Test

plata commented 4 years ago

Can you translate this:

Caused by host exception: java.io.IOException: Błąd wejścia/wyjścia

?

Zemogiter commented 4 years ago

Input/output error

madoar commented 4 years ago

Most likely something is wrong with either the exe file itself or the handling code of it.

Zemogiter commented 4 years ago

Just tried launching the setup.exe in vanilla wine. I got a error screen with three rectangular symbols (usually used when something dosen't recorgnize a character) followed by 9 "file not found" messages, each appearing after the previous one was closed. The file works fine in Windows 64bit so it's a Wine issue. UPDATE: Tried wine version 3.0.3 because it was the latest one tested in AppDB. Same error happens.

madoar commented 4 years ago

By wine error you mean an error unrelated to phoenicis or is it because of something happening in phoenicis-winebuild?

Zemogiter commented 4 years ago

I think it's unrelated to phoenicis because I get errors when launching setup.exe file regardless.

Zemogiter commented 4 years ago

Tried my instalation disc in Lutris. Dosen't work there as well. Tried GOG installer and it works. But the default installation directory is different than installing from CD. UPDATE: It seems my iso file was corrupted all along... Because when use a physical disc the exe file starts and installation goes normally. Installation crashes with an error. I'll see if it will work on windows. UPDATE 2: The disc works fine on windows.

plata commented 4 years ago

@Zemogiter you've marked this as ready for review but the PR description says that nothing is working. What's the status of this PR?

Zemogiter commented 4 years ago

@plata op just updated

madoar commented 4 years ago

@Zemogiter how is the current state of this PR? Is it installable/runnable or is it still work in progress?

Zemogiter commented 4 years ago

@madoar For some reason the script ignores the postInstall() stage and tries to look for H4mod.exe file which dosen't exist yet.

madoar commented 4 years ago

... and tries to look for H4mod.exe file which dosen't exist yet.

You mean during shortcut creation?

The reason is that the postInstall hook is executed after the installation has been finished and the shortcut been created. See:

https://github.com/PhoenicisOrg/scripts/blob/07185465bec2abf292123af8f9f80e608a29cd77/Engines/Wine/QuickScript/Installer%20Script/script.js#L84-L100

Maybe you want to use the preInstall hook instead?

Zemogiter commented 4 years ago

That is not possible because the game must be installed in order to run both patch resources and mod resource. A better option would be to swap places with this._createShortcut and this._postInstall

madoar commented 4 years ago

@plata what do you think, should we swap this._createShortcut and this._postInstall?

plata commented 4 years ago

I have something in the back of my head that we had a reason to do it like this. I cannot remember though.

Zemogiter commented 4 years ago

After the latest commit and swaping shortcut and postInstall the two patch files download and run successfully. But equi.aop crashes:

[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - Download of https://equilibris.celestialheavens.com/downloads/equi.aop has failed
    at org.phoenicis.tools.http.Downloader.get(Downloader.java:108)
    at org.phoenicis.tools.http.Downloader.get(Downloader.java:81)
    at <js> get(Unnamed:135-144:3540-3841)
    at <js> :=>(Unnamed:37-42:1612-1857)
    at <js> go(Unnamed:98:3725-3760)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke(HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy68.go(Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by host exception: org.phoenicis.tools.http.DownloadException: Download of https://equilibris.celestialheavens.com/downloads/equi.aop has failed

[WARNING] 
org.graalvm.polyglot.PolyglotException: Download of https://equilibris.celestialheavens.com/downloads/equi.aop has failed
    at org.phoenicis.tools.http.Downloader.get (Downloader.java:108)
    at org.phoenicis.tools.http.Downloader.get (Downloader.java:81)
    at <js>.get (Unnamed:135)
    at <js>.:=> (Unnamed:37)
    at <js>.go (Unnamed:98)
    at com.oracle.truffle.polyglot.ObjectProxyHandler.invoke (HostInteropReflect.java:678)
    at com.sun.proxy.$Proxy68.go (Unknown Source)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:237)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)