Hi again,
I am not able to make an example like you requested unfortunately.
However, I downloaded the wyUpdate source code and managed to identify the problem. The following code throws an UnauthorizedAccessException (Access to the path 's.png' is denied) at Directory.Delete and then swallows the exception:
void bw_DoWorkDeleteTemporary(object sender, DoWorkEventArgs e) { try { //delete the temp directory Directory.Delete(TempDirectory, true); } catch { } ....
I checked the ACL on the temporary folder and it looked fine. I then discovered that the s.png and the t.png files in the temp directory were marked as readonly. When I manually changed them to writeable and reran the code above via the debugger I found that the folder was deleted correctly.
I did some further investigation and it appears that these image files are packed into the .wyc file by wyBuild with readonly set to true on them. I am guessing that it is wyBuild setting them to readonly as I found the source files on disk in the wyBuild program files directory and they are writeable.
So I guess the next question is, how best to fix the problem? Change wyBuild to not make the image files readonly, or change wyUpdate to either delete all files from subdirectories first or mark them all as writeable?
Aside from that I don't know that the exceptions should just be swallowed by the temp directory cleanup code, especially as the side affect is that wyUpdate may just stop working for some people eventually, like we experienced. Alternatively if you do decide to continue swallowing the exceptions then the temp directory naming strategy should be changed so that directory names aren't constrained to the length of a GUID.
Could you please give me your recommendation, and when you think you would likely be able to address it? I guess for now I can make a custom build of wyUpdate or unpack the .wyc files, change the files to be writeable, and then repack them.
Cheers,Tana