Another Auto Update Script

By sizzlemctwizzle Last update Feb 11, 2011 — Installed 15,480 times.

@require Instructions

in
Subscribe to @require Instructions 11 posts, 3 voices



sizzlemctwizzle Script's Author
FirefoxMacintosh

The @require instructions have now been posted in this guide.

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Update
Just implement a completely new version comparison method. Don't worry, it is completely backwards compatible with my older version scheme(which just stripped out periods), but it is now way more flexible. You no longer have to stop at single digits between periods. My updater would evaluate all these as true:

2.10.0 < 21.0.0
1.3 < 1.29
7 > 6.10.2

So what good is all this? Well now your version numbers can actually mean something. Rather than arbitrarily increasing the number, you can use your version number to symbolically denote how much is changed in an update. The first number could mean major version(like you basically rewrote the entire script). The second could be minor version(just general improvements), and the third could denote a tweak.

 
JoeSimmons Scriptwright
FirefoxWindows
sizzlemctwizzle wrote:
My updater would evaluate all these as true:
sizzlemctwizzle wrote:
1.3 < 1.29
*confused* Isn't it more?
 
sizzlemctwizzle Script's Author
FirefoxMacintosh

JoeSimmons wrote:
*confused* Isn't it more?
That's what I thought for awhile, but your thinking that they're floats when they're not. The first number represents the major version(one in this case). The second number is a minor version number and remember that 3 > 29 3 < 29. If we weren't using the period, which just happens to be the decimal point, you wouldn't be confused. Consider which of these is larger:
1.34.5, 1.5.10

My updater evaluates: 1.34.5 > 1.5.10

 
Marti Scriptwright
FirefoxX11

sizzlemctwizzle wrote:
The second number is a minor version number and remember that 3 > 29.
This is only true if you are padding zeroes to the right on the 3. (e.g. 30 > 29 )
sizzlemctwizzle wrote:
My updater evaluates: 1.34.5 > 1.5.10
And if you apply the same rule of padding zeroes to the right this is not true. (e.g. 34 > 50 evaluates to false)

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Marti wrote:
This is only true if you are padding zeroes to the right on the 3
No you can't pad zeros to the right(but you can pad to the left).

 
Marti Scriptwright
FirefoxX11

sizzlemctwizzle wrote:
No you can't pad zeros to the right(but you can pad to the left).
Sure you can ;) Point being is that symmetry with this portion of the updater isn't congruent... even if it works (which I haven't confirmed in depth yet). Padding is more of a logical thing then a physical thing... it's up to the interpretation of the developer. This is why I currently choose not to ever rely upon @version and I'm grateful you have an override. :) In my book 1.3.0 < 1.29.0 == true. It's more important for uso - installWith because a user might run into this case (especially on my scripts as I treat each item as a whole, individual number)

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Marti wrote:
1.3.0 < 1.29.0 == true
That was a typo in my post(3 is less than 29). My updater does evaluate the quoted statement as true. My updater doesn't pad zeroes to the right. The symmetry in the way my updater parses version numbers is congruent. Sorry for the confusion.

 
Marti Scriptwright
FirefoxX11

sizzlemctwizzle wrote:
typo
ahhh done a few of those myself... thanks for the clarification. :) Some users don't use major.minor.build too so I'm grateful that you have an override... useful with uso - installWith.

 
sizzlemctwizzle Script's Author
FirefoxMacintosh

Marti wrote:
Some users don't use major.minor.build too so I'm grateful that you have an override...
I also fallback to @uso:version when @version isn't present. Using the @uso:verison for installWith makes more sense because its targeted at users, whereas a scriptwright might want to keep control of the version number.

 
Marti Scriptwright
FirefoxX11

sizzlemctwizzle wrote:
I also fallback to @uso:version when @version isn't present.
Yup... that's what I pm'd and canceled you about earlier because I didn't know that... but I figured it out eventually.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel