feat(msvc): add usage guide and fix VS2026 toolset mapping#9
Conversation
- Add comprehensive MSVC usage guide documentation (assets/docs/msvc-usage.md) - Add usage guide modal window in installer UI for Visual Studio IDEs - Fix VS2026 toolset mapping: 14.5x now correctly identified as v145 (Microsoft skipped v144, went directly from v143 to v145) - Update fallback logic in getMsvcToolsetInfo to handle v145 toolset BREAKING CHANGE: Remove VS2010 support - Change VS2010 supported flag from true to false - Remove VS2010-specific installation logic in libDirMapping - Update unsupported VS guide to include VS2010 - VS2010 lib files were removed in previous work (23.7% size reduction)
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Walkthrough新增 MSVC 使用文档与 UI 指南,扩展 MSVC 版本检测以包含 VS2026 映射,简化旧版(vs-legacy)安装路径逻辑,并在安装器界面中加入 MSVC 指南模态与相关交互处理函数。 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Detector as "detector.js"
participant Installer as "installer.js"
participant UI as "ui.js / setup.hta"
participant Docs as "assets/docs/msvc-usage.md"
User->>Detector: 启动检测(detectVS 等)
Detector-->>User: 返回 MSVC 版本映射(含 VS2026)
User->>Installer: 请求安装/选择 MSVC
Installer-->>User: 完成安装并返回结果
Installer->>UI: 触发显示安装成功(包含 msvc 类型)
UI->>User: 显示 MSVC 使用说明按钮/模态
User->>UI: 点击“查看完整文档”
UI->>Docs: 打开 `msvc-usage.md`(外部浏览或本地查看)
Docs-->>User: 展示 MSVC 使用说明
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
兔子诗
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Auggie review |
🤖 Augment PR SummarySummary: This PR adds a Visual Studio/MSVC usage guide to the installer and fixes MSVC toolset detection for the VS2026 toolchain. Changes:
Technical Notes: Toolset detection extracts a 2-digit “minor” key from MSVC version strings (e.g., 🤖 Was this summary useful? React with 👍 or 👎 |
src/ui.js
Outdated
| // 检查是否有使用说明(CodeBlocks、Dev-C++、Red Panda) | ||
| var hasUsageGuide = ide.type === 'codeblocks' || ide.type === 'devcpp' || ide.type === 'redpanda'; | ||
| // 检查是否有使用说明(CodeBlocks、Dev-C++、Red Panda、MSVC) | ||
| var hasUsageGuide = ide.type === 'codeblocks' || ide.type === 'devcpp' || ide.type === 'redpanda' || ide.type === 'vs' || ide.type === 'vs-legacy'; |
There was a problem hiding this comment.
For unsupported VS entries (ide.supported === false), hasUsageGuide is still true for vs/vs-legacy, so the UI shows a “使用说明” button alongside “安装说明”. Consider gating this by supported (or routing showUsageGuide to showUnsupportedVSGuide) to avoid implying unsupported versions can be used.
Severity: medium
Other Locations
src/ui.js:1419
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| */ | ||
| function openMsvcFullDocs() { | ||
| try { | ||
| shell.Run('https://github.com/x-ege/ege-installer/blob/main/assets/docs/msvc-usage.md'); |
There was a problem hiding this comment.
openMsvcFullDocs() hard-codes a GitHub blob/main URL, so the guide may drift from the installer version and it won’t work offline/in restricted networks. Consider whether this should instead open a version-pinned URL or a bundled/local doc.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@assets/docs/msvc-usage.md`:
- Around line 7-9: The two separate blockquote lines ("**提示**:如果您还未安装
EGE,请先使用安装程序将 EGE 安装到 Visual Studio。" and "**✨ 优势**:Visual Studio 使用 EGE
无需手动配置链接器选项,自动链接所需库文件!") are separated by a blank line causing markdownlint
MD028; either remove the blank line to merge them into a single blockquote or
convert the separation into a non-blockquote divider (e.g., plain paragraph or
horizontal rule) depending on whether you want one combined quote or two
distinct blocks—edit the blockquote lines in assets/docs/msvc-usage.md
accordingly.
🧹 Nitpick comments (3)
assets/docs/msvc-usage.md (1)
165-179: 版本支持范围描述存在歧义第 169 行声明支持 VS 2017-2026,第 173 行将 VS 2010-2015 列为不支持。但根据
detector.js中vsVersions配置,VS2015 (supported: false) 和 VS2010 (supported: false) 一样标记为不支持,而 VS2017 是第一个supported: true的版本。这里内容与代码一致,没有问题。不过第 191 行 FAQ 中说"不支持 VS 2015 及更早的版本",而第 173 行把 2010-2015 归为一组、2006-2008 归为另一组。建议统一描述风格,避免用户混淆这两个分组的差异。
src/setup.hta (1)
1487-1489: MSVC 模态窗口复用了codeblocks-guide-modal样式类第 1489 行
class="modal codeblocks-guide-modal"复用了 CodeBlocks 的样式类。功能上没有问题,但类名具有误导性。建议提取一个通用的样式类(如ide-guide-modal),让 CodeBlocks、Dev-C++ 和 MSVC 的模态窗口共用,避免语义混淆。src/ui.js (1)
696-738: VS 安装成功后缺少"查看使用说明"按钮提示当前
proceedWithInstall的回调中,CodeBlocks、Dev-C++、Red Panda 安装成功后都会在安装完成模态框中显示"查看使用说明"按钮。但 VS/MSVC 安装成功后没有对应的逻辑显示 MSVC 使用说明按钮。虽然用户可以从主界面的 IDE 列表中点击"使用说明"访问,但为了体验一致性,建议在 VS 安装成功后也显示该按钮。
建议在 Red Panda 逻辑块之后添加 MSVC 处理
// 如果是 Red Panda 安装成功,显示"查看使用说明"按钮 var isRedPanda = ide.type === 'redpanda'; if (isRedPanda && success) { document.getElementById('modalGuideBtn').style.display = 'inline-block'; document.getElementById('modalGuideBtn').onclick = function () { showRedPandaGuideModal(); }; modalLog('', ''); modalLog('💡 提示:可以点击下方的"查看使用说明"按钮查看详细使用指南', 'info'); } + // 如果是 MSVC/Visual Studio 安装成功,显示"查看使用说明"按钮 + var isMsvc = ide.type === 'vs' || ide.type === 'vs-legacy'; + if (isMsvc && success) { + document.getElementById('modalGuideBtn').style.display = 'inline-block'; + document.getElementById('modalGuideBtn').onclick = function () { showMsvcGuideModal(); }; + modalLog('', ''); + modalLog('💡 提示:可以点击下方的"查看使用说明"按钮查看详细使用指南', 'info'); + } + enableModalClose();
| > **提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。 | ||
|
|
||
| > **✨ 优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件! |
There was a problem hiding this comment.
修复 blockquote 之间的空行(markdownlint MD028)
第 7 行和第 9 行是两个独立的 blockquote,中间有空行,markdownlint 会报 MD028 警告。如果希望它们在视觉上为同一引用块,可以合并;如果希望分开,建议使用非 blockquote 的分隔方式。
建议合并为同一个 blockquote
-> **提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。
-
-> **✨ 优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件!
+> **提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。
+>
+> **✨ 优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件!📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| > **提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。 | |
| > **✨ 优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件! | |
| > **提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。 | |
| > | |
| > **✨ 优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件! |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)
[warning] 8-8: Blank line inside blockquote
(MD028, no-blanks-blockquote)
🤖 Prompt for AI Agents
In `@assets/docs/msvc-usage.md` around lines 7 - 9, The two separate blockquote
lines ("**提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。" and "**✨
优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件!") are separated by a blank line
causing markdownlint MD028; either remove the blank line to merge them into a
single blockquote or convert the separation into a non-blockquote divider (e.g.,
plain paragraph or horizontal rule) depending on whether you want one combined
quote or two distinct blocks—edit the blockquote lines in
assets/docs/msvc-usage.md accordingly.
There was a problem hiding this comment.
Pull request overview
This PR improves the Visual Studio (MSVC) experience in the EGE installer by adding an MSVC usage guide (UI modal + full markdown doc), fixing VS2026 (v145) toolset detection, and removing VS2010 support.
Changes:
- Add MSVC/Visual Studio usage documentation (
assets/docs/msvc-usage.md) and a new “usage guide” modal in the HTA UI. - Fix MSVC toolset mapping so 14.5x is recognized as v145 (VS2026), including updated fallback logic.
- Mark VS2010 as unsupported and remove VS2010-specific install path handling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/detector.js | Updates MSVC toolset mapping and fallback to correctly classify VS2026/v145; marks VS2010 unsupported. |
| src/installer.js | Removes VS2010 special-case library directory handling; adjusts legacy VS mapping behavior. |
| src/setup.hta | Updates unsupported VS messaging and adds a new MSVC usage guide modal. |
| src/ui.js | Enables usage guide entry for VS items; adds MSVC modal open/close + ESC close support. |
| assets/docs/msvc-usage.md | Adds a comprehensive MSVC usage guide (project creation, examples, troubleshooting). |
Comments suppressed due to low confidence (1)
src/ui.js:520
hasUsageGuide现在对vs/vs-legacy也返回 true,会让不支持的 VS(supported === false)同时出现“使用说明”和“不支持版本安装说明”两个入口;并且“使用说明”会打开 MSVC 指南,容易误导用户以为这些版本可用。建议:对不支持的 VS 不显示“使用说明”按钮,或在hasUsageGuide中额外要求ide.supported !== false。
// 检查是否有使用说明(CodeBlocks、Dev-C++、Red Panda、MSVC)
var hasUsageGuide = ide.type === 'codeblocks' || ide.type === 'devcpp' || ide.type === 'redpanda' || ide.type === 'vs' || ide.type === 'vs-legacy';
var html = '<div class="ide-item" id="' + prefix + '_' + index + '">';
html += '<div class="ide-info">';
// Code::Blocks 无编译器警告标识
var cbNoCompiler = ide.type === 'codeblocks' && ide.found && (!ide.includePath || !ide.libPath);
html += '<div class="ide-name">' + ide.name;
if (cbNoCompiler) {
html += '<span class="cb-warning-icon" title="此 Code::Blocks 未自带编译器,将只安装项目模板">无编译器</span>';
}
html += '</div>';
// 对于有 msvcPath 的项(不同工具集),显示完整工具集路径;否则显示 IDE 路径
var displayPath = ide.msvcPath || ide.path || '未安装';
html += '<div class="ide-path">' + displayPath + '</div>';
html += '</div>';
// 状态显示:未安装时显示状态标签,已安装时不显示
if (!ide.egeInstalled || !ide.found) {
html += '<span class="ide-status ' + statusClass + '">' + statusText + '</span>';
}
html += '<div class="ide-actions">';
// 使用说明按钮(CodeBlocks、Dev-C++、Red Panda 始终显示,无论是否安装)
if (hasUsageGuide) {
html += '<button class="btn btn-guide" onclick="showUsageGuide(' + index + ', ' + isFound + ')">使用说明</button>';
}
| // MSVC/Visual Studio 显示使用说明 | ||
| if (type === 'vs' || type === 'vs-legacy') { | ||
| showMsvcGuideModal(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
showUsageGuide 对 vs-legacy 无条件显示 MSVC 指南,但 vs-legacy 包含 VS2010~2015 且在 detector 中标记为不支持。建议在这里优先判断 ide.supported === false 并改为打开 showUnsupportedVSGuide()(或直接 return),避免给不支持版本展示“可用”的使用指南。
| <div id="msvcGuideModal" class="modal-overlay" onclick="handleModalOverlayClick(event, 'msvcGuideModal')"> | ||
| <div class="modal codeblocks-guide-modal"> | ||
| <div class="modal-header"> |
There was a problem hiding this comment.
MSVC 使用说明窗口复用了 codeblocks-guide-modal 样式类,这会把 Code::Blocks 的配色/尺寸规则耦合到 MSVC 模态框上,后续调整任意一个都会影响另一个。建议改用已有的 guide-modal-common,并为 MSVC 单独加一个 msvc-guide-modal(只覆盖 header 渐变等差异)。
| // VS2010~VS2015 已不再支持(supported: false,正常流程不会走到这里) | ||
| log(" 警告: " + ide.name + " 已不被支持,请升级到 VS2017+", "warning"); | ||
| return { | ||
| "x86": "msvc", | ||
| "x64": "msvc" | ||
| }; |
There was a problem hiding this comment.
vs-legacy 已标记为不支持,但这里仍返回 msvc 并继续走安装流程;而 install()/installToIDE() 内没有检查 ide.supported,因此一旦通过其他入口传入 vs-legacy(例如后续批量安装/脚本调用),会尝试向 VS2010~2015 安装不兼容的库。建议在安装入口处显式拒绝 supported === false(直接失败并提示升级),而不是返回可安装的 lib mapping。
| // VS2010~VS2015 已不再支持(supported: false,正常流程不会走到这里) | |
| log(" 警告: " + ide.name + " 已不被支持,请升级到 VS2017+", "warning"); | |
| return { | |
| "x86": "msvc", | |
| "x64": "msvc" | |
| }; | |
| // VS2010~VS2015 已不再支持;安装入口处应直接拒绝,避免安装不兼容库 | |
| log(" 错误: " + ide.name + " 已不被支持,请升级到 Visual Studio 2017 或更高版本。", "error"); | |
| // 显式中止安装流程,而不是返回可用的库目录映射 | |
| throw new Error("Unsupported IDE detected: " + ide.name + ". Please upgrade to Visual Studio 2017 or later."); |
- Fix MD028: merge blockquotes in msvc-usage.md - Hide usage guide button for unsupported VS versions (VS2010/2012-2015) - Add usage guide button after MSVC installation success for consistency
- Rename .codeblocks-guide-modal to .large-guide-modal for better semantics - This CSS class is shared by CodeBlocks, Dev-C++, and MSVC usage guides - The new name better represents its purpose as a large detailed guide modal - Addresses CodeRabbit's review feedback about misleading class name
📝 更改摘要
本 PR 为 Visual Studio 系列 IDE 添加了完整的使用说明,修复了 VS2026 工具集映射 bug,并移除了对 VS2010 的支持。
✨ 新增功能
🐛 Bug 修复
getMsvcToolsetInfo中的兜底逻辑以正确处理 v145 工具集💥 破坏性变更
移除 VS2010 支持
supported标志从true改为falseinstaller.js中 VS2010 特殊安装逻辑📊 影响范围
修改的文件:
src/detector.js- 添加 v145 映射,更新兜底逻辑,VS2010 标记为不支持src/installer.js- 移除 VS2010 特殊处理逻辑src/setup.hta- 添加 MSVC 使用说明模态窗口src/ui.js- 添加 MSVC 使用说明相关函数assets/docs/msvc-usage.md- 新增文件,完整的 MSVC 使用指南统计:
✅ 测试
🔗 相关资源
Summary by CodeRabbit
发布说明
文档
新功能
改进