Standalone problem

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10356
Joined: Wed May 06, 2009 2:28 pm

Standalone problem

Post by dunbarx » Fri May 11, 2012 6:32 pm

I have made a custom application to control a lighting system. I am using a hardware interface known as a "Service USB Plus", from Bonig and Kallenbach. Works fine in the IDE, sending data via USB to the interface, which does its thing.

The working stack references an external framework bundle.

I made a standalone so that I can easily move the app onto production Macintoshes. This is a splash screen type, with the working stack included in the stack files of the splash. The app works fine in the machine I deveoped on, LC itself not running.

But when I loaded the app onto another Mac, although all screen functionality works perfectly, the control signals are not implemented. I can switch cables back to the developing Mac, running side by side, running the same app, and all is well.

I can always use the IDE on the production Macs, which works fine, but wonder why the standalone fails on the other machines. Is there something in the pathname to the external that breaks in the production machine, which has a different name and therefore different pathnames to all files? I would think that all such included resources would be transparent in that regard, for obvious reasons.

This may be too specialized a problem for anyone to know what is going on. The production machines are running OSX 10.7, though the developing machine is running OSX 10.6. All are MacBook Air.

Hoping...

Craig Newman

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone problem

Post by Klaus » Sat May 12, 2012 11:47 am

Hi Craig,

make sure that the (USB) externals are in fact in the "Externals" folder in the final standalone!

Although they can be checked in the listfield of thestandalone builder setings, non LiveCode externals
are still NOT being copied into the standalone, a bug I already reported a couple of years ago.

Just guessing however...


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10356
Joined: Wed May 06, 2009 2:28 pm

Re: Standalone problem

Post by dunbarx » Sat May 12, 2012 9:26 pm

Klaus.

Thanks for the reply, but if the app works on machine "A" then why wouldn't it work in machine "B"? In other words, the app must be properly configured in order to run on the machine "A" in the first place. Or I am missing what you are saying.

You do not mean the actual folder created by the standalone process, do you? The one with "Mac OS", Linux and Windows subfolders? That folder on the developing Mac does have the external in it.

Craig
,

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone problem

Post by Klaus » Sat May 12, 2012 9:59 pm

Hi Craig,

I mean the folder "Externals" inside of the application package on the Mac:
-> Your Standalone.app/Contents/MacOS/Externals/

Just guessing...


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10356
Joined: Wed May 06, 2009 2:28 pm

Re: Standalone problem

Post by dunbarx » Sun May 13, 2012 1:18 am

Klaus

Hmmm. Not sure. I never saw that sort of thing, but I will look.

It has to be something like that, but I know I never created any such thing on the developing Mac I just made the standalone, closed LC itself, and launched the standalone.

It will not surprise me to learn that the process is just a bit more complicated than merely copying an app to a new machine. But isn't a standalone portable? Isn't that the point, that it is completely self contained?

Craig

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone problem

Post by Klaus » Sun May 13, 2012 11:40 am

Hi Craig,
dunbarx wrote:But isn't a standalone portable? Isn't that the point, that it is completely self contained?
Yes, definitively, but as I said there is a bug in the stqndalone builder, it does NOT copy 3rd party external
into the "Externals" folder in the final standalone applciation package!

So right-click on your standalone and choose "Show contents..." (don't know the exact english wording) and check the folder contents.

Here internal folder structure of a Mac standalone:

Code: Select all

The Standalone.app
   Contents/
      Info.plist
      PkgInfo
      MacOS/
         The Standalone
         Externals/
                 xyz.bundle
                 zyx.bundle
                 ...
      Resources/
            Icons etc...
Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10356
Joined: Wed May 06, 2009 2:28 pm

Re: Standalone problem

Post by dunbarx » Mon May 14, 2012 4:34 am

Klaus.

You are right, the bundle is not included in the package contents. However:

1- Neither is it included in the package contents on my developing Mac. Putting it there, or removing it does not change the fact that the standalone works on that machine. So the reference to that bundle, or the bundle itself, is embedded somehow in the package, and not simply based on the presence of that file in the right place.

2- Including it in the externals folder in the standalone on the daughter machine does not make that app work there.

3- Building the standalone from the IDE ON THE DAUGHTER MACHINE, all works fine, and the external is still not loaded in the externals folder of the package contents.

Klaus, for a second there I thought you had nailed it. I cannot use standalones at all, since if anything goes wrong, I cannot just load another copy to the machine with the problem. Either I have to use the IDE everywhere, or would have to rebuild the standalone from LC resident on that machine.

Thanks for your time. Though I have learned something about the package that the standalone builder creates, I am still at a loss.

Craig

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone problem

Post by Klaus » Mon May 14, 2012 11:44 am

Hi Craig,

since I am an old user of MetaCard I am used to to all important stuff manually :D
Like the loading of all externals, I do not rely on the mechanisms that LiveCode provide,
which is not reliable, as you have experienced.

So I do not check all the externals in the standalone builder, but rather copy them
manually into the correct "Externals" folder and have this (stack) script in the mainstack
(standalone) that will load all the externals:

Code: Select all

on startup
   put the effective filename of THIS STACK into tFile
   set itemdel to "/"
   put "Externals" into item -1 of tFile
   put the folder into oldfolder
   set the folder to tFile

   ### BUNDLEs are folders on the Mac!
   if the platform = "MacOS" then
      put the folders into tEx
      filter tEX with "*.bundle"
   else
    
      ## WIndows DLLs
      put the files into tEx
      filter tEX with "*.dll"
   end if

   ## Create a list of all available externals:
   repeat for each line i in tEx
      put tFile & "/" & i & CR after tEXList
   end repeat
   delete char -1 of tEXList

   ## Now SET the xternals and...
   set the externals of stack "clipshaker" to tEXList

   ### ... make them available to all stacks:
   start using THIS STACK
   set the folder to oldfolder
end startup
This NEVER failed for me!


Best

Klaus

Post Reply