Is there a way for a gateway script to launch a project on the server that the gateway resides on?
I have tried various:
system.util.execute(["C:\\WINDOWS\\system32\\javaws.exe -localfile -J-Djnlp.application.href=http://wbx3:8088/main/system/launch/client/RunOnServer.jnlp \"C:\\Documents and Settings\\bxy\\Local Settings\\Application Data\\Sun\\Java\\Deployment\cache\\6.0\\9\\55252289-1f6035bf\""])
etc, but to no avail. Is this even possible?
I can get .exe files on the desktop to function with the above but not .jnlp’s
Even if you got this working, the problem here is that jnlp cache files are highly unstable. It may work for a little while, but then fail at some random point later due to javaws reshuffling its cache. You are much better off calling the native client launcher exe from your script and passing in whatever you need.
Thanks mgross, any chance you could expand a little on that? Maybe a tiny example
Some examples are at the end of this webpage: support.inductiveautomation.com … uncher.htm
So it looks like this isn’t going to work on Windows from a Gateway script, even with the native launcher. The problem is that the Gateway runs as a Windows service, which by default does not have graphical access to the local Desktop. Even if you tweak the Ignition service to run under a specific user, using system.util.execute still won’t work, as Windows refuses to show the client (even if it launched the process without errors).
Great. Now y’all my my mind spinning…
@Brett, can I ask for a bigger picture on what you’re trying to do? Or why…
I’m just wondering if the project can launch on startup or just every so often, or whatever…
@JordanCClark, I have a project that runs on the server to grab screenshots and email them etc.
A while back I played with the native launcher and believe this to be working (for server boot up). I have some client scripts that toggles a memory tag which a gateway script can detect if the project is running or not. I then wished to automatically launch the project should it be shut down for whatever reason. Over-kill maybe, but seemed a good idea at the time.
So I tried it with Wintail.exe on the same server/desktop and it launched it, so I thought it was only a matter of knowking how to handle jnlp shortcuts…looks like I might be wrong