feat(installer): auto-install WebView2 Runtime during Windows setup#3120
feat(installer): auto-install WebView2 Runtime during Windows setup#3120yyyzl wants to merge 2 commits intoagentscope-ai:mainfrom
Conversation
|
Hi @yyyzl, thank you for your first Pull Request! 🎉 🙌 Join Developer CommunityThanks so much for your contribution! We'd love to invite you to join the official CoPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page: We truly appreciate your enthusiasm—and look forward to your future contributions! 😊 We'll review your PR soon. |
There was a problem hiding this comment.
Code Review
This pull request adds automated detection and installation of the WebView2 Runtime to the NSIS installer script. The review identified several critical issues: the registry detection logic fails to account for 64-bit registry redirection, the use of the NSISdl plugin is incompatible with the provided HTTPS/redirected URL, and the installer fails to validate the exit code of the WebView2 bootstrapper. It is recommended to use SetRegView for registry checks, switch to the inetc plugin for secure downloads, and implement explicit exit code validation to ensure the runtime is correctly installed.
There was a problem hiding this comment.
Pull request overview
Adds a Windows installer-time safety measure to reduce first-run failures of CoPaw Desktop by ensuring the Microsoft Edge WebView2 Runtime is present during NSIS setup.
Changes:
- Adds WebView2 Runtime registry detection to the NSIS installer.
- If missing, downloads Microsoft’s Evergreen WebView2 bootstrapper and runs a silent install.
- If download fails, shows a manual-install MessageBox and continues installing CoPaw.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@rayrayraykk Friendly ping 🙏 Same as #3119 — bot feedback addressed in |
|
Currently, when the code detects that WebView2 is missing or the installation has failed, it simply displays an English error message. Clicking “OK” causes the installation of the main program to proceed immediately. This approach poses a significant risk to the user experience, and we recommend optimizing the error messaging and workflow.
|
|
感谢反馈,这个问题确实存在 👍 我倾向于采用方案一(交互引导),理由:
具体改动计划:
如果你对这个方案没有补充意见,我这边就开始改了。 |
|
已提交修复:b4e0ad9 改动内容:
请 review,如有需要调整的地方请随时提出。 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Detect WebView2 Runtime via registry before installing CoPaw Desktop. If missing, download the official Microsoft Bootstrapper (~1.8 MB) and run it silently — no admin rights needed since the installer already uses per-user installation. If the download fails (e.g. no network), a message box directs the user to install manually. This complements the runtime fail-fast check in desktop_cmd.py so that most users never see the "WebView2 not found" error at launch time.
63c515a to
c791a84
Compare
|
@celestialhorse51D Rebased onto latest
The 4 previous commits were consolidated into a single commit ( |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…t code - Re-run _DetectWebView2 after bootstrapper to check actual install state instead of relying solely on process exit code (which may be non-zero for reboot-required or other non-failure cases) - Gate post-install reminder on actual WebView2 absence, not just $R9 flag - Update GUID comment to reference agentscope-ai#3119 explicitly
|
@celestialhorse51D New commit d76eafd — based on Copilot feedback, improved the WebView2 install verification:
No changes to the Chinese interactive prompt logic from your earlier feedback. |
Description
Follow-up to #3119. While #3119 adds a runtime fail-fast check that turns the silent white-screen into a clear error message, this PR goes one step further by automatically installing WebView2 Runtime during the Windows NSIS installer, so most users never encounter the error at all.
How it works:
0.0.0.0filtering asdesktop_cmd.py)NSISdl::downloadand run it with/silent /installMessageBoxdirecting the user to install manuallyKey design decisions:
RequestExecutionLevel userin the NSIS configRelated Issue: Relates to #3119
Security Considerations: The bootstrapper is downloaded from Microsoft's official redirect URL (
go.microsoft.com/fwlink/p/?LinkId=2124703). No third-party sources.Type of Change
Component(s) Affected
Checklist
pre-commit run --all-fileslocally and it passespytestor as relevant) and they passTesting
desktop-release.ymlworkflow usesnegrutiu/nsis-install@v2which includesNSISdlplugin;makensisshould compile successfullyRecommended test environment: Alibaba Cloud Wuying (无影云电脑) or a clean Windows VM without Edge/WebView2.
Local Verification Evidence
Additional Notes
src/copaw/cli/desktop_cmd.py— both use{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}NSISdlis a built-in NSIS plugin, no extra dependencies needed-WebView2) ensures it runs automatically without appearing in the component selection UI