Solved

How to write Patch Program?

Posted on 2000-03-09
18
370 Views
Last Modified: 2010-04-04
Hi Guys,

    Right now I'm envolved in a project to write a Patch Maker Program so I need some help about extracting the differences between the two files.
    To compare all bytes from OldFile against NewFile is not enough. I think that if you've had some experiences with this you know what i'm talking about.
     

Sinceramente,
Reginaldo



 



0
Comment
Question by:rarigo
  • 6
  • 5
  • 3
  • +4
18 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 2601640
is this too patch your own software ?

if this is for updating your programs i would suggest using dlls,its much easier way to do it ..
0
 

Author Comment

by:rarigo
ID: 2601678
Hi inthe,

    Yes.  This company keep changing its software and send it to its clients all over the country so, at least a big change occurs, a patch would be easier.
   

Reginaldo
     

0
 
LVL 1

Expert Comment

by:titz
ID: 2602076
listening
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 3

Expert Comment

by:Alisher_N
ID: 2602667

bonjurno, Reginaldo,  interesting task ;-)

most difficult part to make 'smart' compare...
you can have several options for every block of data (compare new to old)
1) block the same as old
2) block changed, but size the same
3) block changed and have different size
4) block deleted
5) new block inserted
6) ?

simple approach to make blocks of fixed size (i.e. 1024) but best would be to find  each block basing on 'compare&analyze'....

0
 
LVL 1

Expert Comment

by:yk030299
ID: 2603269
listen.
0
 

Author Comment

by:rarigo
ID: 2604143
Ola Alisher,

     Sounds like you got the spirit of this task.  Yeah I'm having trouble doing all this. The biggest problems are the inserted and deleted bytes.
     I'll keep trying as always.
     Hoping for any help i can get.

Até logo,
Reginaldo
0
 

Expert Comment

by:mike_tipping
ID: 2604350
listening
0
 
LVL 3

Expert Comment

by:Alisher_N
ID: 2604428
Reginaldo, what is the nature of files ? is it EXE only or whole package with some extra stuff ? is there a possibility of re-mixing different parts of old version or just add/edit/delete some block will happen ?
for example if it is EXE, IMHO unlikely that different procedures will be remixed like

OLD           NEW
-----       ------
proc1        proc2
proc2        proc3
proc3        proc1

this is (let's call it case 1) not typical and probably you will have some thing like case 2:

OLD           NEW
------       -------
proc1         proc1  {same}
proc2         proc2  {size changed}
proc3         -      {removed}
              proc4  {new added}

so, case 2 IMHO easier to analyze....


0
 

Author Comment

by:rarigo
ID: 2604547
Alisher:
     What we're gonna do is to send to all our clients a little program able to modify the the EXE file ( the main program )  based on a diff file.
     Let me make it clear. Our clients use the program AAA.EXE which is often changed for a lot of reason. Our goal is this: every time a change occurs we compile the new one and extract the difference between them and send this 'diff file' to our clients, they run the BBB.EXE and the program AAA.EXE is updated according to the diff file.
   
    That's it.

    Reginaldo


     
0
 
LVL 1

Expert Comment

by:titz
ID: 2606119
hi rarigo,

i think you are doing a lot of work which is not necessary.

Why do you not send an update to your customers ?
i think, to remember and to care for the changed bytes is the most
difficult solution.
why can't you send your customers the new compiled AAA.EXE ??
or some new compiled DLLs ??
this is the cleanest solution. and nothing can go wrong. if one correction was forgotten to install at the customer : what to do with your solution? in my solution you send them only the actual AAA.EXE and all is ok.
and if the exe is large: part it in some DLLs and use 'zip' or some other packer.

cheers
titz


0
 
LVL 3

Expert Comment

by:Alisher_N
ID: 2611786
to titz:

he can make EXE versions and compare in every update to original version... or make .DIF files for every version...

to all & reginaldo:

I think I have some ideas that would work, but this needs to be explained in details and also needs some process flow diagrams ;-) and pictures to explain ;-))... so I need more time to draw all of this and make an HTML presentation ;-), stay tuned if you interested... later on...

0
 

Author Comment

by:rarigo
ID: 2611975
Alisher N: of course, I'm interested and I'll stay tuned but i'm working too. I hope it doesn't be made too late.

Titz: We have thousands of clients all over the country and the size of our AAA.EXE is 8 MB. So it'd be grateful if we could just send a 100 k file instead.  Don't you think this too?



Sinceramente,
Reginaldo


0
 
LVL 1

Accepted Solution

by:
titz earned 200 total points
ID: 2613298
hi rarigo,

i think the problems too large and i would do it the way i described above (smaller EXE, DLLS) and then pack it. then you will be about 1 MB (that is usually for us and our updates).  
but it is your project.
i will stay listening.

cheers
titz
0
 
LVL 3

Expert Comment

by:Alisher_N
ID: 2613578
ok, everybody!
I have some progress, please read my suggestion here:
http://www.bcc.com.uz/~alisher/patch.html
be patient if it is slow! ;-)

please comment or blame here ;-)
0
 

Author Comment

by:rarigo
ID: 2616142
Hi Alisher N,
 
     Thanks for your time and patience. I quite understood your point mainly because I was going to the very same direction except that I'm working on a byte-by-byte base instead. The idea is very clear in mind but there's a lot of pointers to take care of and it somehow get too confused so I kind of ( postponed ?) the project for now. There's more important things to do.
    Thanks again.



Até mais,
Reginaldo

0
 

Author Comment

by:rarigo
ID: 2616452
Oh gosh. I accepted the wrong comment for an answer.


     
0
 
LVL 3

Expert Comment

by:Alisher_N
ID: 2616733
of course there are minor problems during implementation, but I think it is all solvable, nothing impossible... At least I have clean picture how all can be done in my head ;-)

Probably I will need the same thing in future, so I will write it by myself, but later - lack of time is a terrible thing ;-)

ps. your 'joke' with a points was encouraging ;-)
0
 
LVL 3

Expert Comment

by:darinw
ID: 2617637
Alisher_N, please see your question in this topic area:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10310927 

darinw
Customer Service
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 64
Dev Express grid collapse 2 45
select query - oracle 16 100
JAudiorecorder record freezing the app 29 67
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question