我创建了JavaFx应用程序,并创建了多平台本机包。实际上,我已经成功创建了Windows和Mac OsX捆绑软件。
现在,我想对我的捆绑包进行签名,以避免在安装过程中出现令人讨厌的警报。我购买了Comodo证书,并且在Windows中可以正确签名我的exe文件。

在Mac上,我遇到了问题。我按照本教程https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm#BCGDBIBB进行操作,并在我的钥匙串中导入了Comodo证书。

我创建了一个后置图像脚本:

echo "Signing application bundle"
#Move to the folder containing application bundle
cd ../images/dmg.image
#do sign
codesign -s "CN_OF_COMODO_CERTIFICATE" *.app
echo "Done with signing"


但是在编译过程中,我收到以下消息:

do-deploy:

 [copy] Copying 47 files to /Users/Utente/Documents/workspaceServer

/app/javafx/target/dist/libs

Using base JDK at: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk

Using base JDK at: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk

  Using custom package resource [Bundle config file]  (loaded from package/macosx/Info.plist)

  Using custom package resource [icon]  (loaded from package/macosx/appDesk.icns)

Creating app bundle: /Users/Utente/Documents/workspaceServer/app/javafx/target/deploy/bundles/appDesk.app

Did not find a key matching 'Developer ID Application: '

  Config files are saved to /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler309272187389884092/macosx. Use them to customize package.

Building DMG package for appDesk

  Using custom package resource [Bundle config file]  (loaded from package/macosx/Info.plist)

  Using custom package resource [icon]  (loaded from package/macosx/appDesk.icns)

Did not find a key matching 'Developer ID Application: '

  Config files are saved to /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8772000028741891358/macosx. Use them to customize package.

  Using default package resource [dmg background]  (add package/macosx/appDesk-background.png to the class path to customize)

  Using default package resource [volume icon]  (add package/macosx/appDesk-volume.icns to the class path to customize)

  Using custom package resource [script to run after application image is populated]  (loaded from package/macosx/appDesk-post-image.sh)

  Using default package resource [License setup]  (add package/macosx/appDesk-license.plist to the class path to customize)

  Using default package resource [DMG setup script]  (add package/macosx/appDesk-dmg-setup.scpt to the class path to customize)

Running shell script on application image [/var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8772000028741891358/macosx/appDesk-post-image.sh]

Signing application bundle

*.app

: No such file or directory

Done with signing

hdiutil: unflatten: unflattening "appDesk-3.0.3.dmg"...

copying resource 'STR#' (5000)...

copying resource 'STR#' (5001)...

copying resource 'STR#' (5002)...

copying resource 'STR#' (5003)...

copying resource 'STR#' (5004)...

copying resource 'STR#' (5005)...

copying resource 'STR#' (5006)...

copying resource 'STR#' (5007)...

copying resource 'STR#' (5008)...

copying resource 'STR#' (5009)...

copying resource 'STR#' (5010)...

copying resource 'STR#' (5011)...

copying resource 'STR#' (5012)...

copying resource 'STR#' (5013)...

copying resource 'STR#' (5014)...

copying resource 'STR#' (5015)...

copying resource 'STR#' (5016)...

copying resource 'plst' (0)...

copying resource 'TEXT' (5000)...

copying resource 'LPic' (5000)...

copying resource 'styl' (5000)...

copying resource 'TMPL' (128)...

hdiutil: flatten: flattening "appDesk-3.0.3.dmg"...

Result DMG installer for appDesk: /Users/Utente/Documents/workspaceServer/app/javafx/target/deploy/bundles/appDesk-3.0.3.dmg

  Config files are saved to /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8772000028741891358/macosx. Use them to customize package.

Building PKG package for appDesk

  Using custom package resource [Bundle config file]  (loaded from package/macosx/Info.plist)

  Using custom package resource [icon]  (loaded from package/macosx/appDesk.icns)

Did not find a key matching 'Developer ID Application: '

  Config files are saved to /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8003647333686847937/macosx. Use them to customize package.

  Using default package resource [pkg background image]  (add package/macosx/appDesk-background.png to the class path to customize)

  Using custom package resource [script to run after application image is populated]  (loaded from package/macosx/appDesk-post-image.sh)

Running shell script on application image [/var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8003647333686847937/macosx/appDesk-post-image.sh]

Signing application bundle

{}

*.app

: No such file or directory

Done with signing

pkgbuild: Adding component at /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8003647333686847937/images/image-5462634906848679457/appDesk.app

pkgbuild: Wrote package to /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8003647333686847937/packages/appDesk-app.pkg

Did not find a key matching 'Developer ID Installer: '

productbuild: Wrote product to /Users/Utente/Documents/workspaceServer/app/javafx/target/deploy/bundles/appDesk-3.0.3.pkg

  Config files are saved to /var/folders/q6/vmt_h0tx3rgdbt_4h2_2f3780000gn/T/fxbundler8003647333686847937/macosx. Use them to customize package.

Did not find a key matching '3rd Party Mac Developer Application: '

Bundler Mac App Store Ready Bundler skipped because of a configuration problem: No Mac App Store App Signing Key

Advice to fix: Install your app signing keys into your Mac Keychain using XCode.

BUILD SUCCESSFUL
Total time: 3 minutes 59 seconds


任何想法如何解决此问题,并在构建过程中自动签署dmg?

=====编辑=========
这是我所需的Info.plist文件:

<?xml version="1.0" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
 <dict>
  <key>LSMinimumSystemVersion</key>
  <string>10.7.4</string>
  <key>CFBundleDevelopmentRegion</key>
  <string>English</string>
  <key>CFBundleAllowMixedLocalizations</key>
  <true/>
  <key>CFBundleExecutable</key>
  <string>appDesk</string>
  <key>CFBundleIconFile</key>
  <string>appDesk.icns</string>
  <key>CFBundleIdentifier</key>
  <string>fxApplication</string>
  <key>CFBundleInfoDictionaryVersion</key>
  <string>6.0</string>
  <key>CFBundleName</key>
  <string>appDesk</string>
  <key>CFBundlePackageType</key>
  <string>APPL</string>
  <key>CFBundleShortVersionString</key>
  <string>3.0.4</string>
  <key>CFBundleSignature</key>
  <string>????</string>
  <!-- See http://developer.apple.com/library/mac/#releasenotes/General/SubmittingToMacAppStore/_index.html
       for list of AppStore categories -->
  <key>LSApplicationCategoryType</key>
  <string>Unknown</string>
  <key>CFBundleVersion</key>
  <string>3.0.4</string>
  <key>NSHumanReadableCopyright</key>
  <string>Copyright</string>
  <key>NSHighResolutionCapable</key>
  <string>true</string>
 </dict>
</plist>


谢谢

最佳答案

如果您拥有正确的工具,并不是很复杂。
只需下载amipackage(https://amidb.com/amipackage
并运行:

 cd /Applications/amipackage.app/Contents/scripts
 chmod a+x ./amipackage.sh
 ./amipackage.sh --config=/Users/jsmith/cooljavaapp.properties


它生成dmg,xcarchives等...

免责声明:我参与了amipackage

10-07 15:49