though the original problem has been solved already (just move the app to 
/Applications)
I would just like to share some tips on how to package your app for 
distribution.

1. to code sign or not is a mostly financial question; there is nothing 
technically difficult about it, you just need to keep paying the annual fee to 
Apple.

you can manage your certificates needed to code sign directly from Xcode.
just make sure you add both certificates, "Application" and "Installer".
so you just click 2 buttons.

https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html

2. there are basically 3 modes of deployment; zip, dmg or pkg

in all 3 cases it is preferred that the app itself is signed
it is preferred that the dmg and pkg are themselves signed
zip and dmg requires the app to be moved to /Applications by the user (pkg does 
that automatically)

Note: even if you do sign your app and zip or pkg, GateKeeper may still prevent 
it from being launched initially,
and a blocked application may still be launched from System Preferences. (and 
GateKeeper won't bother the user again)

a. app

first you want to sign your app.

you can use the build-in feature of 4D, or run the procedure from Terminal.

> codesign -s "Developer ID Application: keisuke miyako (Y69CWUC25B)" sample.app


you can omit the code in parenthesis if there is no ambiguity.

signing requires access to a timer server, so your network must be available.

to check the signature, do

> spctl --assess --type exec -vv sample.app


or

> codesign --verify --deep --strict --verbose=2 sample.app


b. dmg

you can use the Disk Utility app, or a simple terminal command to create a dmg 
of your application.

> hdiutil create -srcfolder sample.app sample.dmg


for fancier options, check out: https://github.com/andreyvit/create-dmg 
https://pypi.python.org/pypi/dmgbuild

to sign a dmg, follow the example (macOS 10.11.5 or later)

> codesign -s "Developer ID Application: keisuke miyako (Y69CWUC25B)" sample.dmg


you can check the validity of the signature itself

> codesign --verify --deep --strict --verbose=2 sample.dmg


but to assess the dmg signature you need to use Sierra

> spctl --assess --type open --context context:primary-signature -vv sample.dmg


c. zip

instead of a dmg, you could simply zip the app and share it.
there is no need to sign the zip.

d. pkg

as explained by Keith, you can also create a standard package installer

> productbuild --component sample.app --sign "Developer ID Installer: keisuke 
> miyako (Y69CWUC25B)" sample.pkg

it is really important that your source file (the app) is already installed in 
/Applications.
otherwise, the package will be created, but running it will create a blank app.

you can also create a pkg with pkgbuild

> pkgbuild --component sample.app --sign "Developer ID Installer: keisuke 
> miyako (Y69CWUC25B)" sample.pkg

but again, the installer won't install anything if the source was not in 
/Applications already, even if you specify the -install-location option.

to check the signature

> spctl --assess --type install -vv sample.pkg


or

> pkgutil --check-signature sample.pkg


rather than using a 4D app which is large,
I suggest you experiment with a small preinstalled app,
upload the zip, pkg or dmg to a convenient server,
download it and see what happens.

miyako


宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

[email protected]
www.4D.com/JP

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to