我正在使用 WiX v3.9 R2 创建我的安装程序。我已将安装程序本地化为多种语言,效果很好。但是,无论格式和显示语言设置为哪种语言,它始终在“程序和功能”中使用应用程序的英文名称。
如何在程序和功能中告诉它为我的应用程序使用本地化名称?
编辑:
澄清一下:我认为我需要一种在安装时根据用户的语言更改 Bundle 的名称属性(或 [WixBundleName])的方法。那可能吗?
或者如果做不到这一点,人们目前如何使用 WiX Bundle,并最终将程序名称本地化到程序和功能中?
编辑 2: 来自WiX 站点:
WixBundleName - 获取包的名称(来自 Bundle/@Name)。该变量也可以由引导程序应用程序设置,以在运行时修改包名称。
所以听起来这是可以做到的——但是怎么做呢?
编辑 3: 这是我当前的 Bundle,供参考。链中的最后一项是我的应用程序。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="Map Creator"
Version="$(var.ProductVersion)"
Manufacturer="FMOsoft"
IconSourceFile="$(var.KarteDir)\assets\logo\ico\icon.ico"
UpgradeCode="[GUID]"
AboutUrl="http://fmosoft.com/MapCreator"
Copyright="Copyright© 2015, FMOsoft">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkSidebarLicense">
<bal:WixStandardBootstrapperApplication
LocalizationFile="$(var.KarteDir)\install\win\L10n\installer\thm_en_us.wxl"
ThemeFile="$(var.KarteDir)\install\win\HyperlinkSidebarTheme_fmosoft.xml"
LogoFile="$(var.KarteDir)\assets\logo\bmp\logo_64.bmp"
LogoSideFile="logoside.bmp"
ShowVersion="yes"
LicenseFile="$(var.KarteDir)\install\license_en.html"
SuppressOptionsUI="yes"
LaunchTarget="[ProgramFiles6432Folder]\FMOsoft\MapCreator\MapCreator.exe"
/>
<!-- WixStdBa requires specific names, at run time, in the temporary .BA1 folder. XML and png file is only needed for layout changes.
Payload/@Name for .wxl must be <lcid>\thm.wxl
Payload/@Name for .xml must be <lcid>\thm.xml AND must also have logo.png in same folder.-->
<Payload Id="theme_en_us" Compressed="yes" Name="1033\thm.wxl" SourceFile="$(var.KarteDir)\install\win\L10n\installer\thm_en_us.wxl"/>
<Payload Id="license_en_us" Compressed="yes" Name="1033\license.html" SourceFile="$(var.KarteDir)\install\license_en.html"/>
<Payload Id="theme_es_es" Compressed="yes" Name="1034\thm.wxl" SourceFile="$(var.KarteDir)\install\win\L10n\installer\thm_es_es.wxl"/>
<Payload Id="license_es_es" Compressed="yes" Name="1034\license.html" SourceFile="$(var.KarteDir)\install\license_es.html"/>
<Payload Id="theme_fr_fr_xml" Compressed="yes" Name="1036\thm.xml" SourceFile="$(var.KarteDir)\install\win\L10n\installer\HyperlinkSidebarTheme_fmosoft_fr.xml"/>
<Payload Id="theme_fr_fr" Compressed="yes" Name="1036\thm.wxl" SourceFile="$(var.KarteDir)\install\win\L10n\installer\thm_fr_fr.wxl"/>
<Payload Id="theme_fr_fr_logo" Compressed="yes" Name="1036\logo.png" SourceFile="$(var.KarteDir)\assets\logo\bmp\logo_64.bmp"/>
<Payload Id="theme_fr_fr_sidelogo" Compressed="yes" Name="1036\logoside.png" SourceFile="$(var.KarteDir)\install\win\logoside.bmp"/>
<Payload Id="license_fr_fr" Compressed="yes" Name="1036\license.html" SourceFile="$(var.KarteDir)\install\license_fr.html"/>
<Payload Id="theme_pt_br" Compressed="yes" Name="1046\thm.wxl" SourceFile="$(var.KarteDir)\install\win\L10n\installer\thm_pt_br.wxl"/>
<Payload Id="license_pt_br" Compressed="yes" Name="1046\license.html" SourceFile="$(var.KarteDir)\install\license_pt.html"/>
<Payload Id="theme_id" Compressed="yes" Name="1057\thm.wxl" SourceFile="$(var.KarteDir)\install\win\L10n\installer\thm_id.wxl"/>
<Payload Id="license_id" Compressed="yes" Name="1057\license.html" SourceFile="$(var.KarteDir)\install\license_id.html"/>
</BootstrapperApplicationRef>
<WixVariable Id="WixStdbaLicenseUrl" Value="license.html" />
<Variable Name="MyProductVersion" Value="$(var.ProductVersion)" />
<!-- There must be a better way to show the localized name of the app in the setup, but this works. -->
<Variable Name="AppName_es" Value="Creador de Mapas"/>
<Variable Name="AppName_fr" Value="Créateur de Carte"/>
<Variable Name="AppName_pt" Value="Criador de Mapas"/>
<Variable Name="AppName_id" Value="Pencipta Peta"/>
<Chain>
<ExePackage SourceFile="vcredist_x64.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="VersionNT64"/>
<ExePackage SourceFile="vcredist_x86.exe" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes" InstallCommand="/quiet /norestart" InstallCondition="NOT VersionNT64"/>
<PackageGroupRef Id="OldMapEditorPackage"/>
<MsiPackage Vital="yes" SourceFile="$(var.BuildDir)out\map-creator-$(var.Platform).msi" />
</Chain>
</Bundle>
</Wix>