Hello, this is a working example of a COM object registration:
<Component Id="COMComponent" Guid="<insert GUID here>"> <File Id="DtmDll" Source="YOUR_DLL_NAME_HERE" KeyPath="yes" /> <Class Id="{$(var.C_DtmClassId)}" Context="InprocServer32" Description="$(var.C_DtmDll)" ForeignServer="mscoree.dll"> <ProgId Id="$(var.C_DtmProgId)" Description="$(var.C_DtmClass)" /> </Class> <!-- .NET Category --> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32\$(var.D_ProductVersion)" Name="Class" Value="$(var.C_DtmClass)" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32\$(var.D_ProductVersion)" Name="Assembly" Value="$(var.D_ProductFqn)" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32\$(var.D_ProductVersion)" Name="RuntimeVersion" Value="$(var.D_ProductImageRuntime)" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32\$(var.D_ProductVersion)" Name="CodeBase" Value="file:///[#DtmDll]" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32" Name="Class" Value="$(var.C_DtmClass)" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32" Name="Assembly" Value="$(var.D_ProductFqn)" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32" Name="RuntimeVersion" Value="$(var.D_ProductImageRuntime)" Type="string" Action="write" /> <RegistryValue Root="HKCR" Key="CLSID\{$(var.C_DtmClassId)}\InprocServer32" Name="CodeBase" Value="file:///[#DtmDll]" Type="string" Action="write" /> </Component> Examples for the defines: D_Product_Fqn: Adm2.Adm.Dtm, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7b26e28fb8781288 C_DtmClass: Adm2.Adm.Dtm.Adm D_ProductImageRuntime: v1.1.4322 C_DtmClassId: <COM Class GUID> C_DtmProgId: <COM ProgId> D_ProductVersion: 1.0.0.0 I hope you can see in there what you need/want to do. Dirk On Mon, Jun 14, 2010 at 15:55, Christopher Painter < chr...@deploymentengineering.com> wrote: > regasm /regfile doesn't always work because if you have any user defined > register functions they will not be in the regfile. From what I've seen of > heat, it's not vunerable to this extraction problem. InstallShield does > have this problem. > > Personally I wrote a little UI over heat that watches a directory for > changes and spits out a wix fragment. I just scrape up the harvested XML > and paste it into my installer source. > > > > ----- Original Message ---- > From: "gree...@cox.net" <gree...@cox.net> > To: General discussion for Windows Installer XML toolset. < > wix-users@lists.sourceforge.net> > Cc: Elfe Xu <elf...@microsoft.com> > Sent: Sat, June 12, 2010 2:48:58 PM > Subject: Re: [WiX-users] Question about register .net COM object > > I saw regasm in the CustomAction element, so I am assuming that this is a > .NET assembly exposing COM objects. Use the /reg option to create a .reg > file containing all of the registry settings. Then you can manually enter > these values into the Wix projects. > > Wix has some tools that can automate some of this, but check the results > and make sure what you have is correct. What you may need to do is run a CA > to set the Codebase value in the registry for the installed COM .NET > assembly.. The value regasm puts in the .REG file will not be value for the > install. > > Regards, > greenaj > > > ---- Elfe Xu <elf...@microsoft.com> wrote: > > Hi, > > > > I'm trying a CA > > <CustomAction Id="RegT" ExeCommand="blablabla\RegAsm.exe T.dll" > Execute="immediate" /> > > and found it can only success if I make the CA run after > InstallFinalized. Otherwise, it will fail. > > > > I think the right way is to use Class element, but I just cannot make the > result the same as I execute regasm.exe. > > Here is my trying: > > <Component Id ="TestComponent" > Guid="D75C79A1-83C9-467D-89FB-4B7E081401CE" Win64="$(var.USEWIN64)" > > > <File Id="TestCOM" Assembly=".net" Name="Test.dll" DiskId="1" > Source="..\..\TestCOM.dll" KeyPath="yes"> > > <Class Id="CE13T9EC-3BE1-4292-89C4-243ERF42967B" > > Description="test com" > > ThreadingModel="both" > > Context="InprocServer32" > > <ProgId Id="MyTestCOM" /> > > </Class> > > </File> > > </Component> > > I just cannot find way to set lots of other stuffs, like > > Implemented Categories with value {62C8FE65-4EBB-45e7-B440-6E39B2CDBF29} > > The Assembly, Class, RuntimeVersion under InprocServer32. > > I want to set the ForeignServer with mscoree.dll, but wix says it cannot > be used under <File>. > > > > I guess I might doing totally wrong. Anyone can give me a sample of how > to do the register? > > > > Another question is: when I want to add the .net assembly into wix > project reference, why I get the error of "Test.dll could not be added. > Please make sure that the file is accessible, and that it is a valid WiX > reference." Because of this failure, I can only add the file by the relevant > path. Not sure if it is a cause of the register failure. > > > > Thanks, > > -Elfe > > > ------------------------------------------------------------------------------ > > ThinkGeek and WIRED's GeekDad team up for the Ultimate > > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > > lucky parental unit. See the prize list and enter to win: > > http://p.sf.net/sfu/thinkgeek-promo > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users