Hi, I aml trying to figure out how to get a version string from a Package. The reason is that I would like to automate an About dialog.
Any hints ?
@+Maarten,
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
If you mean one in the
image, then something like
(Store.Registry bundleNamed: 'Glorp') propertyAt: #version would probably help. That requires it to have a version property, but if it doesn't, then the question doesn't necessarily have a unique answer. Finding the version in Store may require being connected to the database, and the same contents can have different version names in different databases.
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert
Dear Maarten,
a image package has a version string with respect to a given database, can be reconciled in one image to several packages with different version strings in different databases, and caches the version(s) of database(s) to which it is reconciled. Separate from this, it may have a #version property. 1) #version is probably not what you want. When we at Cincom build parcels for the distribution, we set a property, #version, in their packages. We also set #version in unparcelled packages in Base VisualWorks. Although generally, our code makes some attempt to preserve a correspondance between a parcel's version string and the #version property of the corresponding package or bundle, you are dependent on whoever maintains the package for the policy with regard to its #version property, or whether it is there at all. There is no guarantee that the value of #version matches the string of the package to whcih it is reconciled in any database to which you have republished a parcel. (It will by default but anyone can set their own version string in the PublishPundleDialog, regardless of what #version says.) 2) If a package is reconciled to a database, the package in the image will have a DatabaseConnectionInformation for that database, and the dbVersion of this object will hold its version string. This is probably what you want, not #version. The relevant accessing methods are designed so you can either get the database connection information for the most recent connected database (whether still connected or not), or supply the symbol of a specific database. Usually this is done by same-name methods just having or lacking a parameter (e.g. PundleModel>>databaseInformation and PundleModel>>databaseInformationFor:), but for historical reasons the methods that get versions differ slightly from this. PundleModel>>traceVersionString supplies the version for that most recent connected database, or the empty string if no such data. PundleModel>>versionStringFor: dbid returns the same for the supplied database symbol, suffixed with = if the image pundle is unchanged or * if it has been. Hope this lets you get the data you need. Yours faithfully Niall Ross >Hi, >I aml trying to figure out how to get a version string from a Package. >The reason is that I would like to automate an About dialog. > >Any hints ? > >@+Maarten, > > > > >------------------------------------------------------------------------ > >_______________________________________________ >vwnc mailing list >[hidden email] >http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Maarten Mostert
Dear Nial, Alan Thank you for the explanations, these solutions both seem to work. (Store.Registry packageNamed: 'Apricot') versions first version gets it correctly from the database and (Store.Registry packageNamed: 'Apricot') versionStringAlternate seems to maintain the last store version even when store is disconnected. I am not n a complexe mutli user environment so this will do for me at the moment. Regards, @+Maarten, Author Said: "Niall Ross" <[hidden email]> | > Dear Maarten, |
Free forum by Nabble | Edit this page |