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

╄→гoц情女王★ 提交于 2019-12-06 02:52:22

问题


The project I'm working on is switching from using the VS2008 deployment/installer to WiX, which i'm currently very new to. I've added the code to copy the output of the resources project into the Resources.dll, but in the old VS2008 installer file system there is also the localized resources output which currently produces two foldes (en and es) with another dll in (Resources.resources.dll) for each language. I've had a bit of a search, but can't seem to find the method of getting these folders into the msi short of actually knowing that those folders exist and putting them straight in. What's the best way to do this?


回答1:


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!




回答2:


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.



来源:https://stackoverflow.com/questions/2162320/how-do-i-include-satellite-assemblieslocalized-resources-in-an-msi-built-with

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