PDA

View Full Version : OnFileProcessed ResultCode problem.


Steven Carr
06-29-2005, 01:00 AM
I have created a patch for numerious old versions.

On patching the current-1 version i have a file which matches the current version (which i have verified via MD5)

On the processing of the global function g_OnFileProcessed i get the ResultCode = 4 passed.

I was expecting that an error code of 4 was for files which did not have a "matching target" - which is not really the case here.

Is it possible to get a new ResultCode for "File skipped. Target already up to date."

csd214
07-06-2005, 04:03 AM
I appreciate your posts, Steven; they help me feeling "the soul" in VP20. So far I have only designed one single patch executable; I still have a lot to learn.

At this occasion I'm not sure whether I understand your scenario. Do you mean that the %TargetVersion% file already is copied manually into the folder? In that case you will have return code 4 because the file is not matching the file belonging to the identified %InstalledVersion%. If you want to have the message "File skipped. Target already up to date", I think you have to add your own code to read the file's attributes and compare them with the %TargetVersion% file attribute. VP20 does not know the attributes because there (normally) are only dif files included in the exe.

BTW, I think it is wise to keep track of return codes > 3. If this happens, the screen "Finished Successfully" shouldn't be displayed. A "Finished Failure" screen might be better (with a list of the skipped files and with recommendation to perform a full install.)

Steven Carr
07-06-2005, 04:47 AM
Ok, imagine a hyperthetical situation (but a real one).

You have an old version you are updating to new version. You do this using TrueUpdate2 and VisualPatch2.

You have set it up so that TrueUpdate downloads the Visual patch file to do the actual patching.

Now you have two folders containing the two versions.

Now as the files in this system need to be all from the same release we use the hidden global function g_OnFileProcessed - this function gets called with a ResultCode = 4 if the file is skipped. Ok, so we can backup the update if the ResultCode = 4.

This all works fine, but imagine in the new release there is also an update to say TrueUpdate. So what happens is that the TrueUpdate (from the old version) detects that is is updated. It then updates itself before processing the rest of the update.

This means that by the time VP2 gets to try and update TrueUpdate files, they are already updated. When the g_OnFileProcessed gets called you get the ResultCode = 4.

It would be great if the result code could be different for files which are skipped because they are already up to date so they can be processed differently.

(Note I have used thr true update case as an example, but the actual case i came across was a different file)

Brett
07-06-2005, 09:19 AM
We will look into this for the next release.