Page 2 of 6

Re: Repairing the amnesia of standalones

Posted: Sat Aug 26, 2017 8:03 pm
by bogs
jacque wrote:
kresten wrote:So nice, but how can I test reliably on my own computer with its installed LC ?
Just build the standalone and run it. A standalone is an independent app that LC won't see. The way it works on your computer is how it will work on anyone's computer (on the same OS).
I thought about mentioning that, but kresten's statement makes me think they won't believe it if Lc is installed. A vm is a simple solution to that problem, as well as giving the ability to test multiple platforms without much difficulty.

Re: Repairing the amnesia of standalones

Posted: Fri Sep 08, 2017 2:50 pm
by kresten
Thank you for instructions, i followed the sugested scripting, and performed the standaloning of the launcher, placed in the same folder as the mainstack, but - alas - it doesn't open the mainstack. Can there be specifications of the standaloning setup necessary to make the launcher do its job ? I am working in LC v 6.7.8.

Re: Repairing the amnesia of standalones

Posted: Fri Sep 08, 2017 3:25 pm
by FourthWorld
kresten wrote:Thank you for instructions, i followed the sugested scripting, and performed the standaloning of the launcher, placed in the same folder as the mainstack, but - alas - it doesn't open the mainstack. Can there be specifications of the standaloning setup necessary to make the launcher do its job ? I am working in LC v 6.7.8.
Standalones can open stack files just as the IDE does; they both use the same scripting language.

What does the code you're using for that look like?

Re: Repairing the amnesia of standalones

Posted: Sat Sep 09, 2017 12:05 pm
by kresten
I dont understand your question. Does it refer to the short script in the launcher stack ?

Re: Repairing the amnesia of standalones

Posted: Sat Sep 09, 2017 4:18 pm
by FourthWorld
kresten wrote:I dont understand your question. Does it refer to the short script in the launcher stack ?
The code we'd need to see is the code that isn't working.

It seems the issue at hand is that the standalone isn't able to open a stack file. If that's correct, the code that determines the path to the stack file and then attempts to open it is what we'd need to see.

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 12:34 pm
by kresten
Well, I have been trying this, but it doesn't open the stack, neither when placed into the Diaryproper folder nor in the folder above that.

on openStack
open stack "/Diaryproper/e-diary.livecode"
hide this stack
end openStack

:?:

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 1:28 pm
by bogs
Is the launcher in the same folder as the stack it is launching? If it is, you could use relative path expression to open the stack, such as this -

Code: Select all

on openStack
open stack "e-diary.livecode"
hide this stack
end openStack
Try that first (putting the two in the same folder if they are not currently), and let us know how it works out. Others may have other suggestions as well.

Just as an example of how it should work, this is a simple demo of a timer with a launcher (it was an early prototype, so hold back on the laughter :D ) Only turn the launcher (clearly labeled) into the standalone and save it back to the demo folder.
bubbleLauncherDemo.zip
Simple demo of a launcher stack...
(8.33 KiB) Downloaded 188 times

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 2:27 pm
by kresten
I tried as you suggested, with no avail.
I observe, that the standalone Launcher doesn't close itself.
Could the mere size of my mainstack (2,2 Mb) be a problem ?
The size of the standalone Launcher becomes 4,7 Mb.

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 3:03 pm
by bogs
The demo I uploaded failed to work? I think I'd have to ask at this point if you are developing on a mac, since I've thoroughly tested and had other people test this stack on windows and linux. The only thing I can think at this point is that your on a mac possibly, which has different rules for the app folder.

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 3:15 pm
by kresten
No Your demo works fine

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 3:27 pm
by jacque
The size of the standalone isn't a problem, and it's actually a fairly small size as standalones go.

The most likely cause of the failure is a bad file path, which is why it would help for us to see the part of the script that tries to open the file.

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 3:59 pm
by FourthWorld
kresten wrote:Well, I have been trying this, but it doesn't open the stack, neither when placed into the Diaryproper folder nor in the folder above that.

on openStack
open stack "/Diaryproper/e-diary.livecode"
hide this stack
end openStack

:?:
All file I/O is best accompanied by error-checking, given the range of things that can go wrong (paths, permissions, etc.). Try this and report back what you get - I suspect Jacque's right, that it's the path that needs adjusting:on openStack

Code: Select all

on openrStack
   open stack "/Diaryproper/e-diary.livecode"
   if the result is not empty rhen
        answer the result &&"(" & sysError() &")"
        exit to top
   end if 
   hide this stack
end openStack
The result will contain a generic message from LiveCode if the file cannot be opened; sysError will return the OS error code specifying why that happened.

Re: Repairing the amnesia of standalones

Posted: Mon Sep 11, 2017 4:24 pm
by jacque
For some reason I missed the reported handler, sorry. When a standalone launches, the defaultfolder is the folder containing the app (on a Mac, that's inside the app bundle.) The path in the handler points to a folder inside the the app's folder which probably isn't where the file is.

Re: Repairing the amnesia of standalones

Posted: Tue Sep 12, 2017 11:51 am
by kresten
I followed Richards scripting and got the answer : No such card(2)
I am afraid I dont understand Jaques advice and its reference to app and bundle. My mainstack and its folders are placed on my desktop. will I have to go elsewhere ?

Re: Repairing the amnesia of standalones

Posted: Tue Sep 12, 2017 12:13 pm
by bogs
kresten, first we really need to know what Operating system your working with, paths vary from os to os. From the reported error (No such card(2)), it sounds like the program is unable to find the stack your telling it to launch or you have code in the program referring to a card that doesn't exist, which is causing it to fail.

You said my demo program worked fine, so this technique *does* work, at this point it is just a matter of tracking down where your version is amiss.

Feel free to zip up your stacks and post them, which is the easiest way to track down the issue.