Solved

How to write Patch Program?

Posted on 2000-03-09
18
366 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
Comment Utility
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
Comment Utility
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
Comment Utility
listening
0
 
LVL 3

Expert Comment

by:Alisher_N
Comment Utility

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
Comment Utility
listen.
0
 

Author Comment

by:rarigo
Comment Utility
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
Comment Utility
listening
0
 
LVL 3

Expert Comment

by:Alisher_N
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:titz
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Oh gosh. I accepted the wrong comment for an answer.


     
0
 
LVL 3

Expert Comment

by:Alisher_N
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now