关于清单文件
最近,我遇到了一个很奇怪的问题,这个问题只发生在Windows XP SP3和Vista中。 以下是我的步骤:
- 在桌面上创建两个新文件夹(假设文件夹名称为 A 和 B)
- 将 Microsoft GraphEdit (
graphedt.exe
) 应用程序复制到 A 文件夹,然后创建一个空的graphedt.exe .manifest
文件也是如此。 运行graphedt.exe
,您将看到一条错误消息,graphedt.exe
由于清单错误而无法运行。 - 将 Microsoft GraphEdit (
graphedt.exe
) 应用程序复制到 B 文件夹,运行graphedt.exe
并关闭它,然后创建一个空的graphedt.exe.manifest
文件,再次运行graphedt.exe
,您将看到清单文件无法应用于graphedt.exe
。 但是,如果您更改graphed.exe
的上次修改时间,清单将再次工作。
看起来 Windows 会记住 EXE 第一次使用清单文件时的状态,而且如果您更改 EXE 大小或上次修改日期,Windows 也会重置旧的记住状态。
Recently, I encountered a very strange issue, this issue only happens in Windows XP SP3 and Vista. Here are my steps:
- Create two new folders in desktop (assume folder names are A and B)
- Copy Microsoft GraphEdit (
graphedt.exe
) application to A folder, then create a emptygraphedt.exe.manifest
file as well. Rungraphedt.exe
, you will see a error message, thegraphedt.exe
can’t run due to the wrong manifest. - Copy Microsoft GraphEdit (
graphedt.exe
) application to B folder, rungraphedt.exe
and close it, then create a emptygraphedt.exe.manifest
file, rungraphedt.exe
again, you will see the manifest file can’t apply tographedt.exe
. But if you change the last modified time ofgraphed.exe
, the manifest will work again.
It seems Windows will remember the status the first time the EXE uses a manifest file, but also Windows will reset the old remembered status if you change the EXE size or last modified date.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
[我是微软现任的 SxS 维护者]
很好的调查 Yigang。 您描述的是 Vista 上的行为,而不是 XP SP3 上的行为。
每次运行应用程序时探测清单是否存在将是一个性能问题,因为通常应用程序要么有清单,要么没有清单,并且该状态不会发生太大变化。 因此,在 Vista 上,第一次运行应用程序时,我们会缓存一些描述“此应用程序有关联的清单”或“此应用程序没有清单”的信息。 当您第一次运行 graphedt.exe 时,Windows 缓存了清单的缺失,并且随后不会查找清单。 要重置缓存,请更新可执行文件的上次修改时间。
[I'm the current SxS maintainer at Microsoft]
Good investigation Yigang. You're describing the behavior on Vista, not on XP SP3.
Probing for the existence of a manifest every time an app is run would be a performance issue, since usually apps either have a manifest or don't, and that state doesn't change much. For this reason, on Vista, the first time an application is run, we cache a bit describing "this application has an associated manifest" or "this application does not have a manifest". When you ran graphedt.exe the first time, Windows cached the absence of a manifest, and will subsequently not look for one. To reset the cache, update the last modified time on the executable.