4

I am using heat.exe to generate a .wxs file to include files in my main installer. I have two questions:

Which switches would I use to register a DLL?

Once I have generated the output file how do I go about adding it to my "Main.wxs" file? (Please be pretty explicit, new to this)

I have looked around a lot for an answer to the second question and I always come up with something vague or for VS, I am working from the command line. Thanks!

This is what I have tried thus far: I get the error: (LGHT0103: The system cannot find the file "file") I get this error for all of 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>
Tyler Tallo
  • 111
  • 2
  • 5

1 Answers1

0

You can cut the component nodes and paste them into the correct installation directory in your main wxs file. As an example you can check out this simple mock-up:

      <?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 should extract the COM data for your COM files. Here is a sample Heat.exe command. (Note: if your dll fails to load due to missing dependencies you might need to install your sdk setup before running the extraction):

heat file MyComFile.ocx -out MyComFile.wxs

the resulting, 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 your main wxs file in the appropriate Directory location. For example in INSTALLDIR as illustrated in the first WXS file above.

Finally a merged sample showing the main wxs file populated 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, please try to read this answer: How to run heat.exe and register a dll in wix

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164