[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

metadata query - help needed



Ahem, actually, pre-package copying of the files is NOT the problem.

I know that that can be done in a variety of ways.
(CpMac feels like a quick and dirty hack to me; it doesn't seem to be  
able to copy a tree; I always got an error message of -35 as far as I  
recall.)
I think ditto would do the trick, though I did actually use command-D  
and manually readjusted the permissions afterwards.
(I just told you that in order to be accurate and complete, and to  
demonstrate that I was following all the recommendations in Apple's  
developer documentation. [=Copy your tree, build your package from the  
copied tree, as PackageMaker may alter the files it builds a package  
from, in order to correctly deal with resource forks.])
A slightly dated but nevertheless valid comparison of the various  
available tools is at:  
http://www.macdevcenter.com/pub/a/mac/2002/07/02/terminal_5.html

Now, to repeat: I did successfully test launching the script via  
double-click AFTER I copied all the files, USING the actual copy.
I then proceeded to build my package with PackageMaker. The Package  
contains the script in its "payload" (ie. the "root" path = the  
"Package_contents" path) The script in question is not a resource  
script to be run during the actual installation, it is itself being  
installed.
Cf:  
http://developer.apple.com/documentation/DeveloperTools/Conceptual/ 
SoftwareDistribution/index.html (which I read in full).

My problem is that the file-specific  "Open-with"-metadata is lost  
somewhere between AFTER I copied and tested the script, presumably  
during the process of building the package and/or installing it. My  
script (ie. the newly created working copy) IS double-clickable BEFORE  
I build the package. It is NOT double-clickable AFTER I install that  
package (i.e. the file installed from the package is not).

I wonder if anyone knows anything about this problem -- and if not,  
then it might help if I knew precisely where and in what form the  
relevant metadata is stored. -- I currently just don't know. (Relevant  
metadata here means the data that says: "Open this particular file  
(only) with that particular application when double-clicked in  
Finder.")

I have pasted the original email back in at the bottom, to clarify.

Thanks and regards,
Jens

On 3 Mar 2004, at 19:07, Fabien Roy wrote:

> hfstar does it also and can deal with a whole directory tree instead  
> of individual files.
>
> Fabien
> On Mar 3, 2004, at 10:57 AM, Dustin Sallings wrote:
>
>>
>> On Mar 3, 2004, at 4:46, Jens Ropers wrote:
>>
>>> Now I wonder where that metadata is stored and if (and how) it can  
>>> be carried forward in this context?
>>
>> 	You can either use /Developer/Tools/CpMac for your copies, or (I  
>> believe), you can copy originalfile/rsrc to newfile/rsrc .
>>
>> -- 
>> Dustin Sallings
>>

My (Jens Ropers) original query email follows:

Greetings,

Does anyone know where the information which Application a file is  
opened with is stored?
I am referring to the per-file information, ie. this is not about a  
generic assignment of, say, opening all *.txt files with BBEdit; this  
is about an individual assignment--open just a particular file with a  
particular application.

To explain:

I am working on a software distribution.
I am not a Real Programmer(R). ;-)
So far, I have done this:
I have written a shell script and chmod'ed it 755.
In Finder, I have assigned Terminal as the Application to open the file  
with.
I have copied that file with command-D and proceeded with the copy.
I have sudo chown'ed root:admin to be the owner/group.
I have tested double-clicking on the file and found it to work ok.
I have then built an installable package with PackageMaker  
(Panther/Xcode version 1.1.11).
(I got prompted to split resource forks, which I did. -- This may or  
may not have anything to do with that particular file.)
I have then test-installed my package (using Admin authorization, which  
I made the Installer ask for) and found my file in the right place,  
with the right permissions and root:admin as the owner. However, I  
found the file to lack the ability to double-click on it to open it in  
Terminal. This metadata did apparently not come across.

Now I wonder where that metadata is stored and if (and how) it can be  
carried forward in this context?

Any help MUCH appreciated.

Thanks and regards,
Jens Ropers

PS: I am now aware of a workaround (not tested, but should work), which  
is naming the script file /something/.command. This will make it  
executable on the target system. However I really hate making the file  
name part of the action. I'm not a friend of the kludge-ish Wintel file  
extension convention. If things can be done outside of the filename I'd  
rather do that instead.