I need to check if Multiple Versions of an application is installed on a Mac computer.
I need to check if Multiple versions of Google Chrome is installed on a mac computer and
Open an URL with the Latest Version of the Google Chrome.
I need to check if Multiple Versions of an application is installed on a Mac computer.
I need to check if Multiple versions of Google Chrome is installed on a mac computer and
Open an URL with the Latest Version of the Google Chrome.
NSURL *url = [[NSURL alloc] initWithScheme:@"http" host:@"example.host.com" path:@"/example"];
CFArrayRef finds = LSCopyApplicationURLsForURL (
(CFURLRef) url,
kLSRolesAll
) ;// all web applications
for(int i=0;i<CFArrayGetCount(finds);i++)
{
CFURLRef appURL = CFArrayGetValueAtIndex(finds,i);
MDItemRef item = MDItemCreateWithURL(kCFAllocatorDefault, appURL);
CFTypeRef itemVersion = MDItemCopyAttribute(item, kMDItemVersion);// version
NSLog(@"appURL %@ itemVersion %@",appURL,itemVersion);
}
//appURL file://localhost/Applications/Google%20Chrome.app/ itemVersion 30.0.1599.101