I think I know what the problem is.

The cab file I'm trying to extract has directories inside. I think when
CabExtractCallback is called for the first file we get wzPath pointing to a
string like C:\Users\user\AppData\Local\Temp\extract\subdir\file1.txt
and the call to CreateFileW fails because
C:\Users\user\AppData\Local\Temp\extract\subdir does not exist yet. I think
this results in GetLastWin32Error returning ERROR_PATH_NOT_FOUND back in
CabOperation which converts the error into 0x80070003 which then gets
returned to CabExtract and finally back to me.

If my guess above is correct, then the fix is to ensure the directory
portion of wzPath exists before calling CreateFileW.



On Thu, Jul 9, 2015 at 10:34 PM, Edwin Castro <egca...@gmail.com> wrote:

> I'm trying to use CabExtract from cabutil.h (WiX v3.9) but I always get hr
> == 0x80070003 (The system cannot find the path specified).
>
> My code is equivalent to the following:
>
> hr = CabInitialize(false);
>
> hr = PathCreateTempDirectory(NULL, L"extract", 1, &tempDir);
>
> hr = PathConcat(tempDir, L"file.cab", &cabPath);
>
> hr = StrAllocString(&extractDir, tempDir, 0):
>
> hr = PathBackslashTerminate(&extractDir);
>
> hr = CabExtract(cabPath, L"*", extractDir, NULL, NULL, 0);
>
> CabUninitialize();
>
> I see the paths I expect to see when I log cabPath and extrtactDir:
>
> cabPath = C:\Users\user\AppData\Local\Temp\extract\file.cab
> extractDir = C:\Users\user\AppData\Local\Temp\extract\
>
> I'm at a loss because I can't figure out what CabExtract is failing to
> find.
>
> Am I doing something obviously wrong?
>
> Any suggestions as to how I might go about finding out what CabExtract is
> actually complaining about?
>
> --
> Edwin G. Castro
>



-- 
Edwin G. Castro
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to