[Bug 24199] Life Balance does not install with native .net 2.0

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Aug 29 13:13:08 CDT 2010


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

Anastasius Focht <focht at gmx.net> changed:

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

--- Comment #3 from Anastasius Focht <focht at gmx.net> 2010-08-29 13:13:07 CDT ---
Hello,

good find!
I immediately remembered it when I saw "NetFxScheduleNativeImage" in your log.
It was two years ago where I briefly looked at some app having the same issue.
Unfortunately I put it in my "work queue" and couldn't find it later due to
cleanup :|

Anyway ...

Relevant part of trace log:

--- snip ---
0009:trace:msi:ACTION_CustomAction Handling custom action
L"NetFxScheduleNativeImage" (1 L"NetFxCA" L"SchedNetFx") 
...
0009:trace:msi:HANDLE_CustomType1 Calling function L"SchedNetFx" from
L"C:\\users\\focht\\Temp\\msi68fb.tmp" 
....
0022:Call KERNEL32.LoadLibraryW(0019d8d4
L"C:\\users\\focht\\Temp\\msi68fb.tmp") ret=68238070
0022:Call PE DLL (proc=0x10003f8f,module=0x10000000
L"msi68fb.tmp",reason=PROCESS_ATTACH,res=(nil)) 
...
0022:trace:msi:ACTION_CallDllFunction calling L"SchedNetFx" 
...
--- snip ---

The culprit:

--- snip ---
0022:Call msi.MsiDatabaseGetPrimaryKeysW(00000004,1001184c
L"MsiAssembly",005be664) ret=1000add8
0022:trace:msi:MsiDatabaseGetPrimaryKeysW 4 L"MsiAssembly" 0x5be664
0022:trace:msi:MsiDatabaseGetPrimaryKeysW 3 L"MsiAssembly" 0x5be664
0022:Call ntdll.RtlAllocateHeap(00110000,00000000,000000c8) ret=6826b662
0022:Ret  ntdll.RtlAllocateHeap() retval=0019fa28 ret=6826b662
0022:trace:msi:MSI_DatabaseOpenViewW L"select * from `_Columns` where `Table` =
'MsiAssembly'" 0x5be49c
....
0022:trace:msidb:TABLE_CreateView table 0x1440d0 found with 4 columns
0022:trace:msidb:TABLE_CreateView L"_Columns" one row is 8 bytes
...
0022:trace:msidb:WHERE_CreateView 0x19fb50
0022:trace:msidb:TABLE_get_dimensions 0x19fb50 (nil) 0x5bdabc
0022:trace:msidb:TABLE_get_dimensions 0x19fb50 (nil) 0x5bd9a4
0022:trace:msidb:TABLE_get_column_info 0x19fb50 1 0x5bd9ac (nil)
...
0022:trace:msi:MSI_ViewExecute 0x19faf8 (nil)
0022:trace:msidb:WHERE_execute 0x19fc48 (nil)
0022:trace:msidb:TABLE_execute 0x19fb50 (nil)
0022:trace:msidb:TABLE_execute There are 4 columns
0022:trace:msidb:TABLE_get_dimensions 0x19fb50 0x5be39c (nil)
...
0022:trace:msi:MSI_DatabaseGetPrimaryKeys Found 0 primary keys
...
0022:Ret  msi.MsiDatabaseGetPrimaryKeysW() retval=00000000 ret=1000add8
0022:Call msi.MsiCloseHandle(00000007) ret=1000ae07 
...
--- snip ---

Later leading to:

