Forums de Wizou

Pour discuter des programmes de Wizou
It is currently Mon 29 Apr 2024, 16:15

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: WPatch: Source and target file have equal CRCs
PostPosted: Thu 21 Nov 2013, 06:07 
Offline

Joined: Thu 21 Nov 2013, 05:57
Posts: 2
WPatch version: 4.03

I want to patch between two directories, it return an error code 2, one of the file "Source and target file have equal CRCs".

I tried --forcediff and --precise options, and got the same result. and the two files have different md5.

Can you tell me why does this happen? Thanks a lot!


Top
 Profile E-mail  
 
 Post subject: Re: WPactch: Source and target file have equal CRCs
PostPosted: Sat 23 Nov 2013, 23:21 
Offline
Site Admin

Joined: Sat 06 Aug 2005, 16:35
Posts: 719
WGenPatDir.exe establish the differences between to directory trees.
If a file exist with at the same place with the same name in both trees but differ in content, it will call WGenPat.exe to establish the binary block used to patch the original file to transform it into the destination file.
The error you saw is printed by WGenPat.exe when the two files seem to have identical CRCs (MD5).

If one of the two files is bigger than 20 MB, WGenPatDir will call WGenPat with the /H option (= huge file)
In this case of huge files, the MD5 is computed only on the first 64 KB and the last 64 KB in order to speed up the patch detection process.

Therefore, if the files are bigger than 20 MB and the first 64 KB and last 64 KB are identical, but the data in-between differ,
it is possible that WGenPatDir detect a difference, and WGenPat finds them to be CRC-identical.

In general, big data files often starts or ends with some important information or version numbers which ensure that there will be some differences detected between two version of the file, but apparently, you are facing the opposite case.

Depending on the content of your files, the easiest solution would be to alter a little bit some data within the first or last 64 KB of the target file.
If you really can't, then the solution might be to call WGenPat manually, without using the /H option, and add the patching line manually to your NSI script.

Hope this helps.

_________________
Le site Web de Wizou: http://wizou.fr


Top
 Profile  
 
 Post subject: Re: WPactch: Source and target file have equal CRCs
PostPosted: Mon 25 Nov 2013, 11:33 
Offline

Joined: Thu 21 Nov 2013, 05:57
Posts: 2
Thanks for you reply very much.

I solved this problem by wrapper the WGenPat.exe. I wrote a simple c++ code to launch you WGenPat.exe but filter out /H, and comment out all /HUGE command in the .nsh file. It works very well.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group