Greetings Again,
OK! I'm making an installer that has a progress bar. I have to copy both an application file and a number of other data files to the Documents folder. When I use "revcopy" the system throws up the system progress bar which looks weird.
Is there a way to copy an application without using "revcopy"
Thanks!
John Miller
Copy An Application Without "revcopy"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 116
- Joined: Mon Apr 30, 2007 3:33 pm
Hi John,
You can recursively read all file from a folder and its subfolders and write them to a new location. You would have to check the file an creator types and you might need to take resource forks into account.
You might also use the shell (cp or mv?) to copy files.
I think there are a few examples in this forum or on the Rev Use List.
Best,
Mark
You can recursively read all file from a folder and its subfolders and write them to a new location. You would have to check the file an creator types and you might need to take resource forks into account.
You might also use the shell (cp or mv?) to copy files.
I think there are a few examples in this forum or on the Rev Use List.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
If you go for the custom installer, make sure to get the entire file in binary format - and if you're working on a Mac, you may also have to copy the 'resfile' part of the file, just to be sure. Revolution stacks make excellent archives for this soprt of thing.
Basically, you can 'import' a file using the following script:
And then you can 'export' that file using the folloowing script:
Looping over all the files to import/export them using this apckage, is left as an exercise to the reader 
The downside of this approach, is that the creation and modification time stamps are not the same as the original files. If that doesn't bug you, then a custom copier is the way to go.
Hope this helped,
Jan Schenkel.
Basically, you can 'import' a file using the following script:
Code: Select all
on ImportPackageFile pIdentifier, pInputPath
set the uBinFile[pIdentifier] of this stack to compress(URL ("binfile:" & pInputPath))
put URL ("resfile:" & pInputPath) into tResFork
if tResFork is not empty then
set the uResFile[pIdentifier] of this stack to compress(tResFork)
end if
end ImportPackageFile
Code: Select all
on ExportPackageFile pIdentifier, pOutputPath
put decompress(the uBinFile[pIdentifier] of this stack) into URL ("binfile:" & pOutputPath)
put the uResFile[pIdentifier] of this stack into tResFork
if tResFork is not empty then
put decompress(tResFork) into URL ("resfile:" & pOutputPath)
end if
end ExportPackageFile

The downside of this approach, is that the creation and modification time stamps are not the same as the original files. If that doesn't bug you, then a custom copier is the way to go.
Hope this helped,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com