Page 1 of 1
Command-Line Only Standalone?
Posted: Mon Apr 28, 2014 6:52 am
by icouto
Is it possible to create a command-line only standalone binary with LiveCode, or does the created app either have to be a GUI app, or a script that is parsed by livecode-server? Is it possible to create a faceless daemon, or a command-line tool?
Re: Command-Line Only Standalone?
Posted: Mon Apr 28, 2014 1:21 pm
by BvG
yes. you want the -ui parameter.
Re: Command-Line Only Standalone?
Posted: Tue Apr 29, 2014 2:10 am
by icouto
Are you compiling the binary from the command line? How do you do that?! If not, where do you enter this parameter?
Your guidance is truly appreciated.
Re: Command-Line Only Standalone?
Posted: Tue Apr 29, 2014 2:49 am
by FourthWorld
Any standalone made with LiveCode can be written to work well when run from the command line. The -ui is passed to the app with the app name in the command line, e.g.:
./myAppName -ui
When run from the command line, the app will get a startup message - put your code in a startup handler and you're off and running.
Re: Command-Line Only Standalone?
Posted: Tue Apr 29, 2014 7:33 am
by icouto
Many thanks!
Re: Command-Line Only Standalone?
Posted: Tue Jul 01, 2014 2:04 am
by trags3
FourthWorld wrote:Any standalone made with LiveCode can be written to work well when run from the command line. The -ui is passed to the app with the app name in the command line, e.g.:
./myAppName -ui
When run from the command line, the app will get a startup message - put your code in a startup handler and you're off and running.
Hi FourthWorld
So I can build an app for linux on my macbook, post it to the server, I assume LC Server must be resident on the server and run it with the command you gave above?
Is there more to the command?
Specifically what kind code would be in the startup handler?
do you have a short example you could show?
I'm pretty new to LC and very very new to server stuff.
Thanks Tom
Re: Command-Line Only Standalone?
Posted: Tue Jul 01, 2014 2:40 am
by FourthWorld
trags3 wrote:FourthWorld wrote:Any standalone made with LiveCode can be written to work well when run from the command line. The -ui is passed to the app with the app name in the command line, e.g.:
./myAppName -ui
When run from the command line, the app will get a startup message - put your code in a startup handler and you're off and running.
Hi FourthWorld
Feel free to call me Richard.
So I can build an app for linux on my macbook, post it to the server, I assume LC Server must be resident on the server and run it with the command you gave above?
What's needed to simply run an app from the command line is slightly different from what's needed to run an app under a Web server.
Any app on a server, whether you're using LiveCode Server or have special requirements best met from a custom standalone, needs to integrate with the Web server application. Most commonly the Web server is Apache, and the common interface between them is CGI, which is a simple convention for adding specialized apps on the server in a way Apache can work with them. On most shared hosts this is done through mod_rewrite rules written in a .htaccess file in the server's Web root. Sounds like a lot of steps, and indeed Apache is a deep and very flexible toolkit, but most of the small bits you need to get started are covered in the LiveCode Server Guide:
http://livecode.com/developers/guides/server/
Until you've had enough experience with LiveCode Server to know why you might want to make a custom standalone instead, you'll find more code examples and generally better support from the community by just using LiveCode Server, which is set up to work well with Apache.
Re: Command-Line Only Standalone?
Posted: Tue Jul 01, 2014 4:30 am
by trags3
Richard, thanks so much for the clarification.
I have a very simple task that I want to do on a server. I have developed a fairly simple mobile app that takes data input by the user and does some simple processing of it, shows the results and then allows the user to email the results to their clients.
Any time this is done my client wants to be assured that he is informed that the app was used, & who used it.
Because of the way LC interfaces with the email client I can't rely on the user to not delete the email address of my client so I want to have the app communicate with a server some of the pertinent information and relay that to my client. None of this would require any action from the user of the app and they would have no human communication with the server.
Other tasks will be user registration and login but the login will just pass a message to the app that it is ok to proceed. The basic purpose of this is the app needs to run differently in different parts of the country and the customer contact depends on where it is being used.
I think I can do everything I need to do on the server in 2 or 3 cards and 2 or three MySQL tables.
What I have not quite figured out yet is how I can run a small stack with LC Server to do the data collect and re transmit function.
but I ramble on....
These forums have been very helpful but i'm not quite there.
Thanks again,
Tom