The version number that you install when creating the package (in the PackageMaker project) is the version of the installer, not the version of your .app file. This is necessary so that another installer can see if it is reducing the current installation or not. The installer will never look at the content that he installs on the system.
To install the version of your .app-Bundle, right-click your .app file and select "Show Package Contents" in the menu that appears. Open the "Content" folder, there you will find a file called "Info.plist". You must edit this file and set your version information for it. You can do this using the property list editor (included with Apple Developer Tools ) or another tool like BBEdit , for example.
To read from your .plist in your application, you need a special library. I recommend the Daniel Dreibrodt Java Property Properties Library (more information on the .plist-Format format can be found in this blog post ).
In general, you should install version information for your application package, anyway you use it for update purposes or not. If it is not installed, the user does not have the opportunity to obtain information about the version that he installed without running your software.
What you need is not a version of your .pkg file, you need a version of your .app-Bundle. In any case, the version of your .pkg file is handled in the same way as your .app file. There is also Info.plist where you will find information. It can also be analyzed using the same library.
source share