Standalone problem
J. Landman Gay
jacque at hyperactivesw.com
Mon May 14 00:50:55 EDT 2012
On 5/13/12 11:22 PM, dunbarx at aol.com wrote:
> Jacque. If I do not include a full pathname to the external in the
> stack inspector, neither the IDE stack nor the standalone will
> work.The external is not seen unless I go through the process form
> the "external references" pane, navigating to the external.
That's probably the problem. Since the bundle isn't in the standalone,
the external is being loaded from the full file path on the hard drive,
which will be different on another machine.
The bundle must be copied into the standalone bundle. You can do that by
manually moving it into either the MacOS folder (or the MacOS/Externals
folder) after the standalone is built. Or you can use the Copy Files
pane to include it, and it will go next to the engine in the bundle.
In the stack property inspector, set the externals to one of:
myexternal.bundle
Externals/myexternal.bundle
depending on where you put it.
Now, this will fail in the IDE, so during development you'd need to
point it to your copy on disk, and then change it before building a
standalone to one of the short file paths above. Because that's a
hassle, I usually don't use the inspector, I use a script. You can only
load externals in a preOpenStack handler, so I do this:
on preOpenStack
if the environment = "standalone application" then
set the externals of this stack to "myExternal.bundle"
end if
end preOpenStack
Or use "Externals/myExternal.bundle" if you copied it there instead.
Then also put your external into the Externals folder in the My LiveCode
folder (or whatever you've named it; the same one that holds your
plugins) and the IDE should load the external automatically on startup.
If you don't already have an Externals folder in there, create one. That
way you don't need to place a reference into the stack inspector, the
external will already be available globally in the IDE. If you load it
that way in the IDE, and use the script to handle the standalone
instance, then both bases are covered.
Yet another way is to branch the script:
if the environment = "standalone application" then
set the externals of this stack to "myExternal.bundle"
else if the environment = "development" then
set the externals of this stack to <full filepath to external>
end if
Hopefully something in all that will help...
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list