I found solution to fix bug [1487586] when adding component to COM+ if it is in the GAC.
See attached file with code patch and comments.

Some details:
 wix version: 2.0.4409.0
 Updated file src\ca\pubca\pcaexec\cpiasmexec.cpp
 Patch tested on WinXP SP2 with installed .Net 1.1 and 2.0 simultaneously.
Bug at sourceforge : http://sourceforge.net/tracker/index.php?func=detail&aid=1487586&group_id=105970&atid=642714

Is it possible to add this code to main WiX code tree ?

--
Alexander Biryukov
-------------------------------------------------------------------------------------------------
BUG: [ 1487586 ] Adding component to COM+ if it is in the GAC
URL: 
http://sourceforge.net/tracker/index.php?func=detail&aid=1487586&group_id=105970&atid=642714
-------------------------------------------------------------------------------------------------

Solution:

See comments in code.
This tested on WinXP SP2 with installed .Net 1.1 and 2.0 simultaneously. 


File src\ca\pubca\pcaexec\cpiasmexec.cpp

...
Line 843:       hr = pAssemblyCache->QueryAssemblyInfo(0, pwzAssemblyName, 
&assemblyInfo);

// ------------------ [Begin of new code] ------------------
        if(hr == 0x80131047) // 0x80131047 - The given assembly name or 
code-base is invalid
        {
                // In .Net 1.x and .Net 2.0 AssemblyName will be different
                //   .Net 1.x format: "MyAssembly, Version=1.0.0.0, 
Culture=neutral, PublicKeyToken=A6C259C05F51723A, ProcessorArchitecture=MSIL, 
Language=Neutral"
                //   .Net 2.0 format: "MyAssembly, Version=1.0.0.0, 
Culture=neutral, PublicKeyToken=A6C259C05F51723A"
                //
                // Trying to get assembly info by reformatted assembly name 
string in .Net 2.0 format.

                // Cuting off a tail of assambly name string (from 
"ProcessorArchitecture" to end)
                LPWSTR pwzSubStr = wcsstr(pwzAssemblyName, L", 
ProcessorArchitecture");
                size_t foundPos = pwzSubStr ? pwzSubStr-pwzAssemblyName : -1;
                if(foundPos > 0)
                {
                        LPWSTR pwzAssemblyName2 = new WCHAR[foundPos+1];
                        StringCchCopyW(pwzAssemblyName2, foundPos+1, 
pwzAssemblyName);

                        WcaLog(LOGMSG_STANDARD, "Alternative assembly name: 
%S", pwzAssemblyName2);

                        // Trying to get assembly info in alternative format
                        hr = pAssemblyCache->QueryAssemblyInfo(0, 
pwzAssemblyName2, &assemblyInfo);
                        delete [] pwzAssemblyName2;
                }
        }
// ------------------ [End of new code] ------------------

Line 844: if (HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) == hr)
...


-------------------
Alexander Biryukov
[EMAIL PROTECTED]
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to