Page 1 of 1

Copy An Application Without "revcopy"

Posted: Wed Mar 12, 2008 4:32 pm
by johnmiller1950
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

Posted: Sun Mar 30, 2008 2:17 pm
by Mark
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

Posted: Mon Mar 31, 2008 12:13 pm
by Janschenkel
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:

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
And then you can 'export' that file using the folloowing script:

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
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.

Posted: Mon Mar 31, 2008 12:50 pm
by malte
Silly idea here...

Use the revZip commands to write out your files? I have never worked with revZip, but the documentation makes me feel that should be doable.

all the best,

Malte