installer: multi-language support (zh-CN/en-us/zh-tw)

WixLocalization + Cultures in .wixproj + 3 .wxl files + dialog_bg optimized
这个提交包含在:
2026-08-02 18:06:48 +08:00
父节点 08cef4f7bf
当前提交 2ed6aa24e3
修改 7 个文件,包含 141 行新增19 行删除
@@ -4,9 +4,11 @@
<OutputName>PazeE-0.1.0-alpha-win-x64</OutputName> <OutputName>PazeE-0.1.0-alpha-win-x64</OutputName>
<OutputType>Bundle</OutputType> <OutputType>Bundle</OutputType>
<OutputPath>..\..\publish\0.1.0-alpha\installer\</OutputPath> <OutputPath>..\..\publish\0.1.0-alpha\installer\</OutputPath>
<DefineConstants>PazeEVersion=0.1.0-alpha;MsiVersion=0.1.0;MsiTargetPath=$(MSBuildProjectDirectory)\obj\Release\PazeE-0.1.0-alpha-win-x64.msi</DefineConstants> <DefineConstants>PazeEVersion=0.1.0-alpha;MsiVersion=0.1.0;MsiTargetPath=$(MSBuildProjectDirectory)\obj\Release\zh-cn\PazeE-0.1.0-alpha-win-x64.msi</DefineConstants>
<!-- 两个项目共享同一目录:排除 Product.wxs,仅编译 Bundle.wxs --> <Cultures>zh-cn</Cultures>
<DefaultItemExcludes>$(DefaultItemExcludes);Product.wxs</DefaultItemExcludes> <DefaultCulture>zh-cn</DefaultCulture>
<!-- 两个项目共享同一目录:排除 Product.wxs 和 .wxl 本地化文件(由 MSI 项目处理) -->
<DefaultItemExcludes>$(DefaultItemExcludes);Product.wxs;*.wxl</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -16,15 +16,27 @@
<TreatValidationWarningsAsErrors>false</TreatValidationWarningsAsErrors> <TreatValidationWarningsAsErrors>false</TreatValidationWarningsAsErrors>
<!-- 两个项目共享同一目录:排除 Bundle.wxs,SDK 自动包含 Product.wxs + heat 生成文件 --> <!-- 两个项目共享同一目录:排除 Bundle.wxs,SDK 自动包含 Product.wxs + heat 生成文件 -->
<DefaultItemExcludes>$(DefaultItemExcludes);Bundle.wxs</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);Bundle.wxs</DefaultItemExcludes>
<!-- MSI 输出目录(同时发布 MSI 到 installer 目录,与 .exe 并列) -->
<PublishDir>..\..\publish\0.1.0-alpha\installer\</PublishDir>
<!-- 多语言构建:简体中文(默认) + English + 繁體中文 -->
<Cultures>zh-cn;en-us;zh-tw</Cultures>
<DefaultCulture>zh-cn</DefaultCulture>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- heat 任务宿主:提供 HarvestDirectory item 处理 --> <!-- heat 任务宿主:提供 HarvestDirectory item 处理 -->
<PackageReference Include="WixToolset.Heat" Version="6.0.2" /> <PackageReference Include="WixToolset.Heat" Version="6.0.2" />
<!-- WixUI 扩展:提供 WixUI_Mondo 等对话框集(许可协议/功能选择/路径浏览 --> <!-- WixUI 扩展:提供 WixUI_InstallDir 对话框集(许可协议/路径选择 -->
<PackageReference Include="WixToolset.UI.wixext" Version="6.0.2" /> <PackageReference Include="WixToolset.UI.wixext" Version="6.0.2" />
</ItemGroup> </ItemGroup>
<!-- 本地化文件:三种语言的 UI 字符串 -->
<ItemGroup>
<WixLocalization Include="en-US.wxl" Culture="en-us" />
<WixLocalization Include="zh-CN.wxl" Culture="zh-cn" />
<WixLocalization Include="zh-TW.wxl" Culture="zh-tw" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<!-- 自动收割 publish\0.1.0-alpha\bin 下全部文件为 ComponentGroup --> <!-- 自动收割 publish\0.1.0-alpha\bin 下全部文件为 ComponentGroup -->
<HarvestDirectory Include="$(MSBuildProjectDirectory)\$(PublishBinDir)"> <HarvestDirectory Include="$(MSBuildProjectDirectory)\$(PublishBinDir)">
@@ -40,4 +52,15 @@
</HarvestDirectory> </HarvestDirectory>
</ItemGroup> </ItemGroup>
<!-- 构建后复制 MSI 到 publish 目录(与 Bundle .exe 并列) -->
<!-- 多语言构建:每个 culture 生成独立 MSI,复制默认语言(zh-cn)到 publish -->
<Target Name="PublishMsi" AfterTargets="Build" Condition="'$(PublishDir)' != ''">
<ItemGroup>
<_MsiFiles Include="$(OutputPath)$(DefaultCulture)\*.msi" />
</ItemGroup>
<Copy SourceFiles="@(_MsiFiles)"
DestinationFolder="$(MSBuildProjectDirectory)\$(PublishDir)"
SkipUnchangedFiles="true" />
</Target>
</Project> </Project>
+16 -15
查看文件
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
@@ -6,23 +6,23 @@
<?define UpgradeCode = "8F4E2A91-3B7C-4D9E-8A12-5F6E1C7B2D90" ?> <?define UpgradeCode = "8F4E2A91-3B7C-4D9E-8A12-5F6E1C7B2D90" ?>
<Package <Package
Name="PazeE Language" Name="!(loc.PazeEProductName)"
Manufacturer="PazeE Project" Manufacturer="!(loc.PazeEPublisher)"
Language="1033" Language="1033"
Version="$(var.MsiVersion)" Version="$(var.MsiVersion)"
UpgradeCode="$(var.UpgradeCode)" UpgradeCode="$(var.UpgradeCode)"
Scope="perMachine"> Scope="perMachine">
<!-- 版本升级与降级保护 --> <!-- 版本升级与降级保护 -->
<MajorUpgrade DowngradeErrorMessage="A newer version of PazeE is already installed." /> <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
<Media Id="1" Cabinet="paze.cab" EmbedCab="yes" /> <Media Id="1" Cabinet="paze.cab" EmbedCab="yes" />
<!-- ARP(添加/删除程序)信息:图标、版权声明、链接 --> <!-- ARP(添加/删除程序)信息:图标、版权声明、链接 -->
<Icon Id="PazeEIcon.ico" SourceFile="logo.ico" /> <Icon Id="PazeEIcon.ico" SourceFile="logo.ico" />
<Property Id="ARPPRODUCTICON" Value="PazeEIcon.ico" /> <Property Id="ARPPRODUCTICON" Value="PazeEIcon.ico" />
<Property Id="ARPHELPLINK" Value="https://github.com/PazeE/paze" /> <Property Id="ARPHELPLINK" Value="https://github.com/PazeE/paze" />
<Property Id="ARPCOMMENTS" Value="PazeE Language Compiler — Licensed under GPL-3.0" /> <Property Id="ARPCOMMENTS" Value="!(loc.ARPComments)" />
<Property Id="ARPCONTACT" Value="PazeE Project" /> <Property Id="ARPCONTACT" Value="!(loc.ARPContact)" />
<Property Id="ARPURLINFOABOUT" Value="https://github.com/PazeE/paze" /> <Property Id="ARPURLINFOABOUT" Value="https://github.com/PazeE/paze" />
<Property Id="ARPURLUPDATEINFO" Value="https://github.com/PazeE/paze" /> <Property Id="ARPURLUPDATEINFO" Value="https://github.com/PazeE/paze" />
<Property Id="ARPNOREPAIR" Value="1" /> <Property Id="ARPNOREPAIR" Value="1" />
@@ -30,10 +30,13 @@
<!-- 许可协议 RTFLicenseAgreementDlg 显示 GPL3 全文 --> <!-- 许可协议 RTFLicenseAgreementDlg 显示 GPL3 全文 -->
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" /> <WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<!-- 品牌化位图:替换 WixUI 默认蓝色位图,打造大厂级专业外观 --> <!-- 品牌化位图 -->
<WixVariable Id="WixUIDialogBmp" Value="dialog_bg.png" /> <WixVariable Id="WixUIDialogBmp" Value="dialog_bg.png" />
<WixVariable Id="WixUIBannerBmp" Value="banner.png" /> <WixVariable Id="WixUIBannerBmp" Value="banner.png" />
<!-- 默认语言:简体中文(如果用户未选择) -->
<Property Id="UILanguage" Value="zh-cn" />
<!-- 安装目录:C:\Program Files\PazeE\0.1.0-alpha\ --> <!-- 安装目录:C:\Program Files\PazeE\0.1.0-alpha\ -->
<StandardDirectory Id="ProgramFiles64Folder"> <StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="PazeEFolder" Name="PazeE"> <Directory Id="PazeEFolder" Name="PazeE">
@@ -41,17 +44,17 @@
</Directory> </Directory>
</StandardDirectory> </StandardDirectory>
<!-- 主 Feature:收割的文件 + PATH 组件 --> <!-- 主 Feature -->
<Feature Id="Complete" Title="PazeE Language" Level="1" <Feature Id="Complete" Title="!(loc.PazeEProductName)" Level="1"
ConfigurableDirectory="INSTALLFOLDER" ConfigurableDirectory="INSTALLFOLDER"
Display="expand"> Display="expand">
<Feature Id="Binaries" Title="Compiler binaries" Level="1"> <Feature Id="Binaries" Title="!(loc.BinariesTitle)" Level="1">
<ComponentGroupRef Id="PazeEBinFiles" /> <ComponentGroupRef Id="PazeEBinFiles" />
<ComponentRef Id="PathEnvironmentComponent" /> <ComponentRef Id="PathEnvironmentComponent" />
</Feature> </Feature>
</Feature> </Feature>
<!-- PATH 环境变量组件:把 INSTALLFOLDER 追加到系统 PATH,卸载时自动移除 --> <!-- PATH 环境变量组件 -->
<Component Id="PathEnvironmentComponent" <Component Id="PathEnvironmentComponent"
Guid="C1A5F7E2-9B3D-4E8A-9F12-6B7C8D2E1A45" Guid="C1A5F7E2-9B3D-4E8A-9F12-6B7C8D2E1A45"
Directory="INSTALLFOLDER" Directory="INSTALLFOLDER"
@@ -65,22 +68,20 @@
Action="set" Action="set"
System="yes" /> System="yes" />
<!-- 安装信息注册表标记 -->
<RegistryKey Root="HKLM" Key="SOFTWARE\PazeE\0.1.0-alpha"> <RegistryKey Root="HKLM" Key="SOFTWARE\PazeE\0.1.0-alpha">
<RegistryValue Type="string" Name="InstallPath" Value="[INSTALLFOLDER]" /> <RegistryValue Type="string" Name="InstallPath" Value="[INSTALLFOLDER]" />
<RegistryValue Type="string" Name="Version" Value="$(var.PazeEVersion)" /> <RegistryValue Type="string" Name="Version" Value="$(var.PazeEVersion)" />
</RegistryKey> </RegistryKey>
</Component> </Component>
<!-- 安装向导 UIWixUI_InstallDir 简洁三步流程(类似 Python 安装器) <!-- 安装向导 UI -->
① 许可协议(GPL3 全文,接受/不接受) → ② 安装路径(浏览选择) → ③ 安装进度 → 完成 -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" /> <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<ui:WixUI Id="WixUI_InstallDir" /> <ui:WixUI Id="WixUI_InstallDir" />
<UIRef Id="WixUI_ErrorProgressText" /> <UIRef Id="WixUI_ErrorProgressText" />
<!-- 安装完成提示 --> <!-- 安装完成提示 -->
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT"
Value="Thank you for installing PazeE Language. Run 'paze --help' in a terminal to get started." /> Value="!(loc.ExitText)" />
</Package> </Package>
二进制文件未显示。

之前

宽度:  |  高度:  |  大小: 10 KiB

之后

宽度:  |  高度:  |  大小: 20 KiB

+32
查看文件
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Language="en-US" Culture="en-us">
<String Id="PazeEProductName" Value="PazeE Language" />
<String Id="PazeEPublisher" Value="PazeE Project" />
<String Id="WelcomeText1" Value="The Setup Wizard will install PazeE Language on your computer. Click Next to continue or Cancel to exit the Setup Wizard." />
<String Id="LicenseText" Value="Please review the license agreement before installing PazeE Language." />
<String Id="LicenseAccept" Value="I accept the terms in the License Agreement" />
<String Id="LicenseDecline" Value="I do not accept the terms in the License Agreement" />
<String Id="InstallText1" Value="Click Install to begin the installation." />
<String Id="InstallText2" Value="Setup is ready to install PazeE Language on your computer." />
<String Id="ProgressText" Value="Installing PazeE Language, please wait..." />
<String Id="ExitText" Value="Thank you for installing PazeE Language. Run 'paze --help' in a terminal to get started." />
<String Id="ExitText2" Value="The Setup Wizard has finished installing PazeE Language on your computer." />
<String Id="LaunchText" Value="Launch PazeE Language" />
<String Id="NextBtn" Value="Next &amp;" />
<String Id="BackBtn" Value="&amp;Back" />
<String Id="InstallBtn" Value="&amp;Install" />
<String Id="FinishBtn" Value="&amp;Finish" />
<String Id="CancelBtn" Value="&amp;Cancel" />
<String Id="BrowseBtn" Value="&amp;Browse..." />
<String Id="InstallDirLabel" Value="Destination Folder" />
<String Id="InstallDirText" Value="Setup will install PazeE Language into the following folder. Click Change to install to a different folder." />
<String Id="ChangeBtn" Value="Ch&amp;ange" />
<String Id="LangSelectText" Value="Please select your preferred language:" />
<String Id="LangEnglish" Value="English" />
<String Id="LangChineseSimplified" Value="Chinese (Simplified)" />
<String Id="LangChineseTraditional" Value="Chinese (Traditional)" />
<String Id="ARPComments" Value="PazeE Language Compiler — Licensed under GPL-3.0" />
<String Id="ARPContact" Value="PazeE Project" />
<String Id="DowngradeError" Value="A newer version of PazeE is already installed." />
<String Id="BinariesTitle" Value="Compiler binaries" />
</WixLocalization>
+32
查看文件
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Language="zh-CN" Culture="zh-cn">
<String Id="PazeEProductName" Value="PazeE 语言" />
<String Id="PazeEPublisher" Value="PazeE 项目" />
<String Id="WelcomeText1" Value="安装向导将把 PazeE 语言安装到您的计算机。单击&#x201C;下一步&#x201D;继续,或单击&#x201C;取消&#x201D;退出安装向导。" />
<String Id="LicenseText" Value="在安装 PazeE 语言之前,请仔细阅读许可协议。" />
<String Id="LicenseAccept" Value="我接受许可协议中的条款" />
<String Id="LicenseDecline" Value="我不接受许可协议中的条款" />
<String Id="InstallText1" Value="单击&#x201C;安装&#x201D;开始安装。" />
<String Id="InstallText2" Value="安装程序已准备好将 PazeE 语言安装到您的计算机。" />
<String Id="ProgressText" Value="正在安装 PazeE 语言,请稍候..." />
<String Id="ExitText" Value="感谢您安装 PazeE 语言。请在终端中运行 paze --help 以开始使用。" />
<String Id="ExitText2" Value="安装向导已完成 PazeE 语言在您计算机上的安装。" />
<String Id="LaunchText" Value="启动 PazeE 语言" />
<String Id="NextBtn" Value="下一步(&amp;N)" />
<String Id="BackBtn" Value="上一步(&amp;B)" />
<String Id="InstallBtn" Value="安装(&amp;I)" />
<String Id="FinishBtn" Value="完成(&amp;F)" />
<String Id="CancelBtn" Value="取消(&amp;C)" />
<String Id="BrowseBtn" Value="浏览(&amp;B)..." />
<String Id="InstallDirLabel" Value="目标文件夹" />
<String Id="InstallDirText" Value="安装程序将把 PazeE 语言安装到以下文件夹。单击&#x201C;更改&#x201D;可安装到其他文件夹。" />
<String Id="ChangeBtn" Value="更改(&amp;H)" />
<String Id="LangSelectText" Value="请选择您偏好的语言:" />
<String Id="LangEnglish" Value="English(英语)" />
<String Id="LangChineseSimplified" Value="简体中文" />
<String Id="LangChineseTraditional" Value="繁體中文" />
<String Id="ARPComments" Value="PazeE 语言编译器 — 基于 GPL-3.0 协议开源" />
<String Id="ARPContact" Value="PazeE 项目" />
<String Id="DowngradeError" Value="检测到已安装更新版本的 PazeE。" />
<String Id="BinariesTitle" Value="编译器核心文件" />
</WixLocalization>
+32
查看文件
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Language="zh-TW" Culture="zh-tw">
<String Id="PazeEProductName" Value="PazeE 語言" />
<String Id="PazeEPublisher" Value="PazeE 專案" />
<String Id="WelcomeText1" Value="安裝精靈將把 PazeE 語言安裝到您的電腦。按一下&#x201C;下一步&#x201D;繼續,或按一下&#x201C;取消&#x201D;離開安裝精靈。" />
<String Id="LicenseText" Value="在安裝 PazeE 語言之前,請仔細閱讀許可協議。" />
<String Id="LicenseAccept" Value="我接受許可協議中的條款" />
<String Id="LicenseDecline" Value="我不接受許可協議中的條款" />
<String Id="InstallText1" Value="按一下&#x201C;安裝&#x201D;開始安裝。" />
<String Id="InstallText2" Value="安裝程式已準備好將 PazeE 語言安裝到您的電腦。" />
<String Id="ProgressText" Value="正在安裝 PazeE 語言,請稍候..." />
<String Id="ExitText" Value="感謝您安裝 PazeE 語言。請在終端機中執行 paze --help 開始使用。" />
<String Id="ExitText2" Value="安裝精靈已完成 PazeE 語言在您電腦上的安裝。" />
<String Id="LaunchText" Value="啟動 PazeE 語言" />
<String Id="NextBtn" Value="下一步(&amp;N)" />
<String Id="BackBtn" Value="上一步(&amp;B)" />
<String Id="InstallBtn" Value="安裝(&amp;I)" />
<String Id="FinishBtn" Value="完成(&amp;F)" />
<String Id="CancelBtn" Value="取消(&amp;C)" />
<String Id="BrowseBtn" Value="瀏覽(&amp;B)..." />
<String Id="InstallDirLabel" Value="目標資料夾" />
<String Id="InstallDirText" Value="安裝程式將把 PazeE 語言安裝到以下資料夾。按一下&#x201C;變更&#x201D;可安裝到其他資料夾。" />
<String Id="ChangeBtn" Value="變更(&amp;H)" />
<String Id="LangSelectText" Value="請選擇您偏好的語言:" />
<String Id="LangEnglish" Value="English(英語)" />
<String Id="LangChineseSimplified" Value="簡體中文" />
<String Id="LangChineseTraditional" Value="繁體中文" />
<String Id="ARPComments" Value="PazeE 語言編譯器 — 基於 GPL-3.0 協議開源" />
<String Id="ARPContact" Value="PazeE 專案" />
<String Id="DowngradeError" Value="偵測到已安裝更新版本的 PazeE。" />
<String Id="BinariesTitle" Value="編譯器核心檔案" />
</WixLocalization>