locked
manifest file not read from Program Files VirtualStore RRS feed

  • Question

  • Hello all,

    I've noticed (I think) an oddity in the use of the VirtualStore for Program Files.

    I have an application that affects its behaviour by dynamically creating myapp.exe.config and myapp.exe.manifest files. The application is in Program Files, and both files are (as I expect) written to the virtualstore, even though the code writes to "C:\program files\....". All good so far.

    However, when the application is started the manifest file is NOT read from the virtualstore, that is to say, the effects it should have do not occur in the application. If I manually copy the file to the correct c:\program files\.... directory the file is correctly loaded, and the contents are honoured. The .config file *is* referenced from the virtualstore. Why the difference between the .manifest file and the .config file? Can I get around this without embedding the manifest?

    On a related note, one cannot modify a .exe or a .dll file in a program files sub directory. Attempts to create those files are not virtualized, an access error is returned. Can an executable file not be virtualized the same way as other files?

    Thanks all,
    john.
    Monday, January 23, 2012 9:13 AM

All replies

  • The presence of a manifest file is understood by Windows to mean you don't want virtualization to occur. It's basically how you turn it off.


    Phil Wilson
    Tuesday, January 24, 2012 11:16 PM
  • The presence of a manifest file is understood by Windows to mean you don't want virtualization to occur. It's basically how you turn it off.


    Phil Wilson


    Hi Phil,

    That's not what I'm seeing.

    I think that the process of reading the manifest file ignores the virtualization, i.e. A manifest file in the virtualstore is not read at all. That is at least what I'm seeing.

    In addition, if I have the manifest file in the "real" program files folder, the config file is still read from the virtualstore, so the external manifest file has not turned the virualization off. Maybe an embedded manifest is different, but I want to be able to create the manifest file "on the fly".

    /john

    Wednesday, January 25, 2012 9:43 AM
  • I think that's what I'm trying to say - manifest files are special, and they can't be *read* from a virtual store because the presence of one means that you aren't using a virtual store in the first place.  I'm pretty sure they're used only at process startup so creating one on the fly for a running program is tricky. You may be able to do something using the underlying activation context APIs, like CreateActCtx() etc, but I've not ever tried anything like that.
    Phil Wilson
    Wednesday, January 25, 2012 8:32 PM
  • I think that's what I'm trying to say - manifest files are special, and they can't be *read* from a virtual store because the presence of one means that you aren't using a virtual store in the first place.  I'm pretty sure they're used only at process startup so creating one on the fly for a running program is tricky. You may be able to do something using the underlying activation context APIs, like CreateActCtx() etc, but I've not ever tried anything like that.
    Phil Wilson

    Right, OK, think I'm with you, that makes sense and matches what I'm seeing. I'll take a look at CreateActCtx, see if that gets me anywhere. Thanks Phil.

     

    Thursday, January 26, 2012 11:22 AM