Java – get Version of PKG file?

I have a Java application for Mac OS X. I wrote it and made one pkg. Create in PKG, I also gave it a version number Now I need to get the version number of this application in my java code so that I can check for updates when the application runs When I right-click my application file, it does not display the version I entered when creating the package

Do I need to set the version of the app file I created with jar bundler to build PKG???

Please advise me how I can do this

Solution

The version number you set when creating the package (in the packagemaker project) is the version of the installer, not Version of APP file This is required so that other installers can see if he has downgraded the current installation The installer will never see what it is installing on the system

To set Right click the version of APP bundle App file, and then select "show package content" from the displayed menu Open the folder "contents", where you will find a file named "info. Plist" You must edit this file and set the version information for your application there You can do this using the attribute list editor (included in Apple Developer Tools) or other tools such as bbedit

From within the application Plist, you need a special library I recommend Daniel dreibrodt's Java property list Library (for more information about. Xlist format, see this post on my blog)

Generally, you should set the version information of the application package, and you should use it for update purposes anyway If not set, users cannot get information about their installed version without starting the software

What you need is not PKG file version, you need Version of APP bundle Anyway – The version of PKG file is the same as App file is handled in the same way And info Plist, where you can find information It can also be parsed using the same library

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>