Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QT5 produces half/incomplete macOS package
Qt 6.11 is out! See what's new in the release blog

QT5 produces half/incomplete macOS package

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
10 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    why it dont work
    wrote on last edited by
    #1
    This post is deleted!
    artwawA 1 Reply Last reply
    0
    • W why it dont work

      This post is deleted!

      artwawA Offline
      artwawA Offline
      artwaw
      wrote on last edited by
      #2

      @why-it-dont-work
      Hi, you are likely to need macdeployqt tool to include needed libraries. Once you do that it all depends on your needs for future distribution: you can create .dmg (macdeployqt can help you with that and code signing), you can create .pkg.
      There is also Qt's Installer Framework which might or might not be of use for you.

      A note regarding use of macdeployqt: if your target is Apple AppStore there are additional requirements mentioned in the manual of the tool, i.e. you are likely to create hardened runtime. Also, since you need to notarise binaries I found myself having a shell script that handles all calls to codesign. (but that's really outside Qt)

      For more information please re-read.

      Kind Regards,
      Artur

      1 Reply Last reply
      1
      • W Offline
        W Offline
        why it dont work
        wrote on last edited by why it dont work
        #3

        here is a snippet from .pro file:

        QMAKE_POST_LINK = ${QTDIR}/bin/macdeployqt MyApp.app -always-overwrite -dmg MyApp.dmg;

        Even after this line, the application is not complete

        artwawA 2 Replies Last reply
        0
        • W why it dont work

          here is a snippet from .pro file:

          QMAKE_POST_LINK = ${QTDIR}/bin/macdeployqt MyApp.app -always-overwrite -dmg MyApp.dmg;

          Even after this line, the application is not complete

          artwawA Offline
          artwawA Offline
          artwaw
          wrote on last edited by
          #4

          @why-it-dont-work
          I never tried to run it this way. What error messages you get?

          It might be worth to try manual approach:

          • copy resulting .app package somewhere, separate folder would be great;
          • cd there;
          • run minimal macdeployqt in the form of {your Qt location}/macdeployqt {yourappname}.app;
          • try to run it;
            Since you are not signing it GateKeeper will probably complain but that's alright at this stage, if GateKeeper complains it means all the needed libs should be included.

          Also, since you asked similar questions about Linux deployment I'd advise you to read the basics of deployment techniques for all the platforms needed. I don't know much about packaging for Linux, for macOS though the absolute basics are here:

          https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW13

          https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          0
          • W why it dont work

            here is a snippet from .pro file:

            QMAKE_POST_LINK = ${QTDIR}/bin/macdeployqt MyApp.app -always-overwrite -dmg MyApp.dmg;

            Even after this line, the application is not complete

            artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #5

            @why-it-dont-work Also, what macOS version you run? Catalina, BigSur, something ancient?

            For more information please re-read.

            Kind Regards,
            Artur

            1 Reply Last reply
            0
            • W Offline
              W Offline
              why it dont work
              wrote on last edited by why it dont work
              #6

              Thanks for guiding. I am using Catalina. Let me try {your Qt location}/macdeployqt {yourappname}.app;

              1 Reply Last reply
              0
              • W Offline
                W Offline
                why it dont work
                wrote on last edited by
                #7

                {your Qt location}/macdeployqt {yourappname}.app says file already exists, skip copy.
                Then I built the
                sudo productbuild --content MyApp.app --sign "Developer ID Installer: XXX(YYY)" ~/Documents/signed.pkg

                Although it is signed, but still it is incomplete package and does not install.

                artwawA 1 Reply Last reply
                0
                • W why it dont work

                  {your Qt location}/macdeployqt {yourappname}.app says file already exists, skip copy.
                  Then I built the
                  sudo productbuild --content MyApp.app --sign "Developer ID Installer: XXX(YYY)" ~/Documents/signed.pkg

                  Although it is signed, but still it is incomplete package and does not install.

                  artwawA Offline
                  artwawA Offline
                  artwaw
                  wrote on last edited by
                  #8

                  @why-it-dont-work
                  So it appears that there is problem with the pkt rather than .app?
                  Can you run the .app after macdeploy? (you can increase verbosity of the tool with -v, -vv etc)
                  If it runs before productbuild step the problem is there and has nothing to do with Qt. If it does not though, what error do you get when trying to run the .app?

                  For more information please re-read.

                  Kind Regards,
                  Artur

                  1 Reply Last reply
                  1
                  • W Offline
                    W Offline
                    why it dont work
                    wrote on last edited by
                    #9

                    When I run the application (.app bundle), this error shows:
                    “MyApp” is damaged and can’t be opened. You should move it to the Trash.

                    artwawA 1 Reply Last reply
                    0
                    • W why it dont work

                      When I run the application (.app bundle), this error shows:
                      “MyApp” is damaged and can’t be opened. You should move it to the Trash.

                      artwawA Offline
                      artwawA Offline
                      artwaw
                      wrote on last edited by
                      #10

                      @why-it-dont-work Does it run ok when you run it from Qt Creator?

                      For more information please re-read.

                      Kind Regards,
                      Artur

                      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