2010-01-29 48 views
5

我正在从事的项目是从使用VS2008部署/安装程序切换到WiX,目前我很新。我已经添加了将资源项目的输出复制到Resources.dll中的代码,但在旧的VS2008安装程序文件系统中,还有本地化资源输出,该输出当前会生成两个折叠(en和es)与另一个dll Resources.resources.dll)。我已经进行了一些搜索,但似乎无法找到将这些文件夹放入msi中的方法,因为实际上并不知道这些文件夹是否存在并将它们直接放入。有什么办法可以做到这一点?如何在包含WiX的MSI中包含Satellite Assemblies(本地化资源)?

回答

6

在您的Wix源文件中为每个本地化文件夹(en和es)定义<Directory>元素,然后为其中的卫星程序集定义<Component>元素。

总之,把它们直接放入!

+0

+1感谢您的提示!我创建了一个新的答案来说明你的答案。 – 2013-02-04 07:32:22

5

以下是我为2种语言工作的内容。

我加入localeDirectoryFR和localeDirectoryJA如下图所示,对于法国和日本:

<Directory Id='TARGETDIR' Name='SourceDir'> 
    <Directory Id='ProgramFilesFolder' Name='PFiles'> 
     <Directory Id='INSTALLDIR' Name='CmisSync'> 
     <Component Id='CmisSync.exe' Guid='bab5a922-b5c4-4958-ab79-5e303b767a61'> 
      <File Id='CmisSync.exe' Name='CmisSync.exe' Source='!(wix.root)\bin\CmisSync.exe' KeyPath='yes' DiskId='1' /> 
     </Component> 
     [... other components ...] 
     <Directory Id='localeDirectoryFR' Name='fr'> 
      <Component Id='localeComponentFR' Guid='01612d5d-6c9d-46e9-96c5-7105bbbea7db'> 
      <CreateFolder /> 
      <File Id='localeFileFR' Name='CmisSync.resources.dll' Source='!(wix.root)\bin\fr\CmisSync.resources.dll' DiskId='1' /> 
      </Component> 
     </Directory> 
     <Directory Id='localeDirectoryJA' Name='ja'> 
      <Component Id='localeComponentJA' Guid='8d77c457-54b0-41d6-9f1c-c91338b25505'> 
      <CreateFolder /> 
      <File Id='localeFileJA' Name='CmisSync.resources.dll' Source='!(wix.root)\bin\ja\CmisSync.resources.dll' DiskId='1' /> 
      </Component> 
     </Directory> 

然后,我引用他们的特点:

<Feature Id='CmisSyncFeature' Title='CmisSync' Description='CmisSync' Level='1' AllowAdvertise='no'> 
    <ComponentRef Id="CmisSync.exe" /> 
    [... other componentrefs ...] 
    <ComponentRef Id="localeComponentFR" /> 
    <ComponentRef Id="localeComponentJA" /> 
</Feature> 

感谢保罗·拉隆德的小费。