Cannot add stack in Standalone Application settings

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Re: Cannot add stack in Standalone Application settings

Post by Klaus » Thu Sep 05, 2019 1:57 pm

How do you address the stack?
From the pic it looks like this should be -> specialfolderpath("engine") & "/sunnYrexLibrary.livecode"

If you like, I can take a look at your problem-stack.
Maybe it is just a(nother) glitch in the Project Browser.
Just send your stack and the "sunnYrexLibrary.livecode" file to: klaus AT major-k.de

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Cannot add stack in Standalone Application settings

Post by bogs » Thu Sep 05, 2019 1:59 pm

Well, this is a question only someone that dev's on a mac would probably know the answer to or not, but I think when your adding something to the app package folder manually, you need to modify the plist file to take the added file into account.

Otherwise, I'm out of theories for the moment.

*Edit - I see Klaus popped in with probably the better answer :D
Image

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 2:18 pm

Klaus thank you so much for the offer. Let me see if I can fix without bothering you. Also I have to get permission in order to send the stack out. :-(

I am just using

Code: Select all

start using stack "sunnYrexLibrary"
with the library stack in the same directory.
Kaveh

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Cannot add stack in Standalone Application settings

Post by bogs » Thu Sep 05, 2019 2:21 pm

Pretty sure you need a path, not just the stack name.
Image

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

Re: Cannot add stack in Standalone Application settings

Post by Klaus » Thu Sep 05, 2019 2:38 pm

kaveh1000 wrote:
Thu Sep 05, 2019 2:18 pm
I am just using

Code: Select all

start using stack "sunnYrexLibrary"
with the library stack in the same directory.
Yes, and that does not work! 8)

The macOS Application folder structure is a tad more complicated, please test with my pathname above!

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 4:04 pm

Hi all

SOME SUCCESS

Thanks for your patience and help again...

First I tried this:

Code: Select all

put specialFolderPath("desktop") & "/sunnYrexLibrary.livecode" into tPath
start using stack tPath
And it worked! So even though the Standalone does not contain sunnYrex, it knows it is on the desktop. Of course this is not a viable solution for distribution.

Then I put in Klaus's version:

Code: Select all

put specialFolderPath("engine") & "/sunnYrexLibrary.livecode" into tPath
start using stack tPath
When opening the stack in IDE I get error because this path is resolving to:

Code: Select all

/Applications/LiveCode Indy 9.0.4 (rc 3).app/Contents/MacOS/sunnYrexLibrary.livecode
I could create such a folder but does not seem the correct way.

When I create the standalone, then manually put back the library in the App using Package contents, the App works. :-)

So I have a workaround now, except I have to remember to do this every time. And I have not tried it for the Linux standalone yet. That needs to be done to.

So many thanks so far. I would still love to be able to have sunnYrex automatically saved into the App as it was always doing before something changed!!
Kaveh

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Cannot add stack in Standalone Application settings

Post by bogs » Thu Sep 05, 2019 4:18 pm

kaveh1000 wrote:
Thu Sep 05, 2019 4:04 pm
When opening the stack in IDE I get error because this path is resolving to:
That is because in the IDE, the 'engine' is the IDE, not your application. What you might do to restore some sanity is run a check on which environment you are working in, perhaps in the pre-open stack handler something like :

Code: Select all

if the environment is "development" then
	// your in the IDE, use the path you were using or probably just start using stack "sunnYrex"
else
	// all other cases, since you are now running from the standalone....
end if
Image

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 4:42 pm

Just for reference, I previously had the system running fine with just

Code: Select all

start using stack "sunnYrexLibrary"
(without the extension or path) and it also loaded always showed up in the Standalone Application Settings. Something has changed along the way...
Kaveh

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Cannot add stack in Standalone Application settings

Post by bogs » Thu Sep 05, 2019 4:46 pm

So, in that case, what I wrote would be more like this...

Code: Select all

if the environment is "development" then
	start using stack "sunnYrexLibrary"
else
	put specialFolderPath("engine") & "/sunnYrexLibrary.livecode" into tPath
	start using stack tPath
end if
Image

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 5:00 pm

Wonderful. That works Bogs.

So I have a workaround to move forward. One question remaining is where I add the sunnYrex module in the Linux version. I am not a Linux user but Mac. Do I put it in the top directory, next to the mainstack?
Kaveh

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

Re: Cannot add stack in Standalone Application settings

Post by Klaus » Thu Sep 05, 2019 5:03 pm

All this stuff should definitively go into -> specialfolderpath("resources") which also works in the IDE.

So we first HAVE TO find out why you cannot add that stack file to your standalone via the "Copy files" tab in the "Standalone Application Settings"!

Please send me the stacks or we will still be discussing this until christmas! 8)

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 5:08 pm

Klaus, "Copy files" or "Stacks"?

I have always added through "Stacks". I just tried through Copy Files. It does add the stack. I cannot see it in the Standalone package contents, but the standalone works!!
Kaveh

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

Re: Cannot add stack in Standalone Application settings

Post by Klaus » Thu Sep 05, 2019 5:28 pm

kaveh1000 wrote:
Thu Sep 05, 2019 5:08 pm
Klaus, "Copy files" or "Stacks"?
"Copy files" so it ends up in -> specialfolderpath("resources") in your standalone.

If you keep the library in the same stack as your (later standalone) stack, you can also access it in the IDE with specialfolderpath("resources")!
kaveh1000 wrote:
Thu Sep 05, 2019 5:08 pm
I have always added through "Stacks". I just tried through Copy Files. It does add the stack. I cannot see it in the Standalone package contents, but the standalone works!!
Hallelujah! :-)

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 5:36 pm

"Copy files" so it ends up in -> specialfolderpath("resources") in your standalone.

If you keep the library in the same stack as your (later standalone) stack, you can also access it in the IDE with specialfolderpath("resources")!
Sorry Klaus, did not get this. Every time I create a Standalone it produces a new Directory, so where do I put the library so specialfolderpath("resources") can access it?
Kaveh

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 539
Joined: Sun Dec 18, 2011 7:23 pm
Contact:

Re: Cannot add stack in Standalone Application settings

Post by kaveh1000 » Thu Sep 05, 2019 6:01 pm

Bogs and Klaus

I just want to thank you for your patience. It has been immensely helpful to get this working again. I admit I have to learn lots in this area. I have just concentrated on writing scripts but forgotten about the infrastructure.

And a special thanks to Thierry for a great software that allows full regex to be used in LiveCode. :-)

Thanks again, and I am sure I will be back to bother you soon!
Kaveh

Post Reply