TobWen
5th July 2004 08:23 UTC
VPatch (same-file-patching)
Hi there,
I want to update an old file ... VPatch is great for this,
but there is a problem ... VPatch works that way:
vpatch::vpatchfile "pathfile.pat" "source.file" "new.file"
So I need to patch the old file (source.file) and create a new file (new.file).
Then I need to delete the old file and rename the new.file to the old filename.
Is that the only way? :-(
Best,
Tobias
Joost Verburg
5th July 2004 13:51 UTC
Because a patch is based on information from the source file, you can't modify that file while patching.
You can however create a simple macro that handles the same-file patching.
TobWen
5th July 2004 16:46 UTC
Because a patch is based on information from the source file, you can't modify that file while patching.
MMh, I can tell you about 50 patcher-tools, which can do that.
They're just writing the new bytes to the source-file.
The problem is, that those patcher-tools can't work silence :-(
You can however create a simple macro that handles the same-file patching.
Could you please give me some hints on ding that?
Or do you mean a macro for my work-around:
1. patch "old file" to "new file"
2. remove "old file"
3. rename "new file" to "old file"
TobWen
7th July 2004 06:07 UTC
Coud you please give me support on the macro, you talked about?
Joost Verburg
7th July 2004 11:41 UTC
I mean a macro that uses a temporary file.
You can copy the same code as you have created to the macro and replace the name of the file by a defined parameter.
TobWen
7th July 2004 11:53 UTC
yeah.
I am really sad, that it doesn't work like "normal" patchers.
Why don't normal patch-tools need a temp. file?
Joost Verburg
7th July 2004 12:27 UTC
They may automatically use a temporary file or keep the file in memory, or they have a different patch system.
While patching VPatch needs the information from the source file.
TobWen
7th July 2004 12:31 UTC
the problem is, my file (to update) is 15mb.
It patches it to a new 15mb file, then I have to delete the old file and rename the new to the old.
That takes a lot of time on old PCs.
Mmh okay ... that's the only solution I think :(
Perhaps I have to program a stand-alone-patcher in C++ and run it via EXEC in silent-mode.
Joost Verburg
7th July 2004 12:33 UTC
The complete C/Delphi source of VPatch is available, so you can have a look at it if you want.