title: WIX: Files not copied over on new installs
body: <p>So, I have a WIX project which is to install either fresh installations or over previous installations of a product.  This product, if it was already installed, has several files inside of 3 different folders which need to be preserved.  This project also needs to copy the contents of those 3 different folders into another set of folders (same content in two different locations).  In order to accomplish this I have set up my project to first attempt to write into the original folders if the files don't already exist, then copy the contents of those folders.  On an upgrade where those files already exist this works fine.  On a fresh install the second set of folders do not get created, but all the files do.</p>
  
  <p>My assumption, and I may be incorrect, is that the msi is attempting to copy the folders over before they have even been created.  This would cause folders to not exist in the area they were supposed to be copied to as there would be nothing to copy from.  Is there a way I can ensure the files have been generated before trying to copy them?  Is there a better way of going about this that I'm not seeing?</p>
  
  <p>EDIT:</p>
  
  <p>I'm going to try to clear this up a little.  What I'm trying to do is the following (pseudo):</p>
  
  <p>1) See if an option file (hi.opt) exists in c:\options, if not create it.
  2) Copy that file to c:\options\opt2015.</p>
  
  <p>I'm doing this 3 times for 3 different folders.  I am creating the initial files with Wix in the c:\options folder using the NeverOverwrite parameter.  This part works great; the files are created without issue and none are overwritten if they already exist.  Where the problem lies is step two where I'm using the CopyFile Wix command.  This will only copy some of the files from the c:\options folder to the c:\options\opt2015 folder.  Depending on the initial setup of the system (if the files at c:\options exist or not) some files will copy over and others won't.  It's not random, the results are repeatable every time, but there seems to be no reason why some files copy and others don't depending on the initial setup of the system.</p>
  
  <p>I hope this makes sense and is a little more clear, though I think it makes things worse!  It is strange behavior because to me it looks like everything should just work, but it doesn't (isn't that every bug though).</p>
  
  <p>Edit2:</p>
  
  <p>After more work and creating a vb script which runs perfectly outside of WIX my team and I have determined that the files just are not being seen by WIX during the installation even though they do exist.  We haven't found any permissions issues and the installation is running as admin on an admin account.  Doing the copy via a VBS or through the Wix CopyFile command results in, well the same results; files that already exist on the system are not being copied.  Any more ideas?  Should we find a solution I'll be sure to post it because this is just getting weird.</p>