简体   繁体   中英

Folder as a source for WIX Installer

How to tell WIX installer to use whole folder as a srouce not single file. This is my sample Product.wxs . When I install it it only copy one "exe" file.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="installer" Language="1033" Version="1.0.0.0" Manufacturer="google" UpgradeCode="b9a36165-554f-493b-8e11-f2aef7fb90a3">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature" Title="installer" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="myProduct" />
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <Component>
        <File Id="MyFiles" Name="$(var.MyProduct.UI.TargetFileName)" Source="$(var.MyProduct.UI.TargetDir)" />
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

As far as I'm aware you have to have all the files in your wix project if you want to include them into your installer.

To get all the files you can use the Harvest Tool (Heat)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM