Page 1 of 2

"Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 3:12 pm
by Ledigimate
Hi everyone

I'm trying to include folders among the application's assets, using the "Add folder" button in the "Copy Files" tab of the Standalone Application settings. I don't know if I'm doing something wrong, but when I create the standalone, it creates empty folders instead of copying the folders with their contents. It would be an awful lot of work to add each file seperately, and to then write code that moves them into their respective folders. Surely it can't be THAT complicated? Can someone point me in the right direction?

Thanks in advance

Gerrie

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 3:30 pm
by Simon
Thanks in advance

Gerrie
Knowledge can't be power because look who's President.
Tip: You narrow responses with political statements in your signature.

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 3:51 pm
by Ledigimate
Sorry, I fixed my signature.

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 4:17 pm
by Simon
This works;

Code: Select all

on mouseUp
   set the itemDelimiter to slash
   get the effective filename of this stack
   set the defaultFolder to item 1 to -2 of it & "/theFolderYouAdded"
   answer the files
end mouseUp
Is it working for you?

Simon

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 5:48 pm
by Ledigimate
Thank you, Simon.

I would like to try your solution, but I don't understand where to place the code.

Perhaps I didn't state the problem clearly. The problem occurs when I build the standalone for Windows. In the "Copy Files" section of the main stack's Standalone Application settings, I added the folders that I would like to be copied to the standalone destination folder. These folders contain files needed by the standalone app. After building the app, when I look in the standalone destination folder, the folders are there but they are empty.

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 5:53 pm
by Klaus
Hm, this has always worked for me on iOS; Mac and Windows!?
Clueless!

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Thu Jul 17, 2014 7:17 pm
by Simon
Hi Gerrie,
If you get rid of the mouseUp and answer then place the remaining lines before your call to the file it should work.

Code: Select all

set the itemDelimiter to slash
get the effective filename of this stack
set the defaultFolder to item 1 to -2 of it & "/images" --whatever
set the filename of image "mySlideShow" to "DSCN1602.JPG" --whatever
Until you change the defaultFolder it will always be the one you access when using just a filename.

Simon

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Fri Jul 18, 2014 7:38 am
by Ledigimate
Thanks for trying to help.

@Simon: The code will only work in the standalone *IF* the images folder in the standalone destination folder actually contain images, but unfortunately the folder is empty, i.e. the original image files doesn't get copied during the build process, even though the images folder was added to the "Copy Files" list.

And now, to add to my frustration, the datagrid in the standalone app doesn't respond to mouse clicks. This is discouraging as I've had to recreate the whole stack twice before because of such gremlins that just couldn't be fixed any other way.

I'll try reverting to a previous LiveCode version and see if that helps anything. I'll report back what I find.

Gerrie

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Fri Jul 18, 2014 7:52 am
by Ledigimate
I've just discovered that the problem does not occur for new mainstacks. This implies that there's something wrong with this specific stack.

It's stack troubleshooting time for me again. If I can't find the cause of the problem then I'll come back and request further assistance.

Thanks again, I appreciate your trying to help.

Regards, Gerrie

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Fri Jul 18, 2014 7:54 am
by Simon
Hi Gerrie,
This is the second posting I've seen where the folder is empty.
I tested with LC 6.6.1
Which version are you seeing this in?

Simon

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Fri Jul 18, 2014 8:45 am
by Ledigimate
Hello Simon,

Since my last post, I tried building the standalone in the following versions of LiveCode:

6.6.2
6.6.2 (rc 2)
6.6.1
6.6
6.5.2
6.5
6.1.3
6.0.2

Each build gave the same result -- empty folders in the standalone destination folder. So there must be something wrong with this specific stack. Perhaps if I can fix the datagrid issue, the empty folder issue would be gone also. I'll try that and see what happens.

Gerrie

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Fri Jul 18, 2014 3:06 pm
by Klaus
Hi Gerrie,

try to create a new and simple stack and build a standalone from that including your folders.
Then see if the folders are still empty.


Best

Klaus

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Fri Jul 18, 2014 10:22 pm
by Ledigimate
Thanks Klaus. I did what you suggested and the folders are copied correctly, i.e. the folders are not empty. This means the problem is specific to the stack. I just can't figure out what's wrong with it. I even created a new main stack and copied the cards from the old stack over to the new stack, but the result is the same. This suggests that there might be a problem with one of the cards. I'll try to narrow it down by removing the cards one-by-one and report back.

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Sat Jul 19, 2014 2:15 am
by Ledigimate
Hello everyone,

I was able to reproduce the problem in a new main stack. It seems like a bug in LiveCode. It happens when the following two conditions are both true:

1. The defaultFolder is set to the folder that contains the main stack file.
2. The folder you want to add to the "Copy Files" list, is a subfolder of the defaultFolder.

I've now worked around the problem by simply copying the folders to somewhere outside of the folder that contains the main stack file, and then adding them to the "Copy Files" list from the outside location. This unfortunately adds the overhead of syncing the folders in the two locations every time you want to build the standalone.

I hope this can help someone out there who might experience the same issue.

Thank you and regards,

Gerrie

Re: "Add folder" in "Copy Files" not adding folder contents

Posted: Sat Jul 19, 2014 2:49 pm
by Klaus
Hi Gerrie,

very strange!?

Please consider to report this: http://quality.runrev.com
Thank you!


best

Klaus