You are here

Update script

12 posts / 0 new
Last post
megaman
Offline
Last seen: 4 years 11 months ago
Joined: 2008-01-19 07:46
Update script

I've made a python script for batch updating my applications. Thought I would share it here with you guys, and of course as open source.
I've included configurations for some of the applications I use, to show how it works.
download link

15.2.2008 Update - handle http responses.
21.2.2008 Update - added ability to remove directories, use 'rmdir' for this
25.2.2008 Update - move function changed
26.3.2008 Update - bugfix
20.6.2008 Update - some bugfixes, add ability to traverse directory looking for specified filetypes (e.g. exe and dll in subdirectories, to be used as command arguments)
23.6.2008 Update - add possibility to specify paths of downloaded files separately (for easier maintenance, and cleaner code)
29.6.2008 Update - made delete functions check if path is a dir (one can now list both directories and files for the 'rm' command)
1.8.2008 Update - get_paths function can now return dirs and/or files
17.8.2008 Update - added function to replace string in text files, some small improvements
14.9.2008 Update - Handle version numerically, added option to skip update without timeout if the process is running
28.9.2008 Update - Fix bug introduced in last update (numerical sort) that made it skip update if the version file had not been created yet.
18.10.2008 Update - Can now handle multiline version info. Print summary of updated apps before exit.
1.11.2008 Update - Added version (1.00). Removed some obsolete imports. Otherwise no changes.
2.11.2008 Update - Skip check of running processes and process killing if pywintypes or win32 imports fails. Should now be portable and probably os independent. Note: make sure that no application that is to be updated is running, or you'll get a permission error.
7.11.2008 Update - Handle httplib.BadStatusLine errors. Fix; Accidentally printed import error even after success.
30.11.2008 Added ability to specify which group of the regular expression to use as version text. + some cleanup.
8.1.2009 Print list of failed updates, added ability to set urls for applications in a separate dictionary for easier maintenance.
2.5.2009 Updated to version 1.04 - Added the ability to set a min size when getting file list using the get_paths function (to skip small files in optimizations like upx.
Added 'app_lower' (application name in lower case) as variable available when creating commands.
Minor cleanups.
9.6.2009 Version 1.05 - Handle % in version regular expression results so the matched string can be used as name for downloaded file.
13.8.2009 Version 1.06 - Fixed bug that made it skip update if version file was empty.
Removed use_temp, now uses temp dir if defined.
Removed stripping of .exe etc from regex results, not needed anymore since you can specify which group of the regex is the version.
Some cleanup.

Any comments? Found bugs?

digitxp
digitxp's picture
Offline
Last seen: 12 years 6 months ago
Joined: 2007-11-03 18:33
Doesn't work for me

maybe I need python...

Insert original signature here with Greasemonkey Script.

megaman
Offline
Last seen: 4 years 11 months ago
Joined: 2008-01-19 07:46
You need python and the

You need python and the pywin32 package installed. Personally I use PortablePython.
Comments inside the files should give you an idea of how it works. Only the config file needs to be altered.

Simeon
Simeon's picture
Offline
Last seen: 9 years 5 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Marko is working

on the same thing but as a NSIS-based installer like thing.
I think he is waiting with the release till John gets the paf specs out but the Pre-release I tried worked really well.

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

MarkoMLM
MarkoMLM's picture
Offline
Last seen: 8 years 4 months ago
DeveloperTranslator
Joined: 2006-01-16 04:08
Yes, it's ready ...

... but I'm still waiting for the next suite ans the specs.

But as Simeon said, the update tool is nsis based and works without additional stuff and Wink it works with proxies too Smile

Regards
Marko

[Double post removed by moderator SL]

Paid for Software more or less?
What You need is OSS!

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 6 months ago
Joined: 2006-01-06 21:27
FYI

For your information, the best way to do it is to send the current version to the server and have it check.
i.e. GET /check.php?v=2.3.4&a=1 HTTP/1.1
Response:

upgrade
http://files.example.com/1/Test.paf.exe

"If you're not part of the solution, you're part of the precipitate."

MarkoMLM
MarkoMLM's picture
Offline
Last seen: 8 years 4 months ago
DeveloperTranslator
Joined: 2006-01-16 04:08
Best way?

Hi Ryan,
"...to send the current version to the server" which server do You mean?

At the moment the update tool gets all informations (current version, filename, size, caption and description of the packages from a plain text file on a server).

The update tool will offer several functions more than an simple update check.
You'll be able to use proxies, create personal blacklists (in order to prevent update checks for Apps You don't want. A future version could offer an automatic md5 check for the downloaded packages.

Regards
Marko

Paid for Software more or less?
What You need is OSS!

LOGAN-Portable
LOGAN-Portable's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2007-09-11 12:24
Fantastic

Fantastic news!

Next you gonna tell us you read the rss feed for new releases or distill the information from html pages, release trackers and additional sources. Have user configured alternate servers for non official releases or have each app developer the ability to support an update file, support PAD files, making coffee and doing the dishes...

Okay, maybe not everything Smile

But a great addition (If we ever get the change to actually use it Blum

Thanks man!

MarkoMLM
MarkoMLM's picture
Offline
Last seen: 8 years 4 months ago
DeveloperTranslator
Joined: 2006-01-16 04:08
Coffee port ...

is early beta, only black coffee is supported, no latte machiato or capucino Wink

But the use of costum files/servers is built in (no joke).

I'll finish the help file and if You'll accept that some stuff (depending on the specs and the comming suite) eventually have to be changed again we could start a public test this week.

Regards
Marko

Paid for Software more or less?
What You need is OSS!

Simeon
Simeon's picture
Offline
Last seen: 9 years 5 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
Cool

I think its ready for public testing.
But hey, I remember the times when it only gave you hot water so black coffee is an improvement Wink

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

Jimbo
Offline
Last seen: 4 years 2 months ago
Joined: 2007-12-17 05:43
I hope it's RFC2324 compliant!

Since it would be a shame to not use the standards for it

http://burks.bton.ac.uk/burks/internet/rfcs/rfcs/24/rfc2324.htm

The Hyper Text Coffee Pot Control Protocol - HTCPCP

megaman
Offline
Last seen: 4 years 11 months ago
Joined: 2008-01-19 07:46
Any comments? Found bugs?

Any comments? Found bugs?

Log in or register to post comments