Skip to content

Commit

Permalink
Always prompt the user to find their installation if product identifi…
Browse files Browse the repository at this point in the history
…er isn't

 specified.
  • Loading branch information
icculus committed May 27, 2004
1 parent 055603d commit e77e46c
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions platform_unix.c
Expand Up @@ -382,25 +382,36 @@ int chdir_by_identifier(const char *name, const char *str, const char *version)
char buf[MAXPATHLEN];
Boolean b;
OSStatus rc;
CFURLRef url = NULL;
CFStringRef id = CFStringCreateWithBytes(NULL, str, strlen(str),
kCFStringEncodingISOLatin1, 0);
int found = 0;

rc = LSFindApplicationForInfo(kLSUnknownCreator, id, NULL, NULL, &url);
CFRelease(id);
if (rc == noErr)
/* if an identifier is specified, ask LaunchServices to find product... */
if ((str != NULL) && (*str))
{
b = CFURLGetFileSystemRepresentation(url, TRUE, buf, sizeof (buf));
CFRelease(url);
if (!b)
CFURLRef url = NULL;
CFStringRef id = CFStringCreateWithBytes(NULL, str, strlen(str),
kCFStringEncodingISOLatin1, 0);

rc = LSFindApplicationForInfo(kLSUnknownCreator, id, NULL, NULL, &url);
CFRelease(id);
if (rc == noErr)
{
_fatal("Internal error.");
return(0);
b = CFURLGetFileSystemRepresentation(url, TRUE, buf, sizeof (buf));
CFRelease(url);
if (!b)
{
_fatal("Internal error.");
return(0);
} /* if */
found = 1;
} /* if */
else
{
_log("Couldn't find product. Perhaps it isn't installed?");
} /* if */
} /* if */
else

if (!found) /* No identifier, or LaunchServices couldn't find it. */
{
_log("Couldn't find product. Perhaps it isn't installed?");
if (!manually_locate_product(name, buf, sizeof (buf)))
{
_fatal("We can't patch the product if we can't find it!");
Expand Down

0 comments on commit e77e46c

Please sign in to comment.