After a lot of messing with things, and thinking back on what I had done, I think I have the scenario that causes this, and it's related to the way different commands access the "file" system.
I was playing with the 0-Preconfig script, and executing just it (using the green arrow). This creates and mounts the images so it can do some basic checking. It doesn't UNMOUNT the images. When you run the project, the MAIN configuration script tries to clean up the temp area, and it is allowed to remove the mounted directories...this is done using the cmd command below...
The problem is that this doesn't remove the mounts! And later on, in the places where it checks to see if directories "exist", they appear to exist, but only to Winbuilder, and not to the explorer or the command window!
If,EXISTDIR,%ProjectTemp%,Shellexecute,Hide,cmd.exe,"/C rd /s /q #$q%ProjectTemp%#$q"
This causes the commands that try to create the directories to not get executed, and in fact, Imagex returns a status of 2 in this case (i.e. images already mounted).
To correct this, I had to manually recreate the paths, and then unmount the images.
I added in some traps in the 0-preconfig to trap this, and it tries to call the unmounting, but by that time, that also fails, since the path was "removed"...At this point, a reboot or manually creating the paths and unmounting is needed...
So, not sure where the "bug" lies here. Seems to me that you shouldn't be able to do an "rd" command if there are files mounted, or that you should not get a file "exists" if a mounted (but removed) path exists, and also not sure if this is a winbuilder thing or windows7 (x64) version OS issue...
If it is a WB bug, then we can just add it to the list of things to eventually look into (i.e. shouldn't be able to think that the dir "exists" if you can't see it with explorer) Of course if this is because the WIN API's give back the wrong answer, not much we can do about it.
To reproduce this, mount a Wim, then execute the above command - and see that the dirs are removed, but the wim is still mounted!