2012-06-29 13 views
5

Tengo C# COM .dll. Me gustaría instalar el archivo .dll una vez, pero tengo que registrarlo para x86 y x64.WiX: registrar el componente .NET COM x86 x64

Aquí está la WiX que han de registrar solamente 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> 

¿Cómo puedo escribir en HKCR \ CLSID, HKCR \ Wow6432Node \ CLSID, HKLM \ Software y HKLM \ Software \ Wow6432Node todos a la vez?

Respuesta

0

Prueba el regasm.exe interruptores/86 y/64.

También tiene versiones de 32 bits y 64 bits de regasm.exe, una en C:\windows\microsoft .net\<version>\Framework y otra en Framework64, verifique si eso ayuda.

+0

escritura CustomActions es un dolor, y me deja en duda de que va a trabajar con la desinstalación o rollback. Parece que necesitaría ejecutar 'reg.exe' también para agregar valores a HKLM. –

+0

regasm.exe no admite los modificadores de línea de comando/x86 o/x64. –

0

Instale dos copias del archivo, una debajo de ProgramFiles64Folder y . Desechos .5MiB, pero es simple.

+0

¿Esto requiere que compile el ensamblado de .NET con AnyCPU? – tronda

0

tuve éxito el registro de la misma DLL en un sistema de 64 bits para x86 y 64 bits por jugar con dos componentes, uno para la de 64 bits y otro para el registro X 86:

<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> 

que añade Guid - Atributos en el nodo de componentes, cambió el Id para el segundo componente y agregó Win64 = "sí" Attribut. Además, no duplico el archivo. Espero que esto ayude, si tienes muchas dependencias y no duplicarás los archivos.

Cuestiones relacionadas