WIX插件安装包的生成(三) 批量导入文件

前文说过,我们是在编写AutoCAD的二次开发,所以其中不免引用到许多dll文件和图片资源,而这些文件往往数以百千计

<ComponentGroup Id="ProductComponents" Directory="TESTFILEPRODUCTDIR">
    <Component Id="ProductComponent">
        <File Id="tempAssembly" Source="C:\MyDoc\C# practice\test\temp\bin\Debug\temp.exe"  KeyPath="yes" Assembly=".net"/>
    </Component>
    <Component Id ="asUsual" >
        <File Id="testEXE" Source="C:\MyDoc\C# practice\test\test\bin\Debug\test.exe"/>
    </Component>
</ComponentGroup>
<ComponentGroup Id="Refs" Directory="AssemblyFolder">
    <Component Id="Ref" Guid="{0C9C8201-18B9-4977-98DE-C50E4DD65DBA}">
        <File Id="tempfile" Source="C:\MyDoc\C# practice\test\temp\bin\Debug\temp.exe"/>
    </Component>
</ComponentGroup>

因此上面这样的写法仅仅针对文件个数少的时候,我们这里就要使用wix自带的批量导入工具(刚想起来是heat.exe)用法如下:
这里写图片描述
dir表示目录,-out 表示输出 瞬间就生成了HeatFile.Wxs. 但一看,不是我们想要的,GuiD没有生成,Component的Id也不直观。 不急有更强大的命令
这里写图片描述
再看WXS文件,命令中的dr表示建立目录,cg 是建立ComponentGroup -var是创建变量,-gg表示自动生成GUID -gl表示GUID不带括号,其他命令可以通过heat.exe -?来查看

<ComponentGroup Id="VersionComponents" Directory="AssemblyVersion">
      <Component Id ="VersionComponent" >
        <File Source="$(var.EFHydraulicTemp.TargetPath)" KeyPath="yes"/>
      </Component>
