Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 1st, 2004, 11:37 AM
HappyDev HappyDev is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 27 HappyDev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 16 m 24 sec
Reputation Power: 0
Making a patcher/auto updater

Hello, my friend told me about this site and it looks like by far the best delphi community I've ever found! I would like to make my program able to update itself, and was thinking it would go like this: 1.The program downloads a text file from my website that looks like this "fileName <space> checksum". 2.The program would deliminate by space into a TStringList. 3.The program would check if the file even exists, then if it does exist, compare it to its checksum. 4.If it does not exist or its checksum does not match, its file name would be added to another TStringList (of things to download). These 4 steps would repeat until EOF, then it would download everything that didn't match or did not exist. First off, can anyone see anyway to improve my method or anything wrong with it? Second off, does anyone know a way to get a checksum for a file?

Reply With Quote
  #2  
Old July 1st, 2004, 06:22 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,390 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 1 Day 22 h 32 m 40 sec
Reputation Power: 4080
See http://www.torry.net/pages.php?id=251 for some checksum components. Seems that TFileCheckSumComp even does a reinstall, if the checksum doesn't match .

Actually, these components may be more useful to you:
http://www.torry.net/pages.php?id=56

Note that some of them are free.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Reply With Quote
  #3  
Old July 1st, 2004, 06:58 PM
HappyDev HappyDev is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 27 HappyDev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 16 m 24 sec
Reputation Power: 0
I think using FileSize might be best, I read something on it and it declared the variable as "File of Word". I've only used TextFile's before, but for potentially large files would FIle of Word be best? And would you guys agree FileSize is better than checksums? I don't want to bog down their comp while its updating.

Reply With Quote
  #4  
Old July 1st, 2004, 07:03 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,390 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 1 Day 22 h 32 m 40 sec
Reputation Power: 4080
Dunno really. Depends on the situation. I would think Checksums are better because they can handle it if there are bit corruption errors. It doesn't take that long to compute checksums by the way.

Reply With Quote
  #5  
Old July 1st, 2004, 07:21 PM
HappyDev HappyDev is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 27 HappyDev User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 16 m 24 sec
Reputation Power: 0
can't seem to find any good components on the site ya gave me, the one you recommended didn't seem like it'd work since I'm not using installshield. But, does this code seem good? It works extremely fast, and it gives the same checksum for the same file twice (always a plus ) but can anyone see anything wrong with it?
Code:
function GetCheckSum(FileName: string): DWORD; 
var 
  F: file of DWORD; 
  P: Pointer; 
  Fsize: DWORD; 
  Buffer: array [0..500] of DWORD; 
begin 
  FileMode := 0; 
  AssignFile(F, FileName); 
  Reset(F); 
  Seek(F, FileSize(F) div 2); 
  Fsize := FileSize(F) - 1 - FilePos(F); 
  if Fsize > 500 then Fsize := 500; 
  BlockRead(F, Buffer, Fsize); 
  Close(F); 
  P := @Buffer; 
  asm 
     xor eax, eax 
     xor ecx, ecx 
     mov edi , p 
     @again: 
       add eax, [edi + 4*ecx] 
       inc ecx 
       cmp ecx, fsize 
     jl @again 
     mov @result, eax 
   end; 
end; 

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Making a patcher/auto updater

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap