Skip to content

fix(update): 修复更新提示找不到路径#7

Merged
YueerMoe merged 11 commits intomasterfrom
preview
Feb 9, 2026
Merged

fix(update): 修复更新提示找不到路径#7
YueerMoe merged 11 commits intomasterfrom
preview

Conversation

@YueerMoe
Copy link
Member

@YueerMoe YueerMoe commented Feb 8, 2026

修复 Windows 更新脚本中 cmd 引号转义错误,避免出现「系统找不到路径 "\"」。

  • 修复位置:src-tauri/src/services/update.rs
  • 原因:cmd.exe 不支持 " 作为转义;改为使用 ""path"" 的双引号写法

@gemini-code-assist
Copy link

Summary of Changes

Hello @YueerMoe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求修复了 Windows 更新脚本中的一个关键错误,该错误导致 cmd 命令在处理路径时因不正确的引号转义而失败,从而引发“系统找不到路径”的提示。通过将路径引用从 \" 调整为 "" 格式,确保了 cmd.exe 能够正确解析路径。此外,还引入了一个新的单元测试,以验证更新批处理脚本中路径引用的正确性,从而提高了更新过程的健壮性。

Highlights

  • 修复 Windows 更新脚本: 解决了 Windows 更新脚本中 cmd 引号转义错误,该错误导致更新提示出现“系统找不到路径 "\"”的问题。
  • 引用转义方式调整: 将 cmd.exe 不支持的 \" 转义方式改为使用 ""path"" 的双引号写法,以正确处理路径。
  • 新增单元测试: 为 build_updater_batch 函数添加了单元测试,确保更新脚本中的路径引用逻辑正确。
Changelog
  • src-tauri/src/services/update.rs
    • 调整了 build_updater_batch 函数中生成批处理脚本时,清理临时文件命令的路径引用方式,将 \" 替换为 "",以兼容 cmd.exe
    • build_updater_batch 函数添加了新的单元测试,以验证 Windows 更新脚本中路径引用的正确性。
    • 格式化了 UpdatePaths 结构体的初始化代码,使其更易读。
Activity
  • 此拉取请求尚未有任何人工活动(如评论或审查)。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

你好!感谢你对 Windows 更新脚本的修复。通过使用 "" 来转义路径,你解决了 cmd.exe 中一个常见的引号处理问题,这无疑会提高更新过程的稳定性。我还注意到你为此更改添加了单元测试,这是一个非常好的实践,值得称赞。

我发现了一个与引号相关的小问题,可能会导致批处理脚本在某些情况下失败。我在代码中留下了具体的修改建议。请查看。

Comment on lines +136 to +138
assert!(content.contains(
r#"if exist ""C:\Temp\endfield-cat-update"" rd /s /q ""C:\Temp\endfield-cat-update""""#
));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

这个测试断言似乎也受到了批处理命令中多余引号的影响。断言检查的字符串末尾包含了四个双引号,而根据修正后的命令,它应该只包含两个双引号。

为了与代码的修复保持一致,请更新此断言。

Suggested change
assert!(content.contains(
r#"if exist ""C:\Temp\endfield-cat-update"" rd /s /q ""C:\Temp\endfield-cat-update""""#
));
assert!(content.contains(
r#"if exist ""C:\Temp\endfield-cat-update"" rd /s /q ""C:\Temp\endfield-cat-update"""#
));

@YueerMoe YueerMoe marked this pull request as draft February 8, 2026 17:59
@YueerMoe YueerMoe marked this pull request as ready for review February 9, 2026 14:13
@YueerMoe YueerMoe merged commit db847f2 into master Feb 9, 2026
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