"Add folder" in "Copy Files" not adding folder contents
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
"Add folder" in "Copy Files" not adding folder contents
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
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
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: "Add folder" in "Copy Files" not adding folder contents
Tip: You narrow responses with political statements in your signature.Thanks in advance
Gerrie
Knowledge can't be power because look who's President.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
Sorry, I fixed my signature.
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: "Add folder" in "Copy Files" not adding folder contents
This works;
Is it working for you?
Simon
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
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
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.
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.
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
Re: "Add folder" in "Copy Files" not adding folder contents
Hm, this has always worked for me on iOS; Mac and Windows!?
Clueless!
Clueless!
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: "Add folder" in "Copy Files" not adding folder contents
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.
Until you change the defaultFolder it will always be the one you access when using just a filename.
Simon
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
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
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
@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
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
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
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
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: "Add folder" in "Copy Files" not adding folder contents
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
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
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
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
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
Re: "Add folder" in "Copy Files" not adding folder contents
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
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
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
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.
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
-
- Livecode Opensource Backer
- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Re: "Add folder" in "Copy Files" not adding folder contents
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
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
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
Re: "Add folder" in "Copy Files" not adding folder contents
Hi Gerrie,
very strange!?
Please consider to report this: http://quality.runrev.com
Thank you!
best
Klaus
very strange!?
Please consider to report this: http://quality.runrev.com
Thank you!
best
Klaus