Vista Phantom目录 [英] Vista Phantom Directory

查看:69
本文介绍了Vista Phantom目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个程序,安装程序将检查配置文件是否存在,如果存在,则不会复制该文件(假定用户已修改了配置文件并希望保留这些修改).不幸的是,这是一个Vista以前的应用程序,它将配置文件保存在Program Files中.问题是,如果您在重新安装目录时手动清除了该目录,则某些API仍会认为那里存在目录.例如,VB6及其浏览文件"对话框可以看到该文件夹​​,但是资源管理器,cmd shell等无法看到该文件夹​​.覆盖文件仍然会将旧文件留在此处(供某些API使用,但不会留给资源管理器使用),除非浏览文件"对话框中的表单仍然无法删除.

We have a program that the installer checks for the existence of a config file, and if it exists, it doesn't copy that file over (it assumes the user has modified their config file and wants to keep those modifications). Unfortunately, this is a pre-Vista application and it keeps the config file in Program Files. The problem is, if you manually wipe out the directory when it re-installs certain API still thinks that there is a directory there. VB6, for example, and its browse for file dialog sees the folder, however explorer, cmd shell, etc cannot see folder. Writing over the file still leaves the old file there (to some API's, but not to explorer) which cannot be removed except form within the Browse for File dialog.

这些Phantom文件夹发生了什么,我们如何删除该文件,以便所有API都能看到相同的东西?也许与 TxF 或用于搜索的索引器有关,但两者我们使用的安装程序(InnoSetup)和应用程序的某些部分(用VB6编写的部分)正在查看文件的旧版本,其他所有内容都在当前版本中.

What is going on with these Phantom folders, and how do we delete the file so that all API's see the same thing? Maybe it has something to do with TxF, or the indexer for search, but both the installer we use (InnoSetup) and parts of the application (the parts written in VB6) are seeing the old version of the file, and everything else sees the current version.

推荐答案

正如Oskar Duveborn所说,您看到的很有可能是Vista的虚拟化行为.

As Oskar Duveborn said, it's very likely that what you're seeing is Vista's virtualization behaviour.

当计算机启用了用户帐户控制(UAC)时,不允许标准用户和未提升权限的程序写入程序"文件夹. Windows会以静默方式将文件重定向到%AppData%\Local\VirtualStore的相应子文件夹(例如,C:\Users\MyUser\AppData\Local\VirtualStore).

When a machine has User Account Control (UAC) enabled, standard users and non-elevated programs aren't allowed to write to the Programs folder. Windows instead silently redirects files to the appropriate subfolder of %AppData%\Local\VirtualStore (for example, C:\Users\MyUser\AppData\Local\VirtualStore).

如果您在资源管理器中浏览真实文件夹,则会看到兼容性文件"工具栏按钮,您可以使用它来浏览虚拟商店.

If you browse the real folder in Explorer, you'll see the 'Compatibility Files' toolbar button, which you can use to browse the virtual store instead.

请注意,这只是Windows的兼容性行为-您的程序应写入其自己的%AppData%子文件夹.

Note that this is only compatibility behaviour from Windows - your program should write to its own subfolder of %AppData%.

有关更多信息,请参见此TechNet杂志文章

For more information, see this TechNet Magazine article.

这篇关于Vista Phantom目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