views:

423

answers:

1

Recently, I encountered a very strange issue, this issue only happens in XP SP3 and Vista. Here is my steps:

  1. List item
  2. Create two new folders in desktop(assume folder names are A and B)
  3. Copy Microsoft GraphEdit(graphedt.exe) application to A folder, then create a empty “graphedt.exe.manifest” file as well. Run graphedt.exe, you will see a error message, the graphed.exe can’t run due to the wrong manifest.
  4. Copy Microsoft GraphEdit(graphedt.exe) application to B folder, run graphedt.exe and close it, then create a empty “graphedt.exe.manifest” file, run graphedt.exe again, you will see the manifest file can’t apply to graphedt.exe. But if you change the last modified time of graphed.exe, the manifest will work again.

It seems MS will remember the status whether the EXE use manifest file in the first time, MS will reset the old remembered status if you change the EXE size or last modified date, I’m confusing it.

+2  A: 

[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.

Eugene Talagrand