Skip to content

Conversation

@LeionTong
Copy link

@LeionTong LeionTong commented Jan 21, 2026

Add Silent Installation Mode with Configuration Support

概述 / Overview

This PR adds comprehensive silent installation and uninstallation capabilities to the NaturalVoiceSAPIAdapter installer, enabling automated deployments in enterprise environments.

此 PR 为 NaturalVoiceSAPIAdapter 安装程序添加了完整的静默安装和卸载功能,支持自动化部署。

主要功能 / Key Features

1. Silent Installation Mode / 静默安装模式

  • Support for unattended installation via -silent or -s flag
  • 通过 -silent-s 参数支持无人值守安装
  • Silent uninstallation with -silent -uninstall
  • 使用 -silent -uninstall 进行静默卸载

2. Command-Line Configuration / 命令行配置

Full control over installation settings via command-line parameters:
通过命令行参数完全控制安装设置:

  • Architecture Selection / 架构选择: -32bit-only, -64bit-only
  • Voice Providers / 语音提供商:
    • -enable-narrator / -no-narrator
    • -enable-edge / -no-edge
    • -enable-azure / -no-azure
  • Azure Configuration / Azure 配置: -azure-key, -azure-region
  • Language Settings / 语言设置: -languages, -all-languages
  • Logging / 日志: -loglevel (0-6)
  • Optional Components / 可选组件: -no-phoneme-converters
  • Custom Paths / 自定义路径: -narrator-path

3. Help System / 帮助系统

  • Built-in help dialog accessible via -?, -h, or -help
  • 通过 -?-h-help 访问内置帮助对话框

4. Comprehensive Documentation / 完整文档

  • Added SILENT_INSTALL.md with detailed usage guide
  • 添加了 SILENT_INSTALL.md 详细使用指南
  • Includes quick reference, examples, and troubleshooting
  • 包含快速参考、示例和故障排除

使用示例 / Usage Examples

Basic Silent Installation / 基本静默安装

Installer.exe -silent

Enterprise Configuration / 企业配置

Installer.exe -silent -64bit-only -enable-edge -languages "en-US,zh-CN" -loglevel 1

Full Configuration / 完整配置

Installer.exe -silent ^
  -enable-narrator ^
  -enable-edge ^
  -enable-azure ^
  -azure-key "your-key" ^
  -azure-region "eastus" ^
  -languages "en-US,zh-CN,ja-JP" ^
  -loglevel 2

技术实现 / Technical Implementation

Modified Files / 修改的文件

  • Installer/Install.cpp: Added SilentInstall() and SilentUninstall() functions
  • Installer/WinMain.cpp: Added command-line parsing and help dialog
  • Installer/Installer.vcxproj: Updated platform toolset configuration
  • SILENT_INSTALL.md: Comprehensive documentation

Key Functions / 关键函数

  • SilentInstall(): Performs unattended installation
  • SilentUninstall(): Performs unattended uninstallation
  • GetParameterValue(): Parses command-line parameters
  • HasParameter(): Checks for parameter presence
  • ApplyConfigurationSettings(): Writes configuration to registry

测试 / Testing

Tested scenarios / 已测试场景:

  • ✅ Silent installation with default settings
  • ✅ Silent installation with custom configuration
  • ✅ Silent uninstallation
  • ✅ Architecture-specific installation (32-bit/64-bit only)
  • ✅ Language filtering
  • ✅ Azure credentials configuration
  • ✅ Help dialog display
  • ✅ Exit code handling

兼容性 / Compatibility

  • Fully backward compatible with existing GUI installation
  • 完全向后兼容现有的 GUI 安装
  • No changes to existing functionality
  • 不改变现有功能
  • Platform toolset updated to use DefaultPlatformToolset for better build compatibility
  • 平台工具集更新为使用 DefaultPlatformToolset 以获得更好的构建兼容性

使用场景 / Use Cases

  1. Enterprise Deployment / 企业部署: Automated installation across multiple machines
  2. CI/CD Integration / CI/CD 集成: Integrate into build and deployment pipelines
  3. System Imaging / 系统镜像: Include in Windows system images
  4. Remote Management / 远程管理: Deploy via remote management tools
  5. Batch Installation / 批量安装: Install on multiple systems with consistent configuration

文档 / Documentation

The new SILENT_INSTALL.md includes:
新的 SILENT_INSTALL.md 包含:

  • Quick reference guide / 快速参考指南
  • Complete parameter list / 完整参数列表
  • Usage examples / 使用示例
  • Exit codes / 退出代码
  • Troubleshooting / 故障排除
  • Deployment script templates (Batch & PowerShell) / 部署脚本模板(批处理和 PowerShell)

请求审查 / Request for Review

This feature significantly enhances the installer's capabilities for enterprise and automated deployment scenarios. I believe it will be valuable for users who need to deploy NaturalVoiceSAPIAdapter at scale.

此功能显著增强了安装程序在企业和自动化部署场景中的能力。我相信它对需要大规模部署 NaturalVoiceSAPIAdapter 的用户很有价值。

Please review and let me know if any changes are needed.
请审查并告诉我是否需要任何更改。


Related Issues: N/A
Breaking Changes: None
Documentation: Added SILENT_INSTALL.md

- Add silent installation functions (SilentInstall and SilentUninstall) to support unattended deployments
- Implement command-line parameter parsing for installation configuration
- Add support for configurable settings via command-line flags:
* Log level configuration (-loglevel)
* Voice provider selection (-no-narrator, -enable-narrator, -no-edge, -enable-edge, -no-azure, -enable-azure)
* Narrator voice path configuration (-narrator-path)
* Azure credentials configuration (-azure-key, -azure-region)
* Language settings (-all-languages, -languages)
* Architecture selection (-32bit-only, -64bit-only)
* Phoneme converter installation control (-no-phoneme-converters)
- Add helper functions GetParameterValue and HasParameter for command-line parsing
- Add ApplyConfigurationSettings function to write configuration to registry
- Update platform toolset to use DefaultPlatformToolset for better build compatibility
- Add SILENT_INSTALL.md documentation for silent installation usage
- Include <algorithm> header for string processing utilities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant