Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I add Symbolic Link (/Application) and background image in .dmg package?

How can I add Symbolic Link (/Application) and background image in .dmg package?

Scheduled Pinned Locked Moved Solved General and Desktop
macdeployqtqt 5.11bashmac-osqtcreator
3 Posts 2 Posters 2.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yash001
    wrote on 25 Sept 2018, 19:20 last edited by
    #1

    Hello,

    I am deploying my application with help of macdeployqt tool.

    macdeployqt tool create read only .dmg packet. I would like to add Symbolic link "ln -s /Application" in dmg packet. what is good way to do it?

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yash001
      wrote on 27 Sept 2018, 22:49 last edited by
      #2

      got solution from
      https://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/

      example script:

      echo "change the permision of .dmg file"
      hdiutil convert "SquidStat.dmg" -format UDRW -o "SquidStat_Rw.dmg"
      
      echo "mount it and save the device"
      DEVICE=$(hdiutil attach -readwrite -noverify "SquidStat_Rw.dmg" |egrep '^/dev/' |sed 1q |awk '{print $1}')
      
      sleep 2
      
      echo "create the sysmbolic link to application folder"
      PATH_AT_VOLUME=/Volumes/..:..:out:Release:_SquidStat:SquidStat     ## check Path inside cd /Volume/
      
      pushd "$PATH_AT_VOLUME"
      ln -s /Applications
      popd
      
      echo "copy the background image in to package"
      mkdir "$PATH_AT_VOLUME"/.background
      cp backgroundImage.png "$PATH_AT_VOLUME"/.background/
      echo "done"
      
      # tell the Finder to resize the window, set the background,
      #  change the icon size, place the icons in the right position, etc.
      echo '
          tell application "Finder"
          tell disk "../../out/Release/_SquidStat/SquidStat"   ## check Path inside cd /Volume/
              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
                  set the bounds of container window to {400, 100, 1110, 645}
                  set viewOptions to the icon view options of container window
                  set arrangement of viewOptions to not arranged
                  set icon size of viewOptions to 72
                  set background picture of viewOptions to file ".background:backgroundImage.png"
                  set position of item "SquidStat.app" of container window to {160, 325}
                  set position of item "Applications" of container window to {560, 320}
              close
              open
              update without registering applications
              delay 2
          end tell
          end tell
      ' | osascript
      
      sync
      
      # unmount it
      hdiutil detach "${DEVICE}"
      
      rm -f "SquidStat.dmg"
      
      
      hdiutil convert "SquidStat_Rw.dmg" -format UDZO -o "SquidStat.dmg"
      
      rm -f "SquidStat_Rw.dmg"
      exit
      
      
      1 Reply Last reply
      2
      • D Offline
        D Offline
        dscyw
        wrote on 13 Dec 2018, 10:50 last edited by
        #3

        Another way is to create .dmg file by hdiutil create instead of macdeployqt -dmg .

        mkdir ui-release
        cd ui-release
        ln -s /Applications
        cd ..
        mv $appfolder ui-release/
        hdiutil create -volname $volname -srcfolder ui-release/ -ov -format UDZO $dmgfilename
        
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved