Moving Application Files on Update

Hi,

I'm just wondering what's the best way to cope with moving some files that are already on the user's machine?

For instance if...* app (v1.0) is installed into C:\Program Files\MyApp\* in this folder I currently have some read-only .dat files alongside the executables and DLLs (e.g. stuff.dat, things.dat)* most (not all) of these dat files will be archived and replaced with new ones* I want to move the old .dat files into a new folder (C:\Program Files\MyApp\OldData\)* the new .dat files will go into the app root folder (as before)

If I just add the old .dat files to the sub-folder and then create an update, they will get duplicated (remaining in their old place too).

I could also try to handle this in my program (do a move upon program start), but it would still inflate the size of the update because wyUpdate would think they were new files.

My other consideration is... whether I do the process in wyUpdate or my program, what happens if this particular update is skipped by wyUpdate in the future because a newer version is released? I believe you can execute scripts and things in wyUpdate but this process needs to only ever be performed once, when the user updates from v1.0 to any newer version (v2.0+) but they should not be performed when updating for example from v2.0 to v2.1 etc. If the user updates from v1.0 to v2.5 and my 'archiving process' was only implemented in v2.0 then they would skip it.

Any ideas?

Adam

Hey Adam,

I could also try to handle this in my program (do a move upon program start), but it would still inflate the size of the update because wyUpdate would think they were new files.

Honestly, best way to handle this is to leave the files in place, build the update patches as is (that is, assuming the old files will stay where they are), and execute a small batch file as part of your update that will copy the old *.dat files to a folder you specify.

If the user updates from v1.0 to v2.5 and my 'archiving process' was only implemented in v2.0 then they would skip it.

wyBuild currently (as of 2.6.x) implements only direct patching (that is, a patch is made for all old version to the latest version). We're adding the option of incremental patching (wyUpdate will install all the intermediate versions to get to the latest version) in wyBuild 2.8.

With direct-patching, any action you want to take that's mandatory must be taken with every new version. So add the batch file to every new version and set it to execute before the update take place.

In wyBuild 2.8 onward, if you select incremental patching, you'll be able to set it to execute once for that version and all users will inevitably execute that file as they update (because wyUpdate will download & install all intermediate patches).