mirror of
https://github.com/munki/munki.git
synced 2026-04-23 13:29:26 -05:00
Fix for munkicommon.getLSInstalledApplications(): use NSURL instead of FSRef, so no need to call LaunchServices.LSGetApplicationForURL(). Faster and hopefully more reliable.
This commit is contained in:
@@ -1812,13 +1812,9 @@ def getLSInstalledApplications():
|
||||
apps = LaunchServices._LSCopyAllApplicationURLs(None)
|
||||
applist = []
|
||||
for app in apps:
|
||||
(status, fsobj, unused_url) = LaunchServices.LSGetApplicationForURL(
|
||||
app, _unsigned(LaunchServices.kLSRolesAll), None, None)
|
||||
if status != 0:
|
||||
continue
|
||||
app_path = fsobj.as_pathname()
|
||||
if (app_path and not app_path.startswith('/Volumes/') and not
|
||||
isExcludedFilesystem(app_path)):
|
||||
app_path = app.path()
|
||||
if (app_path and not isExcludedFilesystem(app_path) and
|
||||
os.path.exists(app_path)):
|
||||
applist.append(app_path)
|
||||
|
||||
return applist
|
||||
|
||||
Reference in New Issue
Block a user