October 14, 2011

Ketan Shah Ketan Shah
Lab Rat
59 posts

Mac Application version help

 

Hi,
I am making an application for Mac OS 10.6.2 using Qt 4.7.
How can I set my application’s version and organisation name using Qt ?

8 replies

October 14, 2011

Volker Volker
Ant Farmer
5331 posts

Have a look at this wiki article [developer.qt.nokia.com]. Just ignore the menubar stuff and leave out the LSUIElement entry, but change com.yourcompany to the desired value.

For the version you need to add a CFBundleShortVersionString and CFBundleVersion entries.

October 14, 2011

Ketan Shah Ketan Shah
Lab Rat
59 posts

I have made changes in the info.plist file, but its still not displaying the version number, when I right the MyApp.app application and check for Get Info. Below is my Info.plist file code,

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <plist version="1.0">
  4. <dict>
  5.     <!-- start of standard entries -->
  6.     <key>CFBundleIconFile</key>
  7.     <string>my.icns</string>
  8.     <key>CFBundlePackageType</key>
  9.     <string>APPL</string>
  10.     <key>CFBundleGetInfoString</key>
  11.     <string>Created by Qt/QMake</string>
  12.     <key>CFBundleSignature</key>
  13.     <string>????</string>
  14.     <key>CFBundleVersion</key>
  15.     <string>1.0</string>
  16.     <key>CFBundleShortVersionString</key>
  17.     <string>1.0</string>
  18.     <key>CFBundleExecutable</key>
  19.     <string>MyApp</string>
  20.     <key>CFBundleIdentifier</key>
  21.     <string>com.yourcompany.MyApp</string>
  22.     <key>NOTE</key>
  23.     <string>This file was generated by Qt/QMake.</string>
  24. </dict>
  25. </plist>

What changes I should make ?

October 14, 2011

Volker Volker
Ant Farmer
5331 posts

Where did you do the changes? As stated in the wiki article, you must tell qmake via the QMAKE_INFO_PLIST variable that you have a customized Info.plist file and you must delete the application bundle, as Info.plist is not copied automatically over an existing one!

I described the changes you should do in my first response already:

…change com.yourcompany to the desired value.

I’m not aware of a separate organization value for the property file. Make sure that the CFBundleIdentifier contains your organization doman and the app name!

You can get an overview of the keys at Apple’s web site:
http://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

October 14, 2011

Ketan Shah Ketan Shah
Lab Rat
59 posts

Ya I have done that changes also, I have added the path of customised Info.plist in MyApp.pro, have also deleted the bundle and recompiled, but than too its not showing when I right click MyApp.app and check Get Info.

October 14, 2011

Volker Volker
Ant Farmer
5331 posts

So what’s in the Info.plist file inside the application bundle? Does that reflect the changes you made?

October 14, 2011

Ketan Shah Ketan Shah
Lab Rat
59 posts

Ya it shows the changes, and thanks, now the version problem is solved, I have to use CFBundleShortVersionString.
But do you know how can I show Copyright and Organisation’s name ?

October 14, 2011

Volker Volker
Ant Farmer
5331 posts

You can use the NSHumanReadableCopyright key for this.

October 14, 2011

Ketan Shah Ketan Shah
Lab Rat
59 posts

Thanks a lot, it worked.

 
  ‹‹ Mac startup Help      QMDIArea, addSubWindow steals the focus from other applications ››

You must log in to post a reply. Not a member yet? Register here!