[missing-sync-palmos-dev-talk] how to create conduit installer?
Scott Gruby
sgruby at markspace.com
Tue Jan 24 08:00:25 PST 2006
On Jan 23, 2006, at 6:35 PM, Mark Chung wrote:
> I used the Mark/Space SampleConduit code to develop a conduit, which
> works for me on OS X 10.4.3 and HotSync 3.2.1 (thanks to Mark/
> Space for
> the sample code, it was a lifesaver!). I also created an installer
> with
> PackageMaker.
>
> I've tested the installer and the conduit successfully on my
> development system, but a beta user said that the conduit doesn't
> show up in the Conduit Settings even though the installer copied
> the file to the right
> location, and the user was an administrator. I get similar results
> on a test machine. Before creating the installer, I recursively set
> the permissions on the conduit to 775 and the ownership to
> root:admin, and set the installer to authorize as root.
> Am I missing something?
>
I'll reply to the entire list; HotSync Manager seems to require the
bundle bit to be set on the conduit folder. The only way I've found
to do this from an installer is to write a PostInstall application
that does it. Here's code that should work; compile it as a command
line Foundation Tool and link in the Carbon Framework.
#import <Foundation/Foundation.h>
void SetBundleFlag(NSString *inFilePath)
{
OSErr err;
FSRef targetRef;
FSRef parentRef;
FSCatalogInfo catalogInfo;
FileInfo finderInfo;
err = FSPathMakeRef((UInt8*)[inFilePath fileSystemRepresentation],
&targetRef, NULL );
if (err )
{
return;
}
err = FSGetCatalogInfo( &targetRef, kFSCatInfoFinderInfo,
&catalogInfo, NULL, NULL, &parentRef);
if (err)
{
return;
}
memcpy(&finderInfo, catalogInfo.finderInfo, sizeof
(catalogInfo.finderInfo));
finderInfo.finderFlags |= kHasBundle;
memcpy(catalogInfo.finderInfo, &finderInfo, sizeof
(catalogInfo.finderInfo));
(void) FSSetCatalogInfo( &targetRef, kFSCatInfoFinderInfo,
&catalogInfo);
}
int main(int argc, char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SetBundleFlag(@"/Library/Application Support/Palm HotSync/Conduits/
MyConduit.plugin");
[pool release];
return 0;
}
--
Scott Gruby
Lead Engineer
Mark/Space, Inc.
<http://www.markspace.com/>
Please visit <http://www.markspace.com/support/> for assistance with
Mark/Space products.
More information about the missing-sync-palmos-dev-talk
mailing list