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 to process application assets files when creating .dmg on Mac OS X
QtWS25 Last Chance

How to process application assets files when creating .dmg on Mac OS X

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.8k 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.
  • L Offline
    L Offline
    leonardyu
    wrote on last edited by
    #1

    We've just finished development of our application and are trying to create a .dmg disk image for public distribution. The applicaiton is developed with Qt 4.8.3 (binary framework installation) on Mac OS X. We've successfully used macdeployqt tool to create the application bundle along with a .dmg disk image file. The macdeployqt is magic and help copying Qt and 3rd party libraries into AppName.app/Contents/Frameworks directory. We can run the app from inside the bundle directory (AppName.app/Contents/MacOS) from either terminal ($ ./appname) or Finder (double mouse click).
    However, after we installed the application using the .dmg file and run our app from the Launchpad, our app crashed at startup and the debug information indicates that the crash reason is that the assets files could not be loaded. Our app depends on quite a number of assets files (fonts, map data, palette data, help documents etc.) to run. We just copy these assets files into AppName.app/Contents/MacOS directory (where the executable file 'appname' resides) when we create the .dmg file as in our code these asset files are referenced in relative path.
    So how to figure this issue out? Thanks in advance.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vtong
      wrote on last edited by
      #2

      Hi,
      Did you create a Resource file and put your assets there?
      Normally I put all to resource file and build.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leonardyu
        wrote on last edited by
        #3

        Thank you for your help.
        Could you be more specific on how to create a resource file and put all my assets files (100+) into this file?

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vtong
          wrote on last edited by
          #4

          http://doc.qt.io/qt-5/resources.html

          You can also create a resource file from Qt Creator:
          http://doc.qt.digia.com/qtcreator-2.3/creator-writing-program.html

          Hope this help and solve your issue

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leonardyu
            wrote on last edited by
            #5

            Thanks again.
            As a matter of fact, my project already consists of a .qrc resource file that specifying image resources for icons, button images and so on.
            I thought your approach may not apply in my case, as my assets files are referenced by low-level modules projects (built as .dylib files) instead of the top-level Qt GUI app project. These asset files are loaded in the source code by specifying the file names. If these asset files are packed into a single Qt resource file, they cannot be referenced by the modules.

            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