mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 03:20:16 +10:00
installer.py: Add Permissions check
This commit is contained in:
@@ -12,26 +12,29 @@ def list_local_macOS_installers():
|
|||||||
|
|
||||||
for application in Path("/Applications").iterdir():
|
for application in Path("/Applications").iterdir():
|
||||||
# Verify whether application has createinstallmedia
|
# Verify whether application has createinstallmedia
|
||||||
if (Path("/Applications") / Path(application) / Path("Contents/Resources/createinstallmedia")).exists():
|
try:
|
||||||
plist = plistlib.load((Path("/Applications") / Path(application) / Path("Contents/Info.plist")).open("rb"))
|
if (Path("/Applications") / Path(application) / Path("Contents/Resources/createinstallmedia")).exists():
|
||||||
try:
|
plist = plistlib.load((Path("/Applications") / Path(application) / Path("Contents/Info.plist")).open("rb"))
|
||||||
# Doesn't reflect true OS build, but best to report SDK in the event multiple installers are found with same version
|
|
||||||
app_version = plist["DTPlatformVersion"]
|
|
||||||
clean_name = plist["CFBundleDisplayName"]
|
|
||||||
try:
|
try:
|
||||||
app_sdk = plist["DTSDKBuild"]
|
# Doesn't reflect true OS build, but best to report SDK in the event multiple installers are found with same version
|
||||||
|
app_version = plist["DTPlatformVersion"]
|
||||||
|
clean_name = plist["CFBundleDisplayName"]
|
||||||
|
try:
|
||||||
|
app_sdk = plist["DTSDKBuild"]
|
||||||
|
except KeyError:
|
||||||
|
app_sdk = "Unknown"
|
||||||
|
application_list.update({
|
||||||
|
application: {
|
||||||
|
"Short Name": clean_name,
|
||||||
|
"Version": app_version,
|
||||||
|
"Build": app_sdk,
|
||||||
|
"Path": application,
|
||||||
|
}
|
||||||
|
})
|
||||||
except KeyError:
|
except KeyError:
|
||||||
app_sdk = "Unknown"
|
pass
|
||||||
application_list.update({
|
except PermissionError:
|
||||||
application: {
|
pass
|
||||||
"Short Name": clean_name,
|
|
||||||
"Version": app_version,
|
|
||||||
"Build": app_sdk,
|
|
||||||
"Path": application,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
return application_list
|
return application_list
|
||||||
|
|
||||||
def create_installer(installer_path, volume_name):
|
def create_installer(installer_path, volume_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user