I'm not sure this is the right arena for this query, since this is a problem
which RB 2006 Release 3 (haven't started to use 4 yet) has itself, but anyway...

My installer needs to copy Mac OS X "applications," i.e. the application
"bundle", Contents, PkgInfo, resources, and all. I long ago wrote some
apparently reliable code to do this by recursively descending the directory
tree and copying all the subdirectories and files... and, yes, it preserves
file modes and owners, and even handles aliases and symbolic links. It "works"
in the sense that the copied applications are functional, and that I cannot
detect any differences between the copy and the original when I perform e.g. ls
-l on them.

However, there is an intermittent problem with the copies. I cannot reliably
cause it to happen, but the characteristics are predictable. The quick
description is that the application is functional but displays with a generic
icon.

--The application displays with a generic application icon instead of the
proper icon (even though in the Finder, viewing the actual executable in
Contents/MacOS shows the proper icon).
--If I perform a GetOpenFolderItem("App") where App specifies type=APPL,
creator=????, extension = ".app", the application is not selectable.
--The application appears to be perfectly functional.
--Rebooting the system does not change the situation; the application still
shows the generic icon and still cannot be selected with
GetOpenFolderItem("App").
--Duplicating the application in the Finder not only produces a copy that
displays with the correct icon, it sometimes but not always cures the problem
with the original copy. 
--I am unable to detect any differences whatsoever between the Finder copy and
the original, either by inspecting the package structure with Show Package and
Get Info, or with .ls.

I have added a call to LSRegisterFSRef following the copy. I think it works
(because it returns 0 when I expect it to, and an error code when I
deliberately use it on a non-application file). I am not sure if it helps.

I believe there is a timing issue involved. For example, I believe that if I
call LSRegisterFSRef quickly after copying the package the problem does not
occur, but if the problem has occurred calling LSRegisterFSRef does not sure it.

Does anyone have any insights into what exactly is happening? Is LaunchServices
prematurely trying to register the package before the copy is complete or
something like that? Is there a documented necessary step in copying an
application that I'm not performing?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to