--- snip ---
0022:Call msi.MsiDatabaseOpenViewW(00000004,100012a8 L"SELECT
`MsiAssembly`.`File_Application` FROM `File`, `MsiAssembly` WHERE
`File`.`Component_`=`MsiAssembly`.`Component_` AND `File`.`File`=?",005be6b0)
ret=1000ae37 
..
0022:trace:msidb:JOIN_CreateView (nil) (L"MsiAssembly File")
0022:trace:msidb:TABLE_CreateView 0x140720 L"MsiAssembly" 0x19fb78
0022:trace:msidb:get_tablecolumns L"MsiAssembly"
0022:trace:msidb:get_defaulttablecolumns L"MsiAssembly"
0022:warn:msidb:get_tablecolumns Couldn't find id for L"MsiAssembly"
0022:warn:msidb:TABLE_CreateView table not found
0022:warn:msidb:JOIN_CreateView can't create table: L"MsiAssembly" 
...
0022:trace:msi:msiobj_release object 0x19fa28 destroyed
0022:Ret  msi.MsiDatabaseOpenViewW() retval=0000064f ret=1000ae37 
...
0022:Call msi.MsiRecordSetStringA(00000007,00000000,10014990 "SchedNetFx: 
Error 0x8007064f: failed to open view on database with SQL: SELECT
`MsiAssembly`.`File_Application` FROM `File`, `MsiAssembly` WHERE
`File`.`Component_`=`MsiAssembly`.`Component_` AND `File`.`File`=?")
ret=1000a662 
...
0022:Call msi.MsiRecordSetStringA(00000007,00000000,10014990 "SchedNetFx: 
Error 0x8007064f: failed to open view on File/MsiAssembly table") ret=1000a662 
...
0022:Call KERNEL32.FreeLibrary(10000000) ret=682381bb
0022:Call PE DLL (proc=0x10003f8f,module=0x10000000
L"msi68fb.tmp",reason=PROCESS_DETACH,res=(nil)) 
...
0022:trace:msi:DllThread custom action (22) returned 1603 
--- snip ---

I remembered the open source "Wix" installer had this
"NetFxScheduleNativeImage" custom action implemented.
I think it was around 2005/6 where scheduled ngen runs (CAs) were introduced
into WiX.

If you grab the sources:
http://wix.sourceforge.net/releases/3.0.5419.0/wix3-sources.zip

The relevant part extracted for you (easy to follow and "sync" with Wine's
trace log):

--- snip netfxca.cpp ---
/******************************************************************
 SchedNetFx - entry point for NetFx Custom Action

********************************************************************/
extern "C" UINT __stdcall SchedNetFx(
    __in MSIHANDLE hInstall
    )
{
...
   // loop through all the NetFx records
    hr = WcaOpenExecuteView(vcsNgenQuery, &hView);
    ExitOnFailure(hr, "failed to open view on NetFxNativeImage table");

    while (S_OK == (hr = WcaFetchRecord(hView, &hRec)))
    {
        // Get Id
        hr = WcaGetRecordString(hRec, ngqId, &pwzId);
        ExitOnFailure(hr, "failed to get NetFxNativeImage.NetFxNativeImage");
....
        //
        // Figure out if it's going to be GAC'd.  The possibility exists that
no assemblies are going to be GAC'd 
        // so we have to check for the MsiAssembly table first.
        //
        if (S_OK == WcaTableExists(L"MsiAssembly"))
        {
            hr = WcaOpenView(vcsNgenGac, &hViewGac);
            ExitOnFailure(hr, "failed to open view on File/MsiAssembly table");

            hr = WcaExecuteView(hViewGac, hRec);
            ExitOnFailure(hr, "failed to execute view on File/MsiAssembly
table");
...
}
--- snip netfxca.cpp ---

Now the _super_ relevant part ;-)

--- snip wcawrap.cpp ---
/********************************************************************
WcaTableExists() - determines if installing database contains a table

********************************************************************/
extern "C" HRESULT WcaTableExists(
    __in_z LPCWSTR wzTable
    )
{
    HRESULT hr = S_OK;
    UINT er = ERROR_SUCCESS;

    // NOTE:  The following line of commented out code should work in a 
    //        CustomAction but does not in Windows Installer v1.1
    // er = ::MsiDatabaseIsTablePersistentW(hDatabase, wzTable);

    // a "most elegant" workaround a Darwin v1.1 bug
    PMSIHANDLE hRec;
    er = ::MsiDatabaseGetPrimaryKeysW(WcaGetDatabaseHandle(), wzTable, &hRec);

    if (ERROR_SUCCESS == er)
        hr = S_OK;
    else if (ERROR_INVALID_TABLE == er)
        hr = S_FALSE;
    else
        hr = E_FAIL;
    Assert(SUCCEEDED(hr));

    return hr;
}
--- snip wcawrap.cpp ---

The check using MsiDatabaseGetPrimaryKeysW() is where Wine's msi fails at.
The "MsiAssembly" table doesn't exist in this MSI package and is not created at
runtime by installer (CA) and yet Wine still returns success letting the
installer make a query on non-existant table later (see code).

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