javafxpackager неправильно размещает папку приложений в Mac OS X

Я использую Mac OS X Mavericks и JDK 1.7.45 для упаковки приложения Swing с помощью инструмента javafxpackager для Mac. К сожалению, конечный результат выглядит так (значок / имя скрыт):

введите описание изображения здесь

Прокрутка вправо проясняет картинку:

введите описание изображения здесь

По-видимому, образ приложений был неправильно размещен в DMG. Я понятия не имею, как это могло произойти или что я мог сделать, что вызвало это, я просто использовал стандартный сценарий упаковки NetBeans. Любые подсказки или указания будут оценены.


person Shai Almog    schedule 06.01.2014    source источник


Ответы (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.

person Shai Almog    schedule 06.01.2014