installer: multi-language support (zh-CN/en-us/zh-tw)
WixLocalization + Cultures in .wixproj + 3 .wxl files + dialog_bg optimized
这个提交包含在:
@@ -4,9 +4,11 @@
|
||||
<OutputName>PazeE-0.1.0-alpha-win-x64</OutputName>
|
||||
<OutputType>Bundle</OutputType>
|
||||
<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>
|
||||
<!-- 两个项目共享同一目录:排除 Product.wxs,仅编译 Bundle.wxs -->
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);Product.wxs</DefaultItemExcludes>
|
||||
<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>
|
||||
<Cultures>zh-cn</Cultures>
|
||||
<DefaultCulture>zh-cn</DefaultCulture>
|
||||
<!-- 两个项目共享同一目录:排除 Product.wxs 和 .wxl 本地化文件(由 MSI 项目处理) -->
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);Product.wxs;*.wxl</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -16,15 +16,27 @@
|
||||
<TreatValidationWarningsAsErrors>false</TreatValidationWarningsAsErrors>
|
||||
<!-- 两个项目共享同一目录:排除 Bundle.wxs,SDK 自动包含 Product.wxs + heat 生成文件 -->
|
||||
<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>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- heat 任务宿主:提供 HarvestDirectory item 处理 -->
|
||||
<PackageReference Include="WixToolset.Heat" Version="6.0.2" />
|
||||
<!-- WixUI 扩展:提供 WixUI_Mondo 等对话框集(许可协议/功能选择/路径浏览) -->
|
||||
<!-- WixUI 扩展:提供 WixUI_InstallDir 对话框集(许可协议/路径选择) -->
|
||||
<PackageReference Include="WixToolset.UI.wixext" Version="6.0.2" />
|
||||
</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>
|
||||
<!-- 自动收割 publish\0.1.0-alpha\bin 下全部文件为 ComponentGroup -->
|
||||
<HarvestDirectory Include="$(MSBuildProjectDirectory)\$(PublishBinDir)">
|
||||
@@ -40,4 +52,15 @@
|
||||
</HarvestDirectory>
|
||||
</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>
|
||||
|
||||
+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"
|
||||
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
<?define UpgradeCode = "8F4E2A91-3B7C-4D9E-8A12-5F6E1C7B2D90" ?>
|
||||
|
||||
<Package
|
||||
Name="PazeE Language"
|
||||
Manufacturer="PazeE Project"
|
||||
Name="!(loc.PazeEProductName)"
|
||||
Manufacturer="!(loc.PazeEPublisher)"
|
||||
Language="1033"
|
||||
Version="$(var.MsiVersion)"
|
||||
UpgradeCode="$(var.UpgradeCode)"
|
||||
Scope="perMachine">
|
||||
|
||||
<!-- 版本升级与降级保护 -->
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of PazeE is already installed." />
|
||||
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />
|
||||
<Media Id="1" Cabinet="paze.cab" EmbedCab="yes" />
|
||||
|
||||
<!-- ARP(添加/删除程序)信息:图标、版权声明、链接 -->
|
||||
<Icon Id="PazeEIcon.ico" SourceFile="logo.ico" />
|
||||
<Property Id="ARPPRODUCTICON" Value="PazeEIcon.ico" />
|
||||
<Property Id="ARPHELPLINK" Value="https://github.com/PazeE/paze" />
|
||||
<Property Id="ARPCOMMENTS" Value="PazeE Language Compiler — Licensed under GPL-3.0" />
|
||||
<Property Id="ARPCONTACT" Value="PazeE Project" />
|
||||
<Property Id="ARPCOMMENTS" Value="!(loc.ARPComments)" />
|
||||
<Property Id="ARPCONTACT" Value="!(loc.ARPContact)" />
|
||||
<Property Id="ARPURLINFOABOUT" Value="https://github.com/PazeE/paze" />
|
||||
<Property Id="ARPURLUPDATEINFO" Value="https://github.com/PazeE/paze" />
|
||||
<Property Id="ARPNOREPAIR" Value="1" />
|
||||
@@ -30,10 +30,13 @@
|
||||
<!-- 许可协议 RTF:LicenseAgreementDlg 显示 GPL3 全文 -->
|
||||
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
|
||||
|
||||
<!-- 品牌化位图:替换 WixUI 默认蓝色位图,打造大厂级专业外观 -->
|
||||
<!-- 品牌化位图 -->
|
||||
<WixVariable Id="WixUIDialogBmp" Value="dialog_bg.png" />
|
||||
<WixVariable Id="WixUIBannerBmp" Value="banner.png" />
|
||||
|
||||
<!-- 默认语言:简体中文(如果用户未选择) -->
|
||||
<Property Id="UILanguage" Value="zh-cn" />
|
||||
|
||||
<!-- 安装目录:C:\Program Files\PazeE\0.1.0-alpha\ -->
|
||||
<StandardDirectory Id="ProgramFiles64Folder">
|
||||
<Directory Id="PazeEFolder" Name="PazeE">
|
||||
@@ -41,17 +44,17 @@
|
||||
</Directory>
|
||||
</StandardDirectory>
|
||||
|
||||
<!-- 主 Feature:收割的文件 + PATH 组件 -->
|
||||
<Feature Id="Complete" Title="PazeE Language" Level="1"
|
||||
<!-- 主 Feature -->
|
||||
<Feature Id="Complete" Title="!(loc.PazeEProductName)" Level="1"
|
||||
ConfigurableDirectory="INSTALLFOLDER"
|
||||
Display="expand">
|
||||
<Feature Id="Binaries" Title="Compiler binaries" Level="1">
|
||||
<Feature Id="Binaries" Title="!(loc.BinariesTitle)" Level="1">
|
||||
<ComponentGroupRef Id="PazeEBinFiles" />
|
||||
<ComponentRef Id="PathEnvironmentComponent" />
|
||||
</Feature>
|
||||
</Feature>
|
||||
|
||||
<!-- PATH 环境变量组件:把 INSTALLFOLDER 追加到系统 PATH,卸载时自动移除 -->
|
||||
<!-- PATH 环境变量组件 -->
|
||||
<Component Id="PathEnvironmentComponent"
|
||||
Guid="C1A5F7E2-9B3D-4E8A-9F12-6B7C8D2E1A45"
|
||||
Directory="INSTALLFOLDER"
|
||||
@@ -65,22 +68,20 @@
|
||||
Action="set"
|
||||
System="yes" />
|
||||
|
||||
<!-- 安装信息注册表标记 -->
|
||||
<RegistryKey Root="HKLM" Key="SOFTWARE\PazeE\0.1.0-alpha">
|
||||
<RegistryValue Type="string" Name="InstallPath" Value="[INSTALLFOLDER]" />
|
||||
<RegistryValue Type="string" Name="Version" Value="$(var.PazeEVersion)" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
|
||||
<!-- 安装向导 UI:WixUI_InstallDir 简洁三步流程(类似 Python 安装器)
|
||||
① 许可协议(GPL3 全文,接受/不接受) → ② 安装路径(浏览选择) → ③ 安装进度 → 完成 -->
|
||||
<!-- 安装向导 UI -->
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
<ui:WixUI Id="WixUI_InstallDir" />
|
||||
<UIRef Id="WixUI_ErrorProgressText" />
|
||||
|
||||
<!-- 安装完成提示 -->
|
||||
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT"
|
||||
Value="Thank you for installing PazeE Language. Run 'paze --help' in a terminal to get started." />
|
||||
Value="!(loc.ExitText)" />
|
||||
|
||||
</Package>
|
||||
|
||||
|
||||
二进制文件未显示。
|
之前 宽度: | 高度: | 大小: 10 KiB 之后 宽度: | 高度: | 大小: 20 KiB |
@@ -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 &" />
|
||||
<String Id="BackBtn" Value="&Back" />
|
||||
<String Id="InstallBtn" Value="&Install" />
|
||||
<String Id="FinishBtn" Value="&Finish" />
|
||||
<String Id="CancelBtn" Value="&Cancel" />
|
||||
<String Id="BrowseBtn" Value="&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&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>
|
||||
@@ -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 语言安装到您的计算机。单击“下一步”继续,或单击“取消”退出安装向导。" />
|
||||
<String Id="LicenseText" Value="在安装 PazeE 语言之前,请仔细阅读许可协议。" />
|
||||
<String Id="LicenseAccept" Value="我接受许可协议中的条款" />
|
||||
<String Id="LicenseDecline" Value="我不接受许可协议中的条款" />
|
||||
<String Id="InstallText1" Value="单击“安装”开始安装。" />
|
||||
<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="下一步(&N)" />
|
||||
<String Id="BackBtn" Value="上一步(&B)" />
|
||||
<String Id="InstallBtn" Value="安装(&I)" />
|
||||
<String Id="FinishBtn" Value="完成(&F)" />
|
||||
<String Id="CancelBtn" Value="取消(&C)" />
|
||||
<String Id="BrowseBtn" Value="浏览(&B)..." />
|
||||
<String Id="InstallDirLabel" Value="目标文件夹" />
|
||||
<String Id="InstallDirText" Value="安装程序将把 PazeE 语言安装到以下文件夹。单击“更改”可安装到其他文件夹。" />
|
||||
<String Id="ChangeBtn" Value="更改(&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>
|
||||
@@ -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 語言安裝到您的電腦。按一下“下一步”繼續,或按一下“取消”離開安裝精靈。" />
|
||||
<String Id="LicenseText" Value="在安裝 PazeE 語言之前,請仔細閱讀許可協議。" />
|
||||
<String Id="LicenseAccept" Value="我接受許可協議中的條款" />
|
||||
<String Id="LicenseDecline" Value="我不接受許可協議中的條款" />
|
||||
<String Id="InstallText1" Value="按一下“安裝”開始安裝。" />
|
||||
<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="下一步(&N)" />
|
||||
<String Id="BackBtn" Value="上一步(&B)" />
|
||||
<String Id="InstallBtn" Value="安裝(&I)" />
|
||||
<String Id="FinishBtn" Value="完成(&F)" />
|
||||
<String Id="CancelBtn" Value="取消(&C)" />
|
||||
<String Id="BrowseBtn" Value="瀏覽(&B)..." />
|
||||
<String Id="InstallDirLabel" Value="目標資料夾" />
|
||||
<String Id="InstallDirText" Value="安裝程式將把 PazeE 語言安裝到以下資料夾。按一下“變更”可安裝到其他資料夾。" />
|
||||
<String Id="ChangeBtn" Value="變更(&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>
|
||||
在新工单中引用
屏蔽一个用户