Solved

How to write Patch Program?

Posted on 2000-03-09
18
372 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

763 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