Page 1 of 1

PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 4:47 pm
by ddsinteractive
Hello!

I am a Director user converting to LiveCode and we build many standalone kiosk-type applications. In Director, we were able to create an admin function to allow the kiosk administrator to shut the PC (Windows 7) down or restart the PC from within the Projector. In LiveCode, we are using a full screen standalone application with a revBrowser external to display an embedded web application. Is it possible to have the website - which is run locally on the PC using WAMP - "talk" to the LiveCode EXE to pass a command to quit and shut the computer down?

Any alternative ways of providing this functionality would be appreciated.

Thank you!
Cheers,
Monica

Re: PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 6:31 pm
by Simon
Hi Monica,
Try
shell("shutdown -r")
Make sure you have saved all your work :)

Simon
Edit; I'm probably too brief. Here is the list
http://www.computerhope.com/shutdown.htm
shutdown -s to shutdown, the above is for reboot.
You will have to read the browser page content looking for a specific key (e.g. <!--Time to shutdown-->) and act on that.

Re: PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 6:47 pm
by ddsinteractive
Simon wrote:Hi Monica,
Try
shell("shutdown -r")
Make sure you have saved all your work :)

Simon

Hi Simon,
Would this be passed from a PHP script in the web browser back to the livecode revBrowser in some way as a function?

Thank you!
Cheers,
Monica

Re: PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 6:56 pm
by Simon
Sorry see my edit.
php? no I don't see it needed.

Code: Select all

put url(www.mysite.com/shutdown.html) into tKill
if "Time to shutdown" is in tKill then
shell("shutdown -s")
end if
:) Welcome to unfettered access.

You will probably want the -f option to force a close.

Simon

Re: PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 7:23 pm
by Simon
Ok another edit.
... for a specific key (e.g. <!--Time to shutdown-->)
Not the best, better
<!--BlueBannanaShutMeDownCauseISaySo-->

if "BlueBannanaShutMeDownCauseISaySo" is in tKill
etc.

Better yes?

Simon

Re: PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 7:59 pm
by ddsinteractive
Hi Simon,

Thank you for the guidance so far. Would the "put" command need to be in a loop of sorts? Because if the webpage is HTML, it would already be on the page and would automatically come back as true?

I hope I am making sense. :)
Cheers,
Monica

Re: PC Shutdown from revBrowser?

Posted: Thu Mar 27, 2014 8:07 pm
by Simon
Hi Monica,
You kind of have me there.
What is the trigger for a shutdown? I was thinking it would be a link.
Is something like "when the animation ends shutdown"?

Simon