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. Osx build showing "Unknown Version" in Applications folder

Osx build showing "Unknown Version" in Applications folder

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 2.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.
  • M Offline
    M Offline
    msmithers
    wrote on last edited by msmithers
    #1

    When I build for OSX and copy the app to the Applications folder, when I search for the application using the mac search, the app name and icon appear but under the app name it says "Unknown version."

    In the .pro file, the version parameter is set as
    VERSION = 1.2.3
    which is supposedly correct for OSX. Any ideas what is going wrong?

    (When I build for windows, VERSION = 1.2.3.4, and this shows up correctly in the .exe properties.)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      msmithers
      wrote on last edited by
      #2

      BTW Manually adding the following to the plist file doesn't seen to help.

          <key>CFBundleVersion</key>
      <string>1.20.1</string>
          <key>CFBundleShortVersionString</key>
          <string>1.20.1</string>
      
      1 Reply Last reply
      0
      • M Offline
        M Offline
        mpergand
        wrote on last edited by mpergand
        #3

        It should work
        Are you sure that you select the right app in the search result, as there're several copies of your app (build/release/app folder).
        If you ask for infos with a right click on the app, does it show the good version ?

        In the .pro file, for OSX, i"m adding the following:

        macx{
        
         QMAKE_INFO_PLIST   =	Mac/Info.plist
          ICON        =   Mac/AppIcon.icns
        }
        

        Now the Info.plist file will be automaticaly copied in the bundle folder when building the app.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          msmithers
          wrote on last edited by
          #4

          Hi mpergand,

          Yes, in the search results I'm looking at the app that's in the Applications folder, and not the other copies in various build directories.

          Yes, I switched to a manual plist with lines just like you show in your macx{} .pro code. I've also verified that the plist, inside the app in the Application folder, is the same as the plist in the build directory, and verified that it contains CFBundleVersion and CFBundleShortVersionString.

          I had to switch to a manual plist because the build process wouldn't add CFBundleIdentifier and CFBundleTypeExtensions.

          My full plist is as follows (with the file extension, company name and app name changed for this message)

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
          <plist version="1.0">
          <dict>
          <key>NSPrincipalClass</key>
          <string>NSApplication</string>
          <key>CFBundleTypeExtensions</key>
          <array>
          <string>fff</string>
          </array>
          <key>CFBundleIconFile</key>
          <string>icon.icns</string>
          <key>CFBundlePackageType</key>
          <string>APPL</string>
          <key>CFBundleShortVersionString</key>
          <string>1.20.1</string>
          <key>CFBundleVersion</key>
          <string>1.20.1</string>
          <key>CFBundleGetInfoString</key>
          <string>Created by Qt/QMake</string>
          <key>CFBundleSignature</key>
          <string>????</string>
          <key>CFBundleExecutable</key>
          <string>My App</string>
          <key>CFBundleIdentifier</key>
          <string>My Company.My App</string>
          <key>NOTE</key>
          <string>This file was generated by Qt/QMake.</string>
          </dict>
          </plist>

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mpergand
            wrote on last edited by
            #5

            Hi msmithers,

            I have a try with one of my app:

            	<key>CFBundleShortVersionString</key>
            	<string>1.0 beta 1</string>
            	<key>CFBundleSignature</key>
            	<string>????</string>
            	<key>CFBundleVersion</key>
            	<string>1.0</string>
            

            I notice that in the Infos Dialog from the Finder shows 1.0 beta 1 (CFBundleShortVersionString)
            and the search bar shows 1.0 (CFBundleVersion)
            I notice also that a clean/rebuild is necessary for the new info.plist to be copied to the bundle (or to put the app bundle to the trash)

            M 1 Reply Last reply
            0
            • M mpergand

              Hi msmithers,

              I have a try with one of my app:

              	<key>CFBundleShortVersionString</key>
              	<string>1.0 beta 1</string>
              	<key>CFBundleSignature</key>
              	<string>????</string>
              	<key>CFBundleVersion</key>
              	<string>1.0</string>
              

              I notice that in the Infos Dialog from the Finder shows 1.0 beta 1 (CFBundleShortVersionString)
              and the search bar shows 1.0 (CFBundleVersion)
              I notice also that a clean/rebuild is necessary for the new info.plist to be copied to the bundle (or to put the app bundle to the trash)

              M Offline
              M Offline
              msmithers
              wrote on last edited by msmithers
              #6

              Hi @mpergand,

              Yep, I'm always trashing the build directory and confirming the plist file in the package contents after building and copying to the Applications folder.

              I added a few extra fields like
              CFBundleInfoDictionaryVersion
              CFBundleDisplayName
              CFBundleName
              NSHumanReadableCopyright
              CFBundleDevelopmentRegion
              and changed CFBundleGetInfoString to something more relevant (other than created by QT).

              "Get Info" on the app is now showing the correct version and Copyright, but the MacOS search still shows "Unknown Version." Maybe the search takes some time to update??

              Thanks,

              1 Reply Last reply
              0
              • M Offline
                M Offline
                msmithers
                wrote on last edited by
                #7

                After leaving the computer overnight, the MacOS search updated and now shows the version number.

                In short, QT won't generate a complete info.plist file so I have to make my own and the build process copies it into the app package.

                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