MAC OS - Adding Dock icon (part 5)?

Comments

5 comments

  • Avatar
    michiel

    Hi,

    Could you run the installer with the `--debugtrace debug.txt` option and send us the debug.txt file to support@bitrock.com? For example:

    `/Path/to/installer.app/Contents/MacOs/installbuilder.sh --debugtrace debug.txt`

    Regards,

    Michiel

    0
    Comment actions Permalink
  • Avatar
    Codename K

    Hello,

    Thanks for your reply. The answer given in this link seems to be working. But it only works if it is in AppleScript. So I created an AppleScript and saved it as APP file. When this file is run through the installer I get this error shown in below image. But when the AppleScript APP file is run manually it works fine and creates the Dock icon. How to fix this?

    0
    Comment actions Permalink
  • Avatar
    michiel

    Hi,

    Can you share the snippet where you execute the Applescript, and also the command you are running manually?

    Regards,

    Michiel

    0
    Comment actions Permalink
  • Avatar
    Codename K

    Hello,

    This is the code,

    <postInstallationActionList>
    <runProgram>
    <abortOnError>0</abortOnError>
    <program>${installdir}/myApp.app/⁨Contents/⁨MacOS⁩/applet</program>
    <programArguments></programArguments>
    <run>0</run>
    <show>0</show>
    </runProgram>
    </postInstallationActionList>

    And this is the AppleScript code from apple.stackexchange.com,

    my add_item_to_dock("/Applications/myAppFolder/myApp.app")
    on add_item_to_dock(item_path)
    try
    get item_path as alias -- you need a POSIX path so this coerces the path in case it's an HFS path, alias, file ref, etc.
    set item_path to POSIX path of item_path
    end try
    try
    tell application "Dock" to quit
    end try
    do shell script "defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" & item_path & "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>'"
    try
    tell application "Dock" to activate
    end try
    end add_item_to_dock

     

    0
    Comment actions Permalink
  • Avatar
    michiel

    Hi,

    You need to run the script with osascript:

    <postInstallationActionList>
    <runProgram>
    <abortOnError>0</abortOnError>
    <program>osascript</program>
    <programArguments>${installdir}/myApp.app/⁨Contents/⁨MacOS⁩/applet</programArguments>
    </runProgram>
    </postInstallationActionList>

    Regards,

    Michiel

    0
    Comment actions Permalink

Please sign in to leave a comment.