多语支持

This commit is contained in:
2026-03-22 12:33:04 +08:00
parent 5d6053ae2c
commit 1de688b792
20 changed files with 892 additions and 72 deletions

48
wix/Product-Service.wxs Normal file
View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="Chromebox Fan Control Service" Language="1033" Version="1.0.0" Manufacturer="ChromeboxFanControl"
UpgradeCode="B2C3D4E5-F6A7-8901-BCDE-F12345678901">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" Platform="x64" />
<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ServiceFeature" Title="Chromebox Fan Control Service (background, auto-start)" Level="1" ConfigurableDirectory="INSTALLFOLDER">
<ComponentGroupRef Id="ServiceFiles" />
<ComponentRef Id="ConfigFolderComponent" />
<ComponentRef Id="ServiceComponent" />
</Feature>
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Chromebox Fan Control" />
</Directory>
<Directory Id="CommonAppDataFolder">
<Directory Id="ConfigFolder" Name="ChromeboxFanControl" />
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="ServiceComponent" Guid="C3D4E5F6-A7B8-9012-CDEF-F12345678902">
<File Id="ServiceExe" Source="ChromeboxFanControlService.exe" KeyPath="yes" />
<ServiceInstall Id="ChromeboxFanControlSvc" Name="ChromeboxFanControl"
DisplayName="Chromebox Fan Control Service" Description="Fan control for Chromebox with Coreboot"
Type="ownProcess" Start="auto" Account="LocalSystem" ErrorControl="normal" />
<ServiceControl Id="StartService" Name="ChromeboxFanControl" Start="install" />
<ServiceControl Id="StopService" Name="ChromeboxFanControl" Stop="both" Remove="uninstall" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ConfigFolder">
<Component Id="ConfigFolderComponent" Guid="D4E5F6A7-B8C9-0123-DEF0-123456789003">
<CreateFolder>
<util:PermissionEx User="Users" GenericAll="yes" />
</CreateFolder>
</Component>
</DirectoryRef>
</Product>
</Wix>

66
wix/Product.wxs Normal file
View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="Chromebox Fan Control" Language="1033" Version="1.0.0" Manufacturer="ChromeboxFanControl"
UpgradeCode="A1B2C3D4-E5F6-7890-ABCD-EF1234567890">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" Platform="x64" />
<MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="MainFeature" Title="Chromebox Fan Control" Level="1" ConfigurableDirectory="INSTALLFOLDER">
<ComponentGroupRef Id="AppFiles" />
<ComponentRef Id="ConfigFolderComponent" />
<ComponentRef Id="ShortcutComponent" />
</Feature>
<Feature Id="ServiceFeature" Title="Windows Service (runs in background, auto-start)" Level="2">
<ComponentRef Id="ServiceComponent" />
</Feature>
<UIRef Id="WixUI_FeatureTree" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Chromebox Fan Control" />
</Directory>
<Directory Id="CommonAppDataFolder">
<Directory Id="ConfigFolder" Name="ChromeboxFanControl" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="AppProgramMenuFolder" Name="Chromebox Fan Control" />
</Directory>
</Directory>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="ServiceComponent" Guid="B2C3D4E5-F6A7-8901-BCDE-F12345678902">
<File Id="ServiceExe" Source="ChromeboxFanControlService.exe" KeyPath="yes" />
<ServiceInstall Id="ChromeboxFanControlSvc" Name="ChromeboxFanControl"
DisplayName="Chromebox Fan Control Service" Description="Fan control for Chromebox with Coreboot"
Type="ownProcess" Start="auto" Account="LocalSystem" ErrorControl="normal" />
<ServiceControl Id="StartService" Name="ChromeboxFanControl" Start="install" />
<ServiceControl Id="StopService" Name="ChromeboxFanControl" Stop="both" Remove="uninstall" />
</Component>
</DirectoryRef>
<DirectoryRef Id="ConfigFolder">
<Component Id="ConfigFolderComponent" Guid="C3D4E5F6-A7B8-9012-CDEF-123456789003">
<CreateFolder>
<util:PermissionEx User="Users" GenericAll="yes" />
</CreateFolder>
</Component>
</DirectoryRef>
<DirectoryRef Id="AppProgramMenuFolder">
<Component Id="ShortcutComponent" Guid="D4E5F6A7-B8C9-0123-DEF0-234567890104">
<Shortcut Id="AppShortcut" Name="Chromebox Fan Control" Description="Fan control for Chromebox"
Target="[INSTALLFOLDER]ChromeboxFanControl.exe" WorkingDirectory="INSTALLFOLDER" />
<Shortcut Id="UninstallShortcut" Name="Uninstall Chromebox Fan Control"
Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />
<RemoveFolder Id="RemoveAppProgramMenuFolder" Directory="AppProgramMenuFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\ChromeboxFanControl" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
</Product>
</Wix>

11
wix/exclude-service.xsl Normal file
View File

@@ -0,0 +1,11 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wi="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output omit-xml-declaration="yes" />
<xsl:key name="service-comp" match="wi:Component[wi:File[contains(@Source,'ChromeboxFanControlService.exe')]]" use="@Id" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="wi:Component[wi:File[contains(@Source,'ChromeboxFanControlService.exe')]]" />
<xsl:template match="wi:ComponentRef[key('service-comp', @Id)]" />
</xsl:stylesheet>