WIX:合并模块问题

时间:2011-03-07 05:28:20

标签: wix wix3.5

当我尝试在VS2010中使用合并模块功能时,我遇到了一个问题“多段输入”

为什么我收到此错误?

我已经完成了谷歌搜索,但我没有得到任何线索,我得到了答案。

<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Module Id="ModuleTest" Language="1033" Version="1.0.0.0">

    <Package Id='94290AA7-50E3-414E-A1BD-FC3C2B0C47D8' Description='My first Merge Module'
              Comments='This is my first attempt at creating a Windows Installer Merge Module'
              Manufacturer='TravelPort Private Limited' InstallerVersion='200' />

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='MyModuleDirectory' Name='.'>

        <Component Id='MyModuleComponent' Guid='93F36B4B-B6E0-4000-8174-2660C0AE9D6A'>
          <File Id='readme' Name='ReadMeModule' Source='ReadMergeModule.txt' DiskId='1' KeyPath='yes' Checksum='yes'></File>
        </Component> 

      </Directory>
    </Directory>

  </Module>

</Wix>

product.wxs文件

<Product Id="ec20ec5e-bb50-45d0-9190-156cf146c8f3" Name="WinDemoApp" Language="1033" Version="1.0.0.0" Manufacturer="WinDemoApp" UpgradeCode="979e03f4-3b50-43c1-9dde-dd675f726fde">
    <Package InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="APPLICATIONROOTDIRECTORY" Name="WinDemoApp">
                <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
            </Directory>

    <Directory Id ="ProgramMenuFolder">
      <Directory Id="ApplicationProgramsFolder" Name="WinDemoApp"></Directory>
    </Directory>

    <!--<Merge Id='MyModule' Language='1033' SourceFile='Module.msm' DiskId='1' />-->
        </Directory>
    </Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
  <Component Id="MyApp.exe" Guid="36AA7C63-ED57-40C6-8B14-843B9355C265">
    <File Id="MyApp.exe" Source="D:\WIXDemo\WinDemoApp\MyApp\bin\Debug\MyApp.exe" KeyPath="yes" Checksum="yes"></File> 
  </Component>
</DirectoryRef>

<DirectoryRef Id="ApplicationProgramsFolder">
  <Component Id="ApplicationShortcut" Guid="EA549460-4D98-4B09-B621-D4F1AA12A617">
    <Shortcut Id="ApplicationStartMenuShortcut" Name="WinDemoApp"
              Description="My Win Installer sample"
              Target="[APPLICATIONROOTDIRECTORY]MyApp.exe"
              WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
    <RemoveFolder Id ="ApplicationProgramsFolder" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\Microsoft\WinDemoApp" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>


</DirectoryRef>
<!--<Icon Id="bug.ico" SourceFile="bug.ico"/>
<Property Id="ARPPRODUCTICON" Value="bug.ico" />-->

<Feature Id="MyApplication" Title="WinDemoApp" Level="1">
        <!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. -->
  <ComponentRef Id="MyApp.exe"/>
  <ComponentRef Id="ApplicationShortcut"/>
  <!--<MergeRef Id="MyModule"/>-->
        <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. -->
    </Feature>
</Product>

1 个答案:

答案 0 :(得分:1)

MyModuleDirectory目录元素不应具有name属性。您的Merge元素也可能嵌套在ApplicationProgramsFolder目录下。现在它将转到[ProgramFilesFolder]。

看看Industrial Strength Windows Installer XML

即使您不想使用该工具,它自己的安装程序的设置方式与您使用产品使用的合并模块设置的方式完全相同。