Archive: VPatch (same-file-patching)


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


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.


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"

Coud you please give me support on the macro, you talked about?


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.


yeah.
I am really sad, that it doesn't work like "normal" patchers.

Why don't normal patch-tools need a temp. file?


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.


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.


The complete C/Delphi source of VPatch is available, so you can have a look at it if you want.