使用 COMODO 证书签名的 JavaFx dmg 包

标签 java macos javafx javafx-2 javafx-8

我创建了一个 JavaFx 应用程序并创建了多平台原生包。实际上我成功地创建了 Windows 和 Mac OsX 包。 现在我想签署我的 bundle 以避免在安装过程中出现烦人的警报。我购买了 Comodo 证书,并且在 Windows 中我能够正确地签署我的 exe 文件。

在 Mac 上,我遇到了问题。我遵循了本教程 https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm#BCGDBIBB ,并且我在我的钥匙串(keychain)中导入了 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

关于使用 COMODO 证书签名的 JavaFx dmg 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32506871/

相关文章:

java - 如何使用 ConcurrentLinkedQueue?

java - 将 Morphia 依赖性添加到项目中?

java - 如何让火柴人具有互动性?

cocoa - 在 Cocoa OSX 中以编程方式实例化 NSPopUpButtonCell

java - ColorPicker 中 TextField 中的字体颜色

javafx双向更改通知不起作用?

java - PLS-00201 : identifier 'DBMS_SODA_ADMIN.DESCRIBE_COLLECTION' must be declared

xcode - OSX Storyboards - 使用标准 segue 打开非模态窗口

swift - 制作MacOS应用程序时无法从Swift中的URL播放音频

java - 显示预加载器和阶段之间的延迟