For some applications I have sequenced, App-V seems to do just what is needed to make the application work correctly. In other cases, however, I have found that a few files that ought to reside on the local filesystem are virtualized. This is a problem because those files don't survive a "repair" of the virtualized application.
I thought that setting a VFS folder to merge mode would allow the application to write to the local file system. However, a simple test revealed that this does not seem to be the case. Obviously, there must be rules dictating which files are read from and written to the local file system as opposed to the VFS.
In what conditions is the local filesystem read from or written to by an App-V application?
TL;DR
Files that exist on the local filesystem can be seen by a virtualized application when the corresponding VFS folder is "merge" mode or the corresponding folder is not mentioned in the VFS. But, the same files cannot be seen when the corresponding VFS folder is in "override" mode.
A virtualized application only writes to the local filesystem when both of the following are true:
I wasn't able to find authoritative documentation to answer this question. The closest information I found was Kalle Saunamäki's 2011 blog post about App-V 4.6. It turns out that not only is that post only peripherally on-point, but App-V 5.x behavior also seems to have changed in at least one case (i.e. App-V 5.x doesn't seem to create missing merged-mode VFS folders on the local filesystem anymore, whereas Kalle seems to have witnessed 4.6 doing so).
Empirical Test
My crude experimentation just resulted in confusing results so I decided to run some more formal tests to get the bottom of this.
Setup
The test involved creating files at each of the following stages:
There are three possible cases for how the VFS applies to a folder at end of sequencing:
At the publishing stage, any given folder could either be created or not in each of the local and virtual filesystems. That's four possibilites.
The three ways the VFS applies combined with the four publishing possibilities results in 12 cases that I tested. I used some scripts to automate this and (hopefully) avoid mistakes. Those scripts are at the end of this post.
Results
The VFS as seen from the sequencer UI is as follows:
I checked for the existence of each of the files written by the scripts from both inside and outside the published app's bubble. The results are in this table:
Analysis
Based on the table, it looks like following statements hold:
Scripts
A-before-sequencing.ps1
B-during-sequencing.ps1
C-before-publishing.ps1
D-app-running.ps1
Alter-Folders.ps1