Wix将文件夹作为组件添加到安装程序中

时间:2017-11-13 14:04:48

标签: wix installer wix3.5

我试图将vsto vsto项目放入包含3个文件(exe,vsto和带有应用程序文件的文件夹)的wix安装程序中

问题是我无法将文件夹放入安装程序,然后我将.exe和.vsto文件作为组件放入wix安装程序,一切正常但是我尝试放置文件夹,我收到错误:< / p>

"The Component/@Id attribute's value, 'Application Files', is not a legal identifier.  Identifier's may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.).  Every identifier must begin with either a letter or an underscore. (CNDL0015)

以下是product.wxs的完整代码:

    <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="test" UpgradeCode="dddf18f9-28e4-445c-92a1-734e5e774125">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

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

        <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>
    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="SetupProject1" />      
            </Directory>
        </Directory>
  </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <Component Id="setup.exe">
        <File Id="setup.exe" KeyPath="yes"
        Name="setup.exe" Source="$(var.AddinFiles)"></File>
      </Component>
      <Component Id="Com.VistaDraft.Distribution.Mvp.vsto">
          <File Id="Com.VistaDraft.Distribution.Mvp.vsto" KeyPath="yes"
                Name="Com.VistaDraft.Distribution.Mvp.vsto" Source="$(var.AddinFiles)"></File>
      </Component>
      <Component Id="Application Files">
          <File Id="Application Files" KeyPath="yes"
                Name="Application Files" Source="$(var.AddinFiles)"></File>
          </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

也许是谁帮助将文件夹添加到wix安装程序中?

1 个答案:

答案 0 :(得分:0)

您引用的错误告诉您Id属性只能包含a-z,A-Z,数字,下划线和句点。您使用的Id属性中包含空格。