[Bug 15887] msi_cabextract FDICopy fails: Unable to Install Word Perfect Office

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jan 18 06:34:57 CST 2009


http://bugs.winehq.org/show_bug.cgi?id=15887


Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net




--- Comment #9 from Anastasius Focht <focht at gmx.net>  2009-01-18 06:34:56 ---
Hello,

just experienced the same issue while testing Microsoft Visual Studio Express
Versions with some Frameworks and SDKs installed prior into WINEPREFIX.

--- snip ---
err:msi:msi_cabextract FDICopy failed
err:msi:ACTION_InstallFiles Failed to extract cabinet: L"vcsetup1.cab"
err:msi:ITERATE_Actions Execution halted, action L"InstallFinalize" returned
1627
--- snip ---

Relevant trace log:

--- snip ---
0028:trace:msi:msi_check_file_install_states file
L"FL_ATLWithCRT_vcstyle_____X86.3643236F_FC70_11D3_A536_0090278A1BB8" is named
L"ATLWithCRT.vsprops"
0028:trace:msi:msi_check_file_install_states file
L"FL_ATLWithCRT_vcstyle_____X86.3643236F_FC70_11D3_A536_0090278A1BB8" resolves
to L"C:\\Program Files\\Microsoft Visual Studio
8\\VC\\VCProjectDefaults\\ATLWithCRT.vsprops"
...
0028:trace:msi:cabinet_copy_file extracting L"C:\\Program Files\\Microsoft
Visual Studio 8\\VC\\VCProjectDefaults\\ATLWithCRT.vsprops"
0028:Call KERNEL32.CreateFileW(01be2290 L"C:\\Program Files\\Microsoft Visual
Studio
8\\VC\\VCProjectDefaults\\ATLWithCRT.vsprops",c0000000,00000000,00000000,00000002,00000001,00000000)
ret=60b9c779
0028:Ret  KERNEL32.CreateFileW() retval=ffffffff ret=60b9c779
0028:Call KERNEL32.GetFileAttributesW(01be2290 L"C:\\Program Files\\Microsoft
Visual Studio 8\\VC\\VCProjectDefaults\\ATLWithCRT.vsprops") ret=60b9c790
0028:Ret  KERNEL32.GetFileAttributesW() retval=00000021 ret=60b9c790 
...
0028:err:msi:msi_cabextract FDICopy failed
0028:trace:cabinet:FDIDestroy (hfdi == ^0x122e2d8)
0028:err:msi:ACTION_InstallFiles Failed to extract cabinet: L"vcsetup1.cab"
0028:err:msi:ITERATE_Actions Execution halted, action L"InstallFinalize"
returned 1627
...
0028:Call KERNEL32.GetLastError() ret=50245c4b
0028:Ret  KERNEL32.GetLastError() retval=00000005 ret=50245c4b
--- snip ---

Manually "cabextract" just to be sure:

--- snip ---
$ cabextract vcsetup1.cab
...
$ ls -lsa FL_ATLWithCRT*
4 -rw-rw-r-- 1 focht focht 219 2005-09-23 00:41
FL_ATLWithCRT_vcstyle_____X86.3643236F_FC70_11D3_A536_0090278A1BB8
--- snip ---

Dumping directory:

--- snip ---
$ pwd
/home/focht/.wine/drive_c/Program Files/Microsoft Visual Studio
8/VC/VCProjectDefaults
]$ ls -lsa
total 128
 4 drwxrwxr-x  2 focht focht  4096 2009-01-18 12:00 .
 4 drwxrwxr-x 13 focht focht  4096 2009-01-18 11:59 ..
 4 -r--r--r--  1 focht focht   235 2005-09-23 01:41 ATLDynamic.vsprops
 4 -r--r--r--  1 focht focht   285 2005-09-23 01:41 ATLNoCRT.vsprops
 4 -r--r--r--  1 focht focht   246 2005-09-23 01:41 ATLStatic.vsprops
 4 -r--r--r--  1 focht focht   219 2005-09-23 01:41 ATLWithCRT.vsprops
...
--- snip ---

Ah, sweet read-only issue again.

Although msi's cabinet_copy_file() ensures that newly created (extracted
cabinet) files have sane attributes set, it fails to handle the case when the
file to be replaced is already present with read-only attributes - which leads
to failure when trying to re-create.

--- snip dlls/msi/media.c ---
static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint,
                                 PFDINOTIFICATION pfdin)
{
    MSICABDATA *data = pfdin->pv;
    HANDLE handle = 0;
    LPWSTR path = NULL;
    DWORD attrs;

    data->curfile = strdupAtoW(pfdin->psz1);
    if (!data->cb(data->package, data->curfile, MSICABEXTRACT_BEGINEXTRACT,
&path,
                  &attrs, data->user))
        goto done;

    TRACE("extracting %s\n", debugstr_w(path));

    attrs = attrs &
(FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM);
    if (!attrs) attrs = FILE_ATTRIBUTE_NORMAL;

    handle = CreateFileW(path, GENERIC_READ | GENERIC_WRITE, 0,
                         NULL, CREATE_ALWAYS, attrs, NULL);
    if (handle == INVALID_HANDLE_VALUE)
    {
        if (GetFileAttributesW(path) == INVALID_FILE_ATTRIBUTES)
            ERR("failed to create %s (error %d)\n",
                debugstr_w(path), GetLastError());

        goto done;
    }

done:
    msi_free(path);

    return (INT_PTR)handle;
}
--- snip dlls/msi/media.c ---

Adjusting the file attributes of existing files to force the successful
re-creation fixes the problem.

Regards


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list