You can cut out the component nodes and paste them into the correct installation directory in the main wxs file. As an example, you can check out this simple layout:
<?xml version="1.0"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" UpgradeCode="put-guid-here" Name="Example Product Name" Version="0.0.1" Manufacturer="Example Company Name" Language="1033"> <Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/> <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLDIR" Name="Example"> <Component Id="FP7000-Camera.dll" Guid="*"> <File Id="FP7000-Camera.dll" Source="replace with path to FP7000-Camera.dll"/> </Component> further components can be added here. </Directory> </Directory> </Directory> <Feature Id="DefaultFeature" Level="1"> <ComponentRef Id="FP7000-Camera.dll"/> </Feature> </Product> </Wix>
You must extract COM data for your COM files . The following is an example of the Heat.exe command . (Note: if your dll does not load due to missing dependencies, you may need to set your sdk setting before starting the extraction):
heat file MyComFile.ocx -out MyComFile.wxs
The received, extracted COM data in MyComFile.wxs will look something like this:
<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <DirectoryRef Id="TARGETDIR"> <Directory Id="dirE645D1B018BB48C41BDBE188A129817F" Name="wix310-binaries" /> </DirectoryRef> </Fragment> <Fragment> <DirectoryRef Id="dirE645D1B018BB48C41BDBE188A129817F"> cut from here <Component Id="cmpD8BB195A00599F06D2FF16982DBAA523" Guid="PUT-GUID-HERE"> <File Id="filBDC3CFD8FF09857ADE9793AF172F66E6" KeyPath="yes" Source="SourceDir\wix310-binaries\ITDetector.ocx"> <TypeLib Id="{D6995525-B33A-4980-A106-9DF58570CC66}" Description="ITDetector 1.0 Type Library" HelpDirectory="dirE645D1B018BB48C41BDBE188A129817F" Language="0" MajorVersion="1" MinorVersion="0"> <Class Id="{D719897A-B07A-4C0C-AEA9-9B663A28DFCB}" Context="InprocServer32" Description="iTunesDetector Class" ThreadingModel="apartment" Programmable="yes" SafeForScripting="yes" SafeForInitializing="yes"> <ProgId Id="ITDetector.iTunesDetector.1" Description="iTunesDetector Class"> <ProgId Id="ITDetector.iTunesDetector" Description="iTunesDetector Class" /> </ProgId> </Class> <Interface Id="{45D2C838-0137-4E6A-AA3B-D39B4A1A1A28}" Name="IiTunesDetector" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" /> </TypeLib> </File> </Component> to here </DirectoryRef> </Fragment> </Wix>
Paste the component into the main wxs file in the appropriate directory location. For example, in INSTALLDIR, as shown in the first WXS file above.
Finally, a combined sample showing the main wxs file filled with the extracted component nodes from your heat.exe tool:
<?xml version="1.0"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" UpgradeCode="put-guid-here" Name="Example Product Name" Version="0.0.1" Manufacturer="Example Company Name" Language="1033"> <Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package"/> <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/> <Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLDIR" Name="Example"> <Component Id="FP7000-Camera.dll" Guid="*"> <File Id="FP7000-Camera.dll" Source="replace with path to FP7000-Camera.dll"/> </Component> <Component Id="cmpD8BB195A00599F06D2FF16982DBAA523" Guid="*"> <File Id="filBDC3CFD8FF09857ADE9793AF172F66E6" KeyPath="yes" Source="SourceDir\wix310-binaries\ITDetector.ocx"> <TypeLib Id="{D6995525-B33A-4980-A106-9DF58570CC66}" Description="ITDetector 1.0 Type Library" HelpDirectory="dirE645D1B018BB48C41BDBE188A129817F" Language="0" MajorVersion="1" MinorVersion="0"> <Class Id="{D719897A-B07A-4C0C-AEA9-9B663A28DFCB}" Context="InprocServer32" Description="iTunesDetector Class" ThreadingModel="apartment" Programmable="yes" SafeForScripting="yes" SafeForInitializing="yes"> <ProgId Id="ITDetector.iTunesDetector.1" Description="iTunesDetector Class"> <ProgId Id="ITDetector.iTunesDetector" Description="iTunesDetector Class" /> </ProgId> </Class> <Interface Id="{45D2C838-0137-4E6A-AA3B-D39B4A1A1A28}" Name="IiTunesDetector" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" /> </TypeLib> </File> </Component> </Directory> </Directory> </Directory> <Feature Id="DefaultFeature" Level="1"> <ComponentRef Id="FP7000-Camera.dll"/> <ComponentRef Id="cmpD8BB195A00599F06D2FF16982DBAA523"/> </Feature> </Product> </Wix>
If the above is unclear, try reading this answer: How to run heat.exe and register dll in wix
Stein Åsmul Aug 26 '16 at 21:22 2016-08-26 21:22
source share