How to reference a heat output (wxs) on Wix (command line)

I use heat.exe to create a .wxs file to include files in my main installer. I have two questions:

What keys would I use to register a DLL?

Once I generated the output file, how do I add it to the "Main.wxs" file? (Please be extremely clear, new to this)

I looked around a lot to answer the second question, and I always come up with something vague or for VS, I work from the command line. Thank!

This is what I have tried so far: I get the error: (LGHT0103: the system cannot find the file "file"). I get this error for all my files.

<Fragment> <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> <Component Id="cmp1D2A500FA963CF9DB333FD18154B94BC" Guid="{8DE755D7-F1F9-4EC3-BCD5-B72360B8752A}"> <File Id="filCBD973AD942425DC5F533B29866FEF5A" KeyPath="yes" Source="SourceDir\DLLs\FP7000-Camera.dll" /> </Component> <Component Id="cmp4CC93670B061A60B94C1867DCFAAAED0" Guid="{717E0819-2842-4C0D-BFAB-30E4C8C66F7E}"> <File Id="fil7CEC0F75EDE8EEF9C7F6D563E8D04EF9" KeyPath="yes" Source="SourceDir\DLLs\libmfxsw64.dll" /> </Component> <Component Id="cmpE80ACF08DF44E67E7583F35557C8EB02" Guid="{4CAA0627-45DB-4E34-9B4C-C54B5E21346C}"> <File Id="fil1E619A89A3D0D2FDE446E60B3D3EB2AF" KeyPath="yes" Source="SourceDir\DLLs\pthreadVC2.dll" /> </Component> </ComponentGroup> </Fragment> 
+3
windows windows-installer wix
Aug 26 '16 at 17:01
source share
1 answer

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

-one
Aug 26 '16 at 21:22
source share



All Articles