2012-06-29 31 views
5

Tôi có C# COM .dll. Tôi muốn cài đặt .dll một lần, nhưng nó đã được đăng ký cho cả x86 và x64.WiX: đăng ký thành phần .NET COM cả x86 x64

Đây là WiX Tôi đã đăng ký chỉ x64:

<Component Id="NETDLL.dll" Directory="INSTALLDIR"> 
    <File Id="NETDLL.dll" Name="NETDLL.dll" KeyPath="yes" Source="..\NETDLL.dll" /> 
    <Class Id="{78BE...}" Context="InprocServer32" Description="NETDLL" ThreadingModel="both" ForeignServer="mscoree.dll"> 
    <ProgId Id="NETDLL" Description="NETDLL" /> 
    </Class> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32\1.0.1.0" Name="Class" Value="NETDLL" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32\1.0.1.0" Name="Assembly" Value="NETDLL, Version=1.0.1.0, Culture=neutral" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32\1.0.1.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32\1.0.1.0" Name="CodeBase" Value="file:///[#NETDLL.dll]" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32" Name="Class" Value="NETDLL" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32" Name="Assembly" Value="NETDLL, Version=1.0.1.0, Culture=neutral" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\InprocServer32" Name="CodeBase" Value="file:///[#NETDLL.dll]" Type="string" Action="write" /> 
    <RegistryValue Root="HKCR" Key="Component Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Name="0" Value=".NET Category" Type="string" Action="write" /> 
    <RegistryKey Root='HKLM' Key='Software\NETDLL'> 
    <RegistryValue Name='Description' Type='string' Value='NETDLL'/> 
    </RegistryKey> 
</Component> 

Làm thế nào tôi có thể viết trong HKCR \ CLSID, HKCR \ Wow6432Node \ CLSID, HKLM \ Software, và HKLM \ Software \ Wow6432Node tất cả cùng một lúc?

Trả lời

0

Thử thiết bị chuyển mạch regasm.exe/x86 và/x64.

Bạn cũng có phiên bản 32 bit và 64 bit là regasm.exe, một trong số C:\windows\microsoft .net\<version>\Framework và một phiên bản khác trong Framework64, xem có trợ giúp không.

+0

Viết CustomActions là một nỗi đau và khiến tôi nghi ngờ rằng nó sẽ hoạt động với gỡ cài đặt hoặc khôi phục. Có vẻ như tôi sẽ cần phải thực thi 'reg.exe' quá để thêm giá trị cho HKLM. –

+0

regasm.exe không hỗ trợ các chuyển mạch dòng lệnh/x86 hoặc/x64. –

0

Cài đặt hai bản sao của tệp, mỗi bản sao dưới ProgramFiles64FolderProgramFilesFolder. Chất thải .5MiB, nhưng rất đơn giản.

+0

Điều này có yêu cầu bạn biên dịch assembly .NET với AnyCPU không? – tronda

0

tôi đã thành công đăng ký dll cùng trên một hệ thống 64 bit cho x86 và 64bit bằng cách chơi xung quanh với hai thành phần, một cho 64bit và một cho đăng ký x86:

<Component Id="NETDLL.dll" Directory="INSTALLDIR" Guid="*"> 
    <Class Id="{78BE...}" Context="InprocServer32" Description="NETDLL" 
     ThreadingModel="both" ForeignServer="mscoree.dll"> 
     <ProgId Id="NETDLL" Description="NETDLL" /> 
    </Class> 
    <File Id="NETDLL.dll" Name="NETDLL.dll" KeyPath="yes" 
      Source="..\NETDLL.dll" /> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\Implemented Categories {62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" /> 
    ... 
</Component> 
<Component Id="NETDLLWin64.dll" Guid="{885F75B1-3046-42BD-8B37-F8FA0E8D7A51}" Win64="yes" Directory="INSTALLDIR"> 
    <Class Id="{78BE...}" Context="InprocServer32" Description="NETDLL" ThreadingModel="both" ForeignServer="mscoree.dll"> 
     <ProgId Id="NETDLL" Description="NETDLL" /> 
    </Class> 
    <RegistryValue Root="HKCR" Key="CLSID\{78BE...}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" /> 
    ... 
</Component> 

tôi thêm Guid - Các thuộc tính trong Component Node, đã thay đổi Id cho Component thứ hai và thêm Win64 = "yes" Attribut. Ngoài ra tôi không lặp lại các tập tin. Hy vọng điều này sẽ giúp, nếu bạn có rất nhiều phụ thuộc và sẽ không lặp lại các tập tin.

Các vấn đề liên quan