</ComponentGroup>
<ComponentGroup Id="ProductComponents" Directory="SourceFile">
      <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
      <Component Id="ProductComponent">
        <File Id="EFHydraulicTempAssembly" KeyPath="yes" Source="$(var.EFHydraulicTemp.TargetPath)" Assembly=".net"/>
      </Component>
      <Component Id="cmpD96D263551D89C1D7745E577EEA11B93" Guid="{0F381448-06BB-4B48-86DE-D316618506D2}">
        <File Id="fil3AE21CED5EBC065D1EDBB2852B0D0E20" KeyPath="yes" Source="H:\bin\Debug\AcCui.dll" />
      </Component>
      <Component Id="cmpC0955043CFF9184FD521EB88C908A04D" Guid="{CE8FF887-0947-4DCC-A0E4-38DC1BFC5958}">
        <File Id="fil2B2001384F82CAA15D3E909B0F31771E" KeyPath="yes" Source="H:\bin\Debug\AcDx.dll" />
      </Component>
      <Component Id="cmp58668650D97406AB838CBCA5FC7A4688" Guid="{D37C0E88-A5FD-45D2-B7B0-0A74E48F9500}">
        <File Id="fil817EF001D5C085C4125F0566E8B46F3B" KeyPath="yes" Source="H:\bin\Debug\AcDxPublishUi.dll" />
      </Component>
      <Component Id="cmp510215C42E15F4096827E466EC3DACD8" Guid="{FC46F524-2093-4CD8-881B-A0481F906719}">
        <File Id="fil45D2E6474A423A8C1BE78EEDF65A7937" KeyPath="yes" Source="H:\bin\Debug\AcMNUParser.dll" />
      </Component>
      <Component Id="cmp3EC173DD93E541208797D687E155E724" Guid="{059D381F-9E1A-4717-9846-59618F51A45B}">
        <File Id="fil5A3A3D464077FC6250939BAB916721F0" KeyPath="yes" Source="H:\bin\Debug\AcMr.dll" />
      </Component>
      <Component Id="cmp039E1D8F580D3A2E4F1B7310F94D5597" Guid="{A7354681-EBB0-48A0-A965-E3631D69165C}">
        <File Id="fil0D3B14AFE297E1E7EB4B491FF39C8D12" KeyPath="yes" Source="H:\bin\Debug\AcTcMgd.dll" />
      </Component>
      <Component Id="cmp4EF8157AEC41A52D884C428FB87AA2CF" Guid="{2C916C13-5B9E-4232-93A3-370BCC33B647}">
        <File Id="fil54033073FE0A5D7D54A66379F4341127" KeyPath="yes" Source="H:\bin\Debug\AcWindows.dll" />
      </Component>
      <Component Id="cmp69F2CEA7C49EB7FC94713B4BC730355F" Guid="{004B2413-D34D-44F5-8A66-D6EF87D51684}">
        <File Id="fil64CCB6C14B821D35F5F7676F1F79FD05" KeyPath="yes" Source="H:\bin\Debug\AddressBarExt.dll" />
      </Component>
      <Component Id="cmpC3CE695643631070235F4BA9AFB80418" Guid="{8A7545B7-7B33-4228-B1FE-BFB60E464CC9}">
        <File Id="fil81AAD9745D5E314C10677C76B29DD0C0" KeyPath="yes" Source="H:\bin\Debug\AddressBarExt.pdb" />
      </Component>
      <Component Id="cmp4B160A01DAD1C07DFEA5A1F01858AC40" Guid="{18854D54-7666-41AB-B74B-F1B63F3027A8}">
        <File Id="fil8DB91E6A525778684AA2ED81A64F6A71" KeyPath="yes" Source="H:\bin\Debug\AdUiPalettes.dll" />
      </Component>
      <Component Id="cmp7FF8F306F0F4A28395A8F7C97C7C95DC" Guid="{DBBA3BB5-A085-4A70-805F-1EB925953B3C}">
        <File Id="filA708024930A64E336249D7D16F8772D5" KeyPath="yes" Source="H:\bin\Debug\AdWindows.dll" />
      </Component>
      <Component Id="cmp26B96E13BB2F72A85D2E7F50D4A28460" Guid="{334D01BD-BDEB-4D9B-8B12-329B9062EE60}">
        <File Id="filC5CED70F2DBDE1CC8723EF9FA4EA515E" KeyPath="yes" Source="H:\bin\Debug\app.config" />
      </Component>
      <Component Id="cmp04B4DF0C0745F54532F59B6E70081CFD" Guid="{9B13C015-CD33-43DF-8E15-3B1D3B8C2ED5}">
        <File Id="filEBC81101A0C3900D497C5D4E2BAD0BD8" KeyPath="yes" Source="H:\bin\Debug\Autodesk.AutoCAD.Interop.Common.dll" />
      </Component>
      <Component Id="cmp233E210711B922D13201DDBD416B8275" Guid="{1E3E7289-7650-4856-80A0-430CD962BD53}">
        <File Id="fil2BEA2BF6F1479206F64B3AEBB381E20F" KeyPath="yes" Source="H:\bin\Debug\EF.Common.dll" />
      </Component>
      <Component Id="cmp81F6C7BD5752654E8298F48BE33ADCC4" Guid="{6157DFB3-1983-4A76-89C9-D2390799EFF4}">
        <File Id="fil2953E1A45F0FC0C032C4F2FD9B35AC37" KeyPath="yes" Source="H:\bin\Debug\EF.Common.pdb" />
      </Component>
      <Component Id="cmp9CE96F0F61DCDCCBB0A5F3523AC161A5" Guid="{03FF3754-72D1-47B2-B885-F87D6C20E11B}">
        <File Id="filE36142024BC051D00EAD424F3DBF1976" KeyPath="yes" Source="H:\bin\Debug\EFHydraulic.LSP" />
      </Component>
      <Component Id="cmp960980A984DD2B1BC1E99486ADEB8D8F" Guid="{2CC2714A-CB53-4E1D-9213-6513B61832AF}">
        <File Id="filF251D74588E503C069556F174A86421F" KeyPath="yes" Source="H:\bin\Debug\EFHydraulic2016.arx" />
      </Component>
      <Component Id="cmp0502F3DF7237644F7052716D0B90E2EA" Guid="{87056DDE-516B-49A3-8728-8C61E95386AF}">
        <File Id="filD8096586C805D52A4AF3715B06C3C291" KeyPath="yes" Source="H:\bin\Debug\EFHydraulicNet.dll" />
      </Component>
      <Component Id="cmp0EDAB34E7BACBB1D52C31C68CD53F5EC" Guid="{A0A4DAA6-1EE0-4BBF-A6EC-BD5F484031D8}">
        <File Id="filFC8761C43392575A71914FCDCFEF4924" KeyPath="yes" Source="H:\bin\Debug\EFHydraulicNet.dll.config" />
      </Component>
      <Component Id="cmp0DDFBA8F62E820E0FE42905D3B131498" Guid="{CE3A4313-0B3E-4184-8A1C-FBE989D3BFE5}">
        <File Id="fil84C42B33C85630704FDFC09480FF57B1" KeyPath="yes" Source="H:\bin\Debug\EFHydraulicNet.pdb" />
      </Component>
      <Component Id="cmpC30800BD6D66554A0E4BAB4C70111446" Guid="{326BDFC6-67D3-4022-A66E-E9A6DEB4D525}">
        <File Id="filC07E3E7D4EDB30A15A60DB9042665CA8" KeyPath="yes" Source="H:\bin\Debug\EPPlus.dll" />
      </Component>
      <Component Id="cmp1238296BCB400508C89B9EC1F650B0EC" Guid="{2F898004-CE0E-4F7E-A24B-87D10844027A}">
        <File Id="fil63EFADB66B829A5706948768B72650DA" KeyPath="yes" Source="H:\bin\Debug\ICSharpCode.SharpZipLib.dll" />
      </Component>
      <Component Id="cmpE5C01B5677C30D575CC15B4B558A57E0" Guid="{441683CD-FB51-40DB-9D4D-2CF590959CE5}">
        <File Id="filD17F9AFAC4DF3D7A44817DFBA8510C1A" KeyPath="yes" Source="H:\bin\Debug\log4net.dll" />
      </Component>
      <Component Id="cmpC6332F3A45099026B4097C24B34E9D0B" Guid="{3EDCBCF2-4B47-44B8-B767-D8812BF1135F}">
        <File Id="fil4F9930D6A9274F224BFC21E92AFC59E9" KeyPath="yes" Source="H:\bin\Debug\NPOI.dll" />
      </Component>
      <Component Id="cmpE19A612BA8A11B2DDE30E2D898C65606" Guid="{3E316262-F094-433E-B68D-C2504561424F}">
        <File Id="fil45896A8D97C17F055ADE232E55500966" KeyPath="yes" Source="H:\bin\Debug\NPOI.OpenXml4Net.dll" />
      </Component>
</ComponentGroup>

这样生成的文件就很漂亮了,可以复制你的工程中去。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值