Thanks for that background, Mark.
Please help me better understand the implications: does this change
mean that we can no longer run standalones facelessly on Windows by just
calling them with the -ui flag while hideConsoleWindows is true?
I have a number of apps that provide both GUI and faceless modes, mostly
installers but a few others.
What version did this change premier in?
--
Richard Gaskin
Fourth World Systems
Mark Waddingham wrote:
Hi Malte,
On 2017-05-04 20:34, Malte Brill via use-livecode wrote:
Hi all,
has anybody successfully done this? Especially on Windows? I would
like to launch a livecode built application from a liveCode server
script and get the output back (on a Server that I control) Is that
possible? If so, how?
The problem here is a Windows 'limitation' (well design decision
really).
Windows has two types of executable - console mode and GUI mode.
LiveCode
is a GUI mode application, which means that it detaches from the console
and does not work in the way you would expect when run from the
command-line.
Now, a while I back I added a wee bit of code to the engine to make it
still do something console-y on Windows: on startup it attempts to
'AttachConsole'
which at least means the engine can access the console handles it was
created
with when doing stdout/stderr/stdin type stuff. However, the limitation
here
is that the process is still 'detached' from the parent and so does not
necessarily block open process or shell. (This was done IIRC as a
request
from Roger Eller - I can't remember the exact reasons, but the code
added
seemed to help his specific case, at least).
There's plenty of stuff about this around - Raymend Chen has plenty to
say about it. One notable article being:
https://blogs.msdn.microsoft.com/oldnewthing/20090101-00/?p=19643
Now, one thing he links to from here is:
https://blogs.msdn.microsoft.com/junfeng/2004/02/06/how-to-make-an-application-as-both-gui-and-console-application/
You could try using editbin.exe to change the subsystem type
(editbin.exe is
installed with any of the Visual Studio releases, or tools):
EDITBIN.EXE /SUBSYSTEM:CONSOLE <livecodestandaloneexe>
Then see if this works in the way you want... It might...
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode