The ActiveX control that is registered in WiX for C # development

Source: Internet
Author: User

I. Using Regasm.exe to extract a TLB file from a DLL

Regasm.exe "Tools.HMIBrowserDetector.dll"/tlb

Ii. the Heat.exe program using WiX

Use the following:

Heat file <*.dll>-out <*.wxs>

Where <*.dll> is the DLL file name that you wrote in C #,<*.wxs> is the Wxs file name you want to output.

Heat.exe "Tools.HMIBrowserDetector.dll"-out "Tools.HMIBrowserDetector.dll.wix"
Heat.exe "Tools.HMIBrowserDetector.tlb"-out "Tools.HMIBrowserDetector.tlb.wix"

After the file is generated OK, open <*. wxs> file

1. Change the <directoryref id= "*" > to your directory name, such as <directoryref id= "INSTALLDIR" >

2. Replace the put-guid-here in <component id= "*" guid= "Put-guid-here" > with your Actviex GUID, for example [GUID (" 3C719C70-EBB6-46A4-B9C5-6A926BDC004C ")] 3c719c70-ebb6-46a4-b9c5-6a926bdc004c

Final effect:

<?xml version= "1.0" encoding= "Utf-8"?>
<wix xmlns= "Http://schemas.microsoft.com/wix/2006/wi" >
<Fragment>
<directoryref id= "INSTALLDIR" >
<component id= "cmp2655a93590af35557be69214c9637225" guid= "3c719c70-ebb6-46a4-b9c5-6a926bdc004c" >
<class id= "{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}" context= "InprocServer32" description= "xxxxx. Tools.HMIBrowserDetector.BrowserDetector "threadingmodel=" both "foreignserver=" Mscoree.dll ">
<progid id= "Hmibrowser.detector" description= "xxxxx. Tools.HMIBrowserDetector.BrowserDetector "/>
</Class>
<file id= "fil21b157a69d41bf1742ad629a14c5609e" keypath= "yes" source= "sourcedir\build\xxxxx. Tools.HMIBrowserDetector.dll "/>
<registryvalue root= "HKCR" key= "clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\implemented Categories\{ 62c8fe65-4ebb-45e7-b440-6e39b2cdbf29} "value=" "type=" string "action=" write "/>
<registryvalue root= "HKCR" key= "clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32\2.0.2015.1016" Name= "Class" value= "xxxxx. Tools.HMIBrowserDetector.BrowserDetector "type=" string "action=" write "/>
<registryvalue root= "HKCR" key= "clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32\2.0.2015.1016" Name= "Assembly" value= "xxxxx. Tools.hmibrowserdetector, version=2.0.2015.1016, Culture=neutral, Publickeytoken=366fc8dc0356ba75 "Type=" string " action= "Write"/>
<registryvalue root= "HKCR" key= "clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32\2.0.2015.1016" Name= "RuntimeVersion" value= "v4.0.30319" type= "string" action= "write"/>
<registryvalue root= "HKCR" key= "clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32\2.0.2015.1016" Name= "CodeBase" value= "file:///[#fil21B157A69D41BF1742AD629A14C5609E]" type= "string" action= "write"/>
<registryvalue root= "HKCR" key= "Clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32" Name= "Class" Value = "xxxxx." Tools.HMIBrowserDetector.BrowserDetector "type=" string "action=" write "/>
<registryvalue root= "HKCR" key= "Clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32" Name= "Assembly" Value= "xxxxx. Tools.hmibrowserdetector, version=2.0.2015.1016, Culture=neutral, Publickeytoken=366fc8dc0356ba75 "Type=" string " action= "Write"/>
<registryvalue root= "HKCR" key= "Clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32" Name= " RuntimeVersion "value=" v4.0.30319 "type=" string "action=" write "/>
<registryvalue root= "HKCR" key= "Clsid\{3c719c70-ebb6-46a4-b9c5-6a926bdc004c}\inprocserver32" Name= "CodeBase" Value= "file:///[#fil21B157A69D41BF1742AD629A14C5609E]" type= "string" action= "write"/>
</Component>
</DirectoryRef>
</Fragment>
</Wix>

<?xml version= "1.0" encoding= "Utf-8"?>
<wix xmlns= "Http://schemas.microsoft.com/wix/2006/wi" >
<Fragment>
<directoryref id= "INSTALLDIR" >
<component id= "cmp71d7a8bd2249ae8ff1baf63380ebe202" guid= "3c719c70-ebb6-46a4-b9c5-6a926bdc004c" >
<file id= "fil4917a9c7209d8355fe869f3a043c0103" keypath= "yes" source= "$ (var. Sourcefilesdir) \tools.hmibrowserdetector.tlb ">
<typelib id= "{1cc3c945-daff-4e73-a9d3-849540bba501}" description= "Tools_hmibrowserdetector" HelpDirectory= " DIRB3F37FBA6922AB1B836A1A26AE0C3C1E "language=" 0 "majorversion=" 2 "minorversion=" 0 ">
<interface id= "{e455b333-58e2-3d50-9e32-2962a5fc9324}" name= "_browserdetector" proxystubclassid32= "{ 00020424-0000-0000-c000-000000000046} "/>
</TypeLib>
</File>
</Component>
</DirectoryRef>
</Fragment>
</Wix>

3. Save the file and put it in the WXI installation project

4. Modify the file list Wxs, add the above two ComponentID, and the file will be copied.

Login for C # developed ActiveX controls in WiX

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.