rime-auto-deploy icon indicating copy to clipboard operation
rime-auto-deploy copied to clipboard

feat(windows): 增加 PowerShell 一键安装脚本, 无需 Ruby

Open joyshan1986 opened this issue 7 months ago • 0 comments

背景

Windows 用户使用现有 installer.rb 流程时,经常遇到以下问题(参见 #17 #22 #33 等):

  1. 必须先装 Ruby —— 对非开发用户门槛较高
  2. move + git clone 在 Weasel 运行时会失败 —— 当 WeaselServer.exe 占着 %APPDATA%\Rime 下的某些文件时,Windows 的 move 只能搬走未被锁的文件。后续 git clone 看到目标目录非空就报 fatal: destination already exists and is not an empty directory,留下半旧半新的混乱状态
  3. 部署步骤不自动 —— 安装完还要手动右键托盘"重新部署",新手容易遗漏导致"装了但没生效"的体验
  4. 小狼毫装在非默认路径时找不到部署器 —— 不少用户装在 D 盘等位置

改动

新增两个文件 + 更新 WINDOWS_README.md,不修改任何 custom/ 内配置,与现有部署行为完全一致。

install.ps1 —— PowerShell 一键脚本

步骤 操作
1 检查 git / custom 目录存在
2 自动结束所有 Weasel* 进程,消除文件占用
3 删除 %APPDATA%\Rime(干净状态)
4 git clone --depth=1 最新 rime-ice
5 复制 custom/*.yaml
6 智能查找 WeaselDeployer.exe:
① 优先读注册表 HKLM\SOFTWARE\Rime\Weasel\WeaselRoot(官方安装写入)
② 回退扫描所有固定盘的 Program Files / Program Files (x86)
③ 启动 WeaselServer 并调用 /deploy

支持小狼毫安装在任意盘符。无需管理员权限。

install.bat

双击包装,内置 -ExecutionPolicy Bypass,绕过 PowerShell 默认执行策略,普通用户双击即可。

WINDOWS_README.md

顶部新增「🚀 快速部署」章节,推荐新脚本流程,老 Ruby 流程保留作为兜底参考(新手不会被强制学 Ruby)。

使用方法

git clone https://github.com/Mark24Code/rime-auto-deploy.git
cd rime-auto-deploy
# 双击 install.bat   (或)
powershell -ExecutionPolicy Bypass -File .\install.ps1

测试

实测平台:Windows 11 Pro(用户名 / 路径任意,小狼毫装在 D:\Program Files\Rime\weasel-0.17.4),从全新状态到部署完成、输入法可用,全程无人工干预。

兼容性

  • ✅ 不影响 macOS / Linux 流程
  • ✅ 不影响现有 installer.rb(保留)
  • ✅ 不修改 custom/ 配置(默认行为完全一致)
  • ✅ PowerShell 5.1+(Windows 10/11 自带)

joyshan1986 avatar Apr 13 '26 18:04 joyshan1986