Jump to content
Ketarin forum

Question about version numbers


MadDog
 Share

Recommended Posts

Hi,

 

just wondering about the proper way to get version numbers. I've a number of downloads where the version number on the webpage is seperated with a period, but isn't in the filename.

 

Example:

 

Realtek High Definition Audio for Vista (uploaded to the database)

 

The downloadfile is ftp://61.56.69.18/pc/audio/Vista_R213.exe

 

The version number on the website is 2.13

 

I put "2" in variable v1 (startsearch "Realtek High Definition Audio Codecs for Windows Vista ", endsearch ".")

And I put "13" in variable v2. (startsearch "Realtek High Definition Audio Codecs for Windows Vista 2.", endsearch "<")

 

The downloadurl is: ftp://61.56.69.18/pc/audio/Vista_R{v1}{v2}.exe

 

It works, but will of course stop working if the major version number (2) changes, as it is hardcoded in the search. I'm wondering if anyone knows a better download/search definition to get such downloads.

 

(The solution of all problems would be of course to use previous variables in start/end search, but this is probably way too complicated to implement.)

 

Oh, btw: Ketarin rules! Probably the best freeware tool I found in 2008. :)

Link to comment
Share on other sites

Thanks for the nice comment! :)

 

Regarding the version: In your case, you could try scraping it using regular expressions instead of start/end. Another approch is to provide a functionality for string replacement within variables, I'd just need to find some nice syntax.

Link to comment
Share on other sites

Hi,

 

thanks for the responses.

 

I'm afraid I'm too dumb for regular expressions. :/ It's too complicated for me.

 

But thanks for the nice and simple approach!

 

 

> Ops, didn't I post a link!?

 

I was just trying out the new features with 0.9.9.18, but couldn't get it working. While writing a "duh? It doesn't work" reply, you posted the new version. :)

 

 

I changed the URLs and these two work fine:

 

version = 2.13

 

ftp://66.104.77.130/pc/audio/WDM_R{version:replace:.:}.exe

ftp://61.56.69.18/pc/audio/Vista_R{version:replace:.:}.exe

Download URL: ftp://61.56.69.18/pc/audio/Vista_R213.exe

 

 

 

So, thanks. This modification helps a lot. :cool:

 

 

For suggestions, adding

 

{varname:trimleft:_}

{varname:trimright:_}

 

would be great. But not specifing a count length, but a character. Because then even quite complicated URLs could be generated and would still work if the major/minor version changes. (Like version 10.01)

 

Example:

 

Version = 9.0

 

{version:trimleft:.} = 9

{version:trimright:.} = 0

 

The URL for Acrobat Reader (German) would be

 

....://ardownload.adobe.com/pub/adobe/reader/win/{version:trimleft:.}.x/{version}/deu/AdbeRdr{version:replace:.:}_de_DE.exe

 

( ....://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.0/deu/AdbeRdr90_de_DE.exe )

Edited by MadDog
Link to comment
Share on other sites

While doing another test, I might have found a bug, or something.

 

 

I've used the new variable:replace command in following profiles (uploaded to the database):

 

Realtek High Definition Audio for 2K/XP/03

Realtek High Definition Audio for Vista

Opera (International)

 

Trying to update the Realtek profiles, if the file already exists, results in an error, the progress bar keeps looping or it downloads again.

 

Trying to update Opera works always. If the file exists, it won't update. No error.

 

I'm wondering if there's a bug in Ketarin, or if the Realtek servers are just stupid?

Edited by MadDog
Link to comment
Share on other sites

I'll add trimstart and trimend, both with and without parameters.

 

Thanks again for implementing functions. Seeing your regex example from some other thread, I learned most can be done with various regexpress variables, but functions are still nice to use.

 

I'm wondering how to use Trimstart/Trimend. I can't figure it out. Could you give me an example, please?

 

 

Here's another idea for a function: {variablename:split:argument1:argument2}

 

Example:

Version = 9.10.151.156

{version:split:.:1} = 9

{version:split:.:3} = 151

Link to comment
Share on other sites

I downloaded the 0.9.9.20 version from the other thread and gave it a try. Thanks for implementing this function. I was afraid "split" would be a too complicated function, but now it's there. This really solves all issues someone can have with version numbers. Now, where's the Donate button? :D

 

(edit: moved my test examples to tutorial...)

Edited by MadDog
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.