Board index » jbuilder » Using version strings?

Using version strings?


2005-01-27 03:56:56 AM
jbuilder15
Back when I was programming in C we would simply put a string in the
code such as "VERSION$: 1.0.0"
Then we could simply do a search the bin file for that and handle
version numbers.
Now my question I seen the post prior to this one where there are
programs out there that do this for you.
WHY?
But more importantly i'm writing a server client program, which I attend
to have the client check check all programs create a list of version
number which it will then compare to the server list of version is one
is lower it will request that program and download it and put it in the
system. Which I was simply planning on just having the "VERSION$: 1.0.0"
string in each program. Both the server would check a directory (Client)
to make its list on start up and the client would do the same on its
startup. Seems real simple to me. Is there a reason this is not
practical? (I do know that java start supports some kind of version
checking, but don't mind righting the code myself (for learning purposes))
Also, is there a draw back to using "VERSION:$" and DATE$: ect for this.
thanks
 
 

Re:Using version strings?

Joe Vasher wrote:
Quote
Back when I was programming in C we would simply put a string in the
code such as "VERSION$: 1.0.0"

Then we could simply do a search the bin file for that and handle
version numbers.

Now my question I seen the post prior to this one where there are
programs out there that do this for you.

WHY?

There is no easy way to do what you suggest in Java; searching a JAR
file for a specific string is time-consuming and I'm not sure there's a
truly portable way of even finding the JAR file. The approach I would
recommend if you really want to do it yourself would be to put a
version.properties file into the JAR, load it as a resource, and check
a string called "myapplication.version=1.XX" (or whatever). You would
then send that string to the server and if the server responds with a
different version download the update.
Or, if you want the easy way out, there's always Java Web Start:
java.sun.com/docs/books/tutorial/information/javawebstart.html
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html