开发者

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

开发者 https://www.devze.com 2022-12-18 06:40 出处:网络
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

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 开发者_C百科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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消