8

I need to register a dll in regAsm and now i was using

 <CustomAction Id='comReg' Directory='INSTALLLOCATION'  
                ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\regasm.exe" "[INSTALLLOCATION]myProduct.dll"  /codebase' Return='check' />

to register and to unregister

<CustomAction Id='comUnreg' Directory='INSTALLLOCATION' ExeCommand='"[WindowsFolder]Microsoft.NET\Framework\v4.0.30319\regasm.exe" /u "[INSTALLLOCATION]myProduct.dll"  /codebase' Return='check' />

Am using it and sometimes its installing and somnetimes it gives error. But all are recommending to use something Heat.exe, http://wixtoolset.org/documentation/manual/v3/overview/heat.html even i went through this link,but i need how to use it in wix and what to do with this stuff.I need some tuitorial

Dah Sra
  • 4,107
  • 3
  • 30
  • 69

1 Answers1

10

Heat is used to scrape directories or files and generate .wxs files to include in your installer. If you wish to generate registry information from a .net dll with a COM interface you can use a command like the following:

Heat.exe file C:\<path_to_com_dll>\com.dll -dr INSTALLFOLDER -srd -gg -sfrag -suid -out C:\<path+wxs_file_name_to_output>

Here is some sample output from a command like the above:

<Component Id="ExactaDatabaseAccess.dll" Guid="{96F922A0-38C8-4B58-9E3B-E6B0C24EE09D}">
    <Class Id="{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}" Context="InprocServer32" Description="ExactaDatabaseAccess.DatabaseAccessObj" ThreadingModel="both" ForeignServer="mscoree.dll">
        <ProgId Id="ExactaDatabaseAccess.DatabaseAccessObj" Description="ExactaDatabaseAccess.DatabaseAccessObj" />
    </Class>
    <File Id="ExactaDatabaseAccess.dll" KeyPath="yes" Source="$(var.BasePath)\ExactaDatabaseAccess.dll" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="Class" Value="ExactaDatabaseAccess.DatabaseAccessObj" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="Assembly" Value="ExactaDatabaseAccess, Version=5.5.6.8, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32\5.5.6.8" Name="CodeBase" Value="file:///[#ExactaDatabaseAccess.dll]" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="Class" Value="ExactaDatabaseAccess.DatabaseAccessObj" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="Assembly" Value="ExactaDatabaseAccess, Version=5.5.6.8, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />
    <RegistryValue Root="HKCR" Key="CLSID\{E5CF8A66-AA42-432F-A036-97A3FC7E6EBC}\InprocServer32" Name="CodeBase" Value="file:///[#ExactaDatabaseAccess.dll]" Type="string" Action="write" />
</Component>

Basically the heat command generates a wxs file with the above component in it. Then all you need to do is to include this component or component group in your main installer. It will then create the registry entries instead of running regasm. The uninstall would then remove these registry entries.

Here is how you might include it in your main installer:

<Feature Id="ProductFeature" Title="ExactaSmallPick" Level="1">
    <ComponentRef Id="ExactaDatabaseAccess.dll"/>
</Feature>
Cole W
  • 15,123
  • 6
  • 51
  • 85
  • as am new to wix,can you please tellme where and how should i use this line in a .wxs file,Does it have any format – Dah Sra Jun 27 '14 at 13:12
  • You don't use it in a wxs file. You use it to generate a wxs file which you can then use. Please take a look at the sample output above. This was generated using a command similar to the heat command highlighted above. You would then use the output in the wxs file in your main installer. – Cole W Jun 27 '14 at 13:36
  • Sorry for the basic question. What i understood from you is Should open heat.exe and execute my path and should refer the output path inside this project.And there it will create a file with above components.And finally i should copy the above set of codes and should past it in my .wxs file and should refer that component.Isn't? – Dah Sra Jun 27 '14 at 13:41
  • can you help me out in this http://stackoverflow.com/questions/25059892/how-to-insert-a-image-in-setup-dialog-in-wix-installer – Dah Sra Jul 31 '14 at 13:20