Archive: Deleting changed files in Vista


Deleting changed files in Vista
We're installing some files into \ProgramData that are subsequently changed by the application. The installer runs as admin, hence the files are owned by Administrator.

When we run the uninstaller, the directory entry for these files is not removed. No error the Delete instruction.

Files that were not modified are deleted ok. Files that were not installed but were subsequently created by the app are deleted ok. It's only the data files that are installed, then modified, that are a problem.

Windows Explorer doesn't see the files, or the install directory, for that matter. But my cheap old explorer replacement finds them alright, as does Windows GetFileAttributes. If you try to open the file, you get a NOT FOUND error, so it seems it's just a directory entry problem.

Rebooting, even if you specify Delete /REBOOT, does not do the trick.

Anyone have a clue as to what is going on? Thanks!


Do not install to ProgramData yourself but use API's of OS to get the folder to use. Because of Vista's virtualization the files will land up in the ProgramData then.

Best is first learn about Vista and Virtualization for backwards compatibility.