2012-06-29 9 views
5

Ich habe C# COM .dll. Ich möchte die .dll einmal installieren, aber es für x86 und x64 registriert werden.WiX: registrieren .NET COM-Komponente sowohl x86 x64

Hier ist der WiX Ich habe nur x64 Registrierung:

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

Wie kann ich in HKCR \ CLSID schreiben, HKCR \ Wow6432Node \ CLSID, HKLM \ Software, und HKLM \ Software \ Wow6432Node alle auf einmal?

Antwort

0

Probieren Sie die regasm.exe Schalter/x86 und/x64.

Sie haben auch 32-Bit- und 64-Bit-Versionen von regasm.exe, eine in C:\windows\microsoft .net\<version>\Framework und eine andere in Framework64, sehen, ob das hilft.

+0

Schreiben von CustomActions ist ein Schmerz, und lässt mich Zweifel, dass es mit Deinstallation oder Rollback funktioniert. Sieht so aus, als müsste ich 'reg.exe' ausführen, um Werte zu HKLM hinzuzufügen. –

+0

regasm.exe unterstützt die Befehlszeilenoptionen/x86 oder/x64 nicht. –

0

Installieren Sie zwei Kopien der Datei, jeweils eine unter ProgramFiles64Folder und ProgramFilesFolder. Abfälle .5MiB, aber ist einfach.

+0

Muss dazu die .NET Assembly mit AnyCPU kompiliert werden? – tronda

0

gelang es mir, die gleiche DLL auf einem 64 Bit-System für x86 und 64-Bit-Registrierung durch das Spiel mit zwei Komponenten, eine für den 64-Bit und einem für die x86-Anmeldung:

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

I Guid hinzugefügt - Attribute im Komponentenknoten änderten die ID für die zweite Komponente und fügten die Win64 = "ja" hinzu. Außerdem dupliziere ich die Datei nicht. Hoffentlich hilft das, wenn Sie viele Abhängigkeiten haben und die Dateien nicht duplizieren.

Verwandte Themen