WUA IUpdate2.CopyToCache returns always "File not found"

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi there,

I'm trying to use WUA APIs to distribute system updates. For this I use
IUpdate2, CopyFromCache and CopyToCache. Everything works OK for updates
that contains only one file. E.g. this scenario works if the update has only
one file:

myUpdate.CopyFromCache "C:\myDirectory", False
.....
.....
Dim strColl = New StringCollection
strColl.Add "C:\myDirectory\UpdateSingleFile.exe"
myUpdate.CopyToCache strColl

All this is executed on the same computer.
However CopyToCache returns me all the time error 0x80070002 ("The system
cannot find the file specified") if the update contains more than one file.
E.g. this will not work:

myUpdate.CopyFromCache "C:\myDir", False ' after this call the directory
myDir will contain some files
.....
.....
Dim strColl = New StringCollection
strColl.Add "C:\myDir\File1.exe"
strColl.Add "C:\myDir\File2.exe"
myUpdate.CopyToCache strColl ' this call will fail with error 0x80070002
(file not found) but File1.exe and File2.exe are on the disk

When I download the update (using WUA APIs) in the
%WINDIR%\SoftwareDistribution\Download directory I will get a new directory
called '13412341341324134143' (this number depends of the update I download)
that contains the files for the update. When I execute CopyToCache for that
update, the directory '13412341341324134143' is deleted (I suspect to
prepare the stuff for the new files) but after that the call fails with
error 0x80070002.

Any ideas how to copy from/to cache updates that contains more than one
file?


--------------------------------------------------------------------------
Dorel Sturm
Germany


.