How do I include Satellite Assemblies(Localized Resources) in an MSI built with WiX?

江枫思渺然 提交于 2019-12-04 08:31:54

Define <Directory> elements in your Wix source for each of the localization folders (en and es), then define <Component> elements within them for your satellite assemblies.

In short, put them straight in!

Here is what worked for me, for 2 languages.

I added localeDirectoryFR and localeDirectoryJA as seen below, for French and Japanese:

<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>

Then I referenced them in the feature:

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

Thanks to Paul Lalonde for the tip.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!