CreateProcess and File Virtualization

I have an active X control that downloads a file to a specific location and then uses CreateProcess to launch it. This works well on XP, however it fails on Vista. There are really two issues:

1) When I write out the file, Vista's Protected Mode security writes my file into the virtual area (\users\<userid>\AppData\Local\Microsoft\Windows\Temporary Internet Files\Virtualized\<my original path>). If this happens, how am I supposed to determine the actual path to the file I just downloaded

2) Assuming I can get the actual path to the EXE, Vista won't let me launch an EXE which resides in this 'virtualized' file area. The CreateProcess function returns an "Access Denied" error code. Is it even possible to launch an EXE from the virtualized file area What are my other options

This ActiveX control is not Vista specific and must be able to run on XP & Vista in both IE6 & IE7. So I can't take advantage of any vista-specific win32 APIs.

Does anyone have experience or suggestions for these issues. I have read a lot of Microsoft materials, but still don't have an answer to these questions.






Answer this question

CreateProcess and File Virtualization

  • Ron -N

    Who determines the location of the file Do you present a file save dialog to the user If so, you can use the IEShowSaveFileDialog/IESaveFile APIs (you can detect at runtime if the OS is Vista & IE is Protected Mode, then use these APIs), so that you are able to save the file in the location the user chooses. Else, if you want to write to a location where Protected Mode IE has access use SHGetKnownFolderPath with the folder id FOLDERID_LocalAppDataLow. Note that when you save the file to a low location, its marked with low integrity and launching the exe from IE/explorer will launch the binary with low integrity.
  • CreateProcess and File Virtualization