【问题标题】:javafxpackager Positions Applications Folder Incorrectly On Mac OS Xjavafxpackager 在 Mac OS X 上错误地定位应用程序文件夹
【发布时间】:2014-01-06 16:47:37
【问题描述】:

我正在使用 Mac OS X Mavericks 和 JDK 1.7.45 使用 Mac 的 javafxpackager 工具打包 Swing 应用程序。不幸的是,最终结果看起来像这样(隐藏图标/名称):

向右滚动一下,图片就更清晰了:

显然,应用程序图像被错误地放置在 DMG 中。我不知道这是怎么发生的,或者我可能做了什么触发了这个,我只是使用了标准的 NetBeans 打包脚本。任何提示或方向将不胜感激。

【问题讨论】:

    标签: macos swing netbeans javafx dmg


    【解决方案1】:

    好吧,原来这很简单,似乎工具生成了脚本:

    tell application "Finder"
      tell disk "MyApplication"
        open
        set current view of container window to icon view
        set toolbar visible of container window to false
        set statusbar visible of container window to false
    
        -- size of window should match size of background
        set the bounds of container window to {400, 100, 917, 370}
    
        set theViewOptions to the icon view options of container window
        set arrangement of theViewOptions to not arranged
        set icon size of theViewOptions to 128
        set background picture of theViewOptions to file ".background:background.png"
    
        -- Create alias for install location
        make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
    
        -- First, move all files far enough to be not visible if user has "show hidden files" option set
        -- Note: this only make sense if "hidden" files are also visible on the build system
        --   otherwise command below will only return list of non-hidden items
        set filesToHide to the name of every item of container window
        repeat with theFile in filesToHide
             set position of item theFile of container window to {1000, 0}
        end repeat
    
        -- Now position application and install location
        set position of item "MyApplication" of container window to {120, 135}
        set position of item "Applications" of container window to {390, 135}
    
        close
        open
        update without registering applications
        delay 5
      end tell
    end tell
    

    这是有问题的,因为它只会延迟 5 秒(我假设是几秒钟),所以我将其增加到 20 并且它起作用了。脚本应放在package/macosx/MyApplication-dmg-setup.scpt 下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-19
      • 2013-10-24
      • 1970-01-01
      • 2012-04-18
      • 1970-01-01
      • 2014-09-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多