General purpose launcher
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
General purpose launcher
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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 9580
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: General purpose launcher
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
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
Re: General purpose launcher
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.
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.
Re: General purpose launcher
Hi xyz,
just add ALL available inclusions to your "launcher" app!
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
just add ALL available inclusions to your "launcher" app!
This feature is available for creating a standalone from a specific stack with LC,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.
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
Re: General purpose launcher
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!
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!
-
- VIP Livecode Opensource Backer
- Posts: 9580
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: General purpose launcher
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
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
Re: General purpose launcher
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.
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: General purpose launcher
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.
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
HyperActive Software | http://www.hyperactivesw.com
Re: General purpose launcher
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?
However i seem to recall some discussion somewhere that a generic 'player' app for LC is forbidden in the licence? Anyone know for sure?
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: General purpose launcher
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
HyperActive Software | http://www.hyperactivesw.com
Re: General purpose launcher
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!
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!
Re: General purpose launcher
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”?
@jacque - in practice how do u launch stacks with the standalone - just something like “open stack”?
Re: General purpose launcher
Hi stam,
Best
Klaus
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
...
Klaus