installer.py: Add Permissions check

This commit is contained in:
Mykola Grymalyuk
2022-01-25 09:55:21 -07:00
parent 2ca02f5802
commit af3abe6aa1

View File

@@ -12,6 +12,7 @@ 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
try:
if (Path("/Applications") / Path(application) / Path("Contents/Resources/createinstallmedia")).exists(): if (Path("/Applications") / Path(application) / Path("Contents/Resources/createinstallmedia")).exists():
plist = plistlib.load((Path("/Applications") / Path(application) / Path("Contents/Info.plist")).open("rb")) plist = plistlib.load((Path("/Applications") / Path(application) / Path("Contents/Info.plist")).open("rb"))
try: try:
@@ -32,6 +33,8 @@ def list_local_macOS_installers():
}) })
except KeyError: except KeyError:
pass pass
except PermissionError:
pass
return application_list return application_list
def create_installer(installer_path, volume_name): def create_installer(installer_path, volume_name):