• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

How to write Patch Program?

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
rarigo
Asked:
rarigo
  • 6
  • 5
  • 3
  • +4
1 Solution
 
intheCommented:
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
 
rarigoAuthor Commented:
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
 
titzCommented:
listening
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Alisher_NCommented:

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
 
yk030299Commented:
listen.
0
 
rarigoAuthor Commented:
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
 
mike_tippingCommented:
listening
0
 
Alisher_NCommented:
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
 
rarigoAuthor Commented:
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
 
titzCommented:
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
 
Alisher_NCommented:
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
 
rarigoAuthor Commented:
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
 
titzCommented:
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
 
Alisher_NCommented:
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
 
rarigoAuthor Commented:
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
 
rarigoAuthor Commented:
Oh gosh. I accepted the wrong comment for an answer.


     
0
 
Alisher_NCommented:
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
 
darinwCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 6
  • 5
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now