“AppName.pkg” cannot be opened because it is from an unidentified developer.

I need to distribute my MacOS app to users at my institution so I packaged and signed it with “productbuild”  as such:   I generated the signing key in the Developer portal by choosing the “Mac Installer Distribution” type downloaded it and added it to my keychain. Then I ran this command:  

>  productbuild --sign "3rd Party Mac Developer Installer (XXXXXXXXXX)" \
>  --component InstallTkiCliClient.app /Applications InstallTkiCliClient.pkg

  I placed the file in an S3 bucket and downloaded it with Safari. When I open it, I get the dialog that says ‘“AppName.pkg” cannot be opened because it is from an unidentified developer.’ and I have no option but to cancel the operation.   I know the “trick” of ctrl-clicking the file and choosing “Open With” to bring up a dialog that has an option to open the app. That is not my problem. I wanted to avoid this problem for persons that download it so that is why I did all this in the first place.    I did try using “productsign” as well, but that didn’t fix anything which was not a surprise.  

> productsign --sign "3rd Party Mac Developer Installer (XXXXXXXXXX)" \ \
> InstallTkiCliClientInstaller.pkg \ 
> InstallTkiCliClientInstallerSigned.pkg

  Can someone figure out what I did wrong? Did I miss a step?

If you don't want your users to have to right-click and choose open, you need to notarize the application. In Xcode, choose Archive, then Distribute App. Select the Developer ID option, then Upload. The app should be signed with your company's developer ID, uploaded to Apple, notarized, and returned to you in your archive. Notarization can take a few minutes. You can also do this from a script, see man altool

ssmith_c is correct that notarisation is required, but you also have a problem with your signing identities. You’re using 3rd Party Mac Developer Installer (TTT), which is used for signing installer packages to upload to the Mac App Store. If you want to distribute independently, you need to use Developer ID.

For detailed info about this stuff, Signing a Mac Product For Distribution.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

“AppName.pkg” cannot be opened because it is from an unidentified developer.
 
 
Q