如何在 Wix(命令行)中引用热量输出(wxs)

编程入门 行业动态 更新时间:2024-10-24 04:31:38
本文介绍了如何在 Wix(命令行)中引用热量输出(wxs)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在使用 heat.exe 生成一个 .wxs 文件以在我的主安装程序中包含文件.我有两个问题:

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

我将使用哪些开关来注册 DLL?

Which switches would I use to register a DLL?

生成输出文件后,如何将其添加到Main.wxs"文件中?(请非常明确,这是新手)

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)

我四处寻找第二个问题的答案,但我总是想出一些含糊不清的东西,或者对于 VS,我正在从命令行工作.谢谢!

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!

这是我迄今为止尝试过的:我收到错误:(LGHT0103:系统找不到文件文件")我的所有文件都收到此错误.

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>

推荐答案

您可以剪切组件节点并将它们粘贴到主 wxs 文件中的正确安装目录中.例如,您可以查看这个简单的模型:

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/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>

您应该为您的 COM 文件提取 COM 数据.这是一个示例 Heat.exe 命令.(注意:如果您的 dll 由于缺少依赖项而无法加载,您可能需要在运行提取之前安装 sdk 设置):

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

MyComFile.wxs 中提取的 COM 数据将如下所示:

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/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>

将组件粘贴到相应目录位置的主 wxs 文件中.例如在 INSTALLDIR 中,如上面第一个 WXS 文件所示.

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.

最后合并示例显示主 wxs 文件填充了从您的 heat.exe 工具中提取的组件节点:

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/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>

如果以上不清楚,请尝试阅读此答案:如何运行heat.exe并在wix中注册一个dll

If the above is unclear, please try to read this answer: How to run heat.exe and register a dll in wix

这篇关于如何在 Wix(命令行)中引用热量输出(wxs)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-25 22:40:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125450.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:热量   命令行   如何在   wxs   Wix

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!