views:

250

answers:

0

I have an older version of a program which writes settings into program files off of the installation directory. I am looking to migrate those settings to the appdata directory.

There are some problems associated with this. Lets focus on the most complicated user: A user who had the program installed on XP, and then upgraded to Vista, with UAC on. They will have settings both within the program files directory, as well as settings in the virtualstore. A few options with some reasons why I feel they are not proper:

1) Don't upgrade those settings

Failure: Not an option

2) Do an elevated move operation of the settings directory

Failure: Being elevated, it will miss anything that was written to virtual store. So the user will basically have a snapshot of what they had in XP and it would fail altogether for a user who started on Vista.

3) Do a move of just the virtual store directory

Failure: This will lose any files that were created in XP days, but not touched yet in vista

4) Create a stub program without a manifest to do the move, this way allowing it to see into virtual store

Failure: It does not have access to move any files that are solely within the program files (which were not written while in vista).

Potential solutions

5) Create a stub program without a manifest to do the copy

Failure: Wastes disk space, some users could have up to a gig worth of settings

6) Loop through both the virtual store directory and the program files settings directories. The files moved would be all of the items in virtual store, and any files in program files which are not in virtual store.

Failure: Complicated, some questions..

Question: Is it possible to have a virtual store which is in a different location?

Question: Does the algorithm always choose virtual store files over actual directory, no matter what? Or does it depend on modified times, etc?

Is there a nice #7 that I am missing? Or should i just focus on either #5 or #6? Does anyone know of anywhere that has #6 already written (or an API)?

Thanks!