General purpose launcher

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
xyz
Posts: 30
Joined: Sat Feb 29, 2020 4:45 am

General purpose launcher

Post by xyz » Mon Mar 15, 2021 3:55 pm

I wrote what was intended to be a general purpose launcher. You put it in the same folder as the LiveCode project and it launches the first one it sees. Cool.

But, sadly, I discovered that the launcher app does not include the "inclusions" needed by the LC project it launches. My launcher is no longer a general purpose launcher because I have to manually set inclusions for the launcher that correspond to the inclusions needed for the project that it is intended to launch. That makes me sad.

Is there a way, when building the launcher app, to have it automatically search for the inclusions needed by the stack(s) you intend to launch it with?

Clearly it would need to know the name of the stack to search for inclusions. In my case, it would know because it searched the current folder and found a livecode project which it assumes is the program to be launched. Ideally, it would take the name of the *.livecode project that it found and then search its stack(s) for inclusions which it would include in the "compiled" launcher app.

I assume that can be done. The question is how.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: General purpose launcher

Post by dunbarx » Mon Mar 15, 2021 4:55 pm

Hi.

Not quite sure what the launcher, er, launches. If you have a standalone does this not already include all the, er, inclusions required?

In other words, what does the launcher do that opening a standalone by hand not do? I assume there is no issue when opening by hand.

Craig

xyz
Posts: 30
Joined: Sat Feb 29, 2020 4:45 am

Re: General purpose launcher

Post by xyz » Mon Mar 15, 2021 5:39 pm

dunbarx, I have several projects for which I have made individual launcher apps. This is so I could persist data when running those apps on other computers that do not have livecode installed.

Rather than write a separate launcher for each project, I thought I would write one launcher that could launch ANY livecode project. You just copy the "launcher.app" into the same folder as the "lcproject.livecode" script (or whatever it may be called) and the launcher launches it. It is nice. Very convenient. Don't have to write launcher apps anymore for each project for which I want to do it.

BUT, if my lcproject.livecode project uses an ask or answer dialog, database routines, etc, it does not work if I have run the program using the launcher (it works fine in the IDE). Obviously it is missing the inclusions.

I would simply like to have a "general purpose launcher app" that, given then name of the lcproject.livecode file I want to run, will search for the necessary inclusions and include them.

I realize I can persist data in other ways. I just thought using a general purpose launcher app was a convenient way to do that until I ran into this problem.

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: General purpose launcher

Post by Klaus » Mon Mar 15, 2021 5:53 pm

Hi xyz,

just add ALL available inclusions to your "launcher" app!
I would simply like to have a "general purpose launcher app" that, given then name of the lcproject.livecode file I want to run, will search for the necessary inclusions and include them.
This feature is available for creating a standalone from a specific stack with LC,
but even that does not work reliably in the IDE!

Important:
Add a -> start using this stack
to your launcher before you open any other stack file, otherweise none of the inclusions from the launcher app
can be used by your (external) LC stack file.


Best

Klaus

xyz
Posts: 30
Joined: Sat Feb 29, 2020 4:45 am

Re: General purpose launcher

Post by xyz » Mon Mar 15, 2021 6:11 pm

duh :)

Good solution, though it "rubs me raw" to include all kinds of stuff I don't need.

I guess I'll persist data in other ways.

Thanks!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: General purpose launcher

Post by dunbarx » Mon Mar 15, 2021 6:23 pm

So, if I understand, you do not build a separate "launcher" (sometimes called a "splash" stack) which is the actual executable, for each of your projects. So do you offer the user a selection of "working' stacks once the launchers opened?

I suppose your "launcher" stack might contain all required inclusions, and you could attach ALL your "working" stack files. Then when the launcher opens, the user can select whatever working stack is appropriate. But this requires both user action and opens all stack s to the user, which I suspect you do not want at all.

You cannot save any part of the launcher stack, but it might be possible to "tell" that stack to present a navigation button to a stack of interest when it opens. The setting of that button property will not stick, so you would have to reset it each time before launch.

Just some thoughts. I would do it the old fashioned way, and marry a separate splash stack to your working stack(s).

Craig

SparkOut
Posts: 2839
Joined: Sun Sep 23, 2007 4:58 pm

Re: General purpose launcher

Post by SparkOut » Mon Mar 15, 2021 10:14 pm

Yes... I kind of don't understand. And think this is a strange attempt to do something esoteric and well, unnecessary. Or at least, abnormal in the way that doing this in the "typical" LiveCode way would be more beneficial. Or at least, I just don't understand.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: General purpose launcher

Post by jacque » Tue Mar 16, 2021 6:34 pm

I've been using a generic launcher for years. The advantage is that it will run any stack as though it were a standalone without needing to do a new build for every little change you make. You can tinker with code and see how it works almost as fast as testing in the IDE itself. No need for repeated test builds.

My launcher has all the inclusions I think I might ever need. Since this is just a test vehicle it doesn't matter if it's bulky with extra widgets and libraries. It's just a tool.

I also use it for testing mobile apps. I ftp the working stack to my server using a drag and drop shortcut in Fetch. My launcher then gets the available files on the server and puts the list into a field on the first card. Clicking the list opens and runs the selected stack.

Building standalones is time consuming for large projects and this speeds up development considerably. Another advantage for mobile apps, particularly iOS, is that you don't need to mess with certificates and profiles for the stacks. Only the launcher needs to be notarized and stapled.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

stam
Posts: 2636
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: General purpose launcher

Post by stam » Wed Mar 17, 2021 5:06 am

Thanks Jacque, very cool idea... will definitely use :)

However i seem to recall some discussion somewhere that a generic 'player' app for LC is forbidden in the licence? Anyone know for sure?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: General purpose launcher

Post by jacque » Wed Mar 17, 2021 7:18 am

That's right, you can't distribute a player, but this is just a personal tool. You can make whatever you want for your own use.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: General purpose launcher

Post by AxWald » Wed Mar 17, 2021 10:03 am

Hi,
stam wrote:
Wed Mar 17, 2021 5:06 am
However i seem to recall some discussion somewhere that a generic 'player' app for LC is forbidden in the licence? Anyone know for sure?
Look here. § 3 e.)

Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

stam
Posts: 2636
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: General purpose launcher

Post by stam » Wed Mar 17, 2021 9:04 pm

Thanks both - makes total sense and fair enough for LC to stipulate this. Also good to know it’s ok for private use.

@jacque - in practice how do u launch stacks with the standalone - just something like “open stack”?

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: General purpose launcher

Post by Klaus » Wed Mar 17, 2021 9:12 pm

Hi stam,
stam wrote:
Wed Mar 17, 2021 9:04 pm
in practice how do u launch stacks with the standalone - just something like “open stack”?
yep, like this:

Code: Select all

...
  answer file "Select a stack:" with type "Stack|mc,rev,livecode|"
   if it <> EMPTY then
      go stack it
   end if
...
Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”