Skip to content

macOS package sometimes is blocked on macOS #10874

Open
@TravisEz13

Description

@TravisEz13

Issue

When running the package you get a message like this
image
"powershell-7.0.0-preview.5-osx-x64.pkg" can't be opened because Apple cannot check it for malicious software.

Workaround - Finder

  1. Click Ok in the dialog.
  2. Find the package in Finder.
  3. Control Click (click while holding the ctrt key) on the package icon.
  4. Click open on the context menu that comes up.
    image

Workaround - Command Line

  1. run sudo xattr -rd com.apple.quarantine <path to package>, replace <path to package> with the actual path to the .pkg file.
  2. Then install the package as you normally would.

Required changes

1.       Opt-in to use runtime hardening when developing your app.
a.       Insert the following key by editing your info.plist: CSFlags of type int, 65536 is the hardening value
                <key>CSFlags>
                <integer>65536</integer>
                                       i.            Create entitlements file
                                     ii.            Pass a directive to codesign with entitlements file
Same entitlements file and syntax are used for both hardening and sandboxing but they are orthogonal to each other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Maintainers-Buildspecific to affecting the buildIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aKeepOpenThe bot will ignore these and not auto-closeWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions