scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Add IMG Tool

Open LeandroStanger opened this issue 6 years ago • 12 comments

https://www.gtagarage.com/mods/show.php?id=63

LeandroStanger avatar Jan 12 '19 11:01 LeandroStanger

Do you want to give it a try? We can support you if needed. I guess you can more or less copy the Notepad++ script though.

plata avatar Jan 12 '19 14:01 plata

@plata Is the script correct?

include(["engines", "wine", "quick_script", "online_installer_script"]);

var installerImplementation = {
    run: function () {
        new OnlineInstallerScript()
            .name("IMG Tool")
            .editor("gtagarage.com")
            .applicationHomepage("https://www.gtagarage.com/mods/show.php?id=63)
            .author("Leandro Stanger")
            .url("https://www.gtagarage.com/mods/download.php?f=90")
            .checksum("9d4d1727c976a06c670dd7a00771de3f375b22ea")
            .category("Development")
            .executable("IMGTool.exe")
            .go();
    }
};

/* exported Installer */
var Installer = Java.extend(org.phoenicis.scripts.Installer, installerImplementation);

LeandroStanger avatar Jan 13 '19 00:01 LeandroStanger

Category "Development" or rather "Games"? Otherwise it looks good at a first glance. You can follow the steps in the README to create a working app (with all required files) and test it.

plata avatar Jan 13 '19 09:01 plata

Error installing IMG Tool https://github.com/LeandroStanger/Phoenicis-scripts/tree/master/Applications/Development/IMG%20Tool

javax.script.ScriptException: Executable IMGTool.exe not found! in <eval> at line number 121 at column number 8
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:461)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at [email protected]/org.phoenicis.scripts.nashorn.NashornEngine.eval(NashornEngine.java:50)
	at [email protected]/org.phoenicis.scripts.nashorn.NashornScriptInterpreter.runScript(NashornScriptInterpreter.java:35)
	at [email protected]/org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$runScript$0(BackgroundScriptInterpreter.java:35)
	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: <eval>:121:8 Executable IMGTool.exe not found!
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAException.create(ECMAException.java:113)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1394$2842$\^eval\_$cu1$restOf.create([engines, wine, shortcuts, wine]:121)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1391$3037A$\^eval\_$cu1$restOf._createShortcut([engines, wine, quick_script, quick_script]:132)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1378$553$\^eval\_$cu1$restOf.go([engines, wine, quick_script, installer_script]:87)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1238$208$\^eval\_.run(<eval>:9)
	at jdk.nashorn.javaadapters.org_phoenicis_scripts_Installer.run(Unknown Source)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1237$\^eval\_$cu1$restOf.:program(<eval>:25)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	... 10 more

LeandroStanger avatar Jan 13 '19 11:01 LeandroStanger

Are you sure that IMGTool.exe is really the name of the executable once it is installed?

qparis avatar Jan 13 '19 12:01 qparis

Yes captura de tela de 2019-01-13 10-23-22

LeandroStanger avatar Jan 13 '19 12:01 LeandroStanger

I see. Online Installer Script does not work with a zip archive for the moment. You may want to try ZipScript. You have some examples in the directory (Druid Soccer for example)

qparis avatar Jan 13 '19 12:01 qparis

Error installing IMG Tool https://github.com/LeandroStanger/Phoenicis-scripts/tree/master/Applications/Development/IMG%20Tool

javax.script.ScriptException: TypeError: Cannot read property "toString" from undefined in [utils, functions, net, download] at line number 149
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:461)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at [email protected]/org.phoenicis.scripts.nashorn.NashornEngine.eval(NashornEngine.java:50)
	at [email protected]/org.phoenicis.scripts.nashorn.NashornScriptInterpreter.runScript(NashornScriptInterpreter.java:35)
	at [email protected]/org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$runScript$0(BackgroundScriptInterpreter.java:35)
	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: [utils, functions, net, download]:149 TypeError: Cannot read property "toString" from undefined
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Undefined.get(Undefined.java:161)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$343$2701$\^eval\_$cu1$restOf.get([utils, functions, net, download]:149)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$326$703$\^eval\_$cu1$restOf.go([engines, wine, quick_script, zip_script]:49)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$203$195$\^eval\_.run(<eval>:9)
	at jdk.nashorn.javaadapters.org_phoenicis_scripts_Installer.run(Unknown Source)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$202$\^eval\_$cu1$restOf.:program(<eval>:25)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	... 10 more

LeandroStanger avatar Jan 13 '19 12:01 LeandroStanger

Which Phoenicis version do you use for testing? This error looks like you try to run a script from the scripts master branch with an older Phoenicis software (maybe the alpha-2 flatpak?). Try again with the current master of the software (there have been changes for the Downloader).

plata avatar Jan 13 '19 13:01 plata

Which Phoenicis version do you use for testing?

flatpak install --user http://repo-test.flathub.org:8080/build-repo/1128/org.phoenicis.playonlinux.flatpakref

LeandroStanger avatar Jan 13 '19 19:01 LeandroStanger

That won't work. The API is still not completely stable so the scripts and the Phoenicis version must match. To develop new scripts, you should always use the latest Phoenicis software as well (at least until the API stabilized). If you want to use flatpak, you can still do so: https://phoenicisorg.github.io/phoenicis/Developers/packages/.

plata avatar Jan 14 '19 17:01 plata

@LeandroStanger could you progress/do you need support?

plata avatar Mar 03 '19 10:03 plata