Skip to content

feat(msvc): add usage guide and fix VS2026 toolset mapping#9

Merged
wysaid merged 3 commits intomainfrom
msvc_usage
Feb 8, 2026
Merged

feat(msvc): add usage guide and fix VS2026 toolset mapping#9
wysaid merged 3 commits intomainfrom
msvc_usage

Conversation

@wysaid
Copy link
Copy Markdown
Contributor

@wysaid wysaid commented Feb 8, 2026

📝 更改摘要

本 PR 为 Visual Studio 系列 IDE 添加了完整的使用说明,修复了 VS2026 工具集映射 bug,并移除了对 VS2010 的支持。

✨ 新增功能

  • 新增 MSVC/Visual Studio 完整使用指南文档 (msvc-usage.md)
  • 在安装器 UI 中为 Visual Studio IDE 添加使用说明模态窗口
  • 模态窗口支持 ESC 键关闭

🐛 Bug 修复

  • 修复 VS2026 工具集映射问题:14.5x 现在正确识别为 v145
    • 之前 VS2026 (14.50) 被错误识别为 v143 (VS2022)
    • Microsoft 跳过了 v144,直接从 v143 跳到了 v145
  • 更新 getMsvcToolsetInfo 中的兜底逻辑以正确处理 v145 工具集

💥 破坏性变更

移除 VS2010 支持

  • VS2010 的 supported 标志从 true 改为 false
  • 移除 installer.js 中 VS2010 特殊安装逻辑
  • 更新不支持的 VS 版本指南,包含 VS2010
  • VS2010 库文件已在之前的工作中删除(减少 23.7% 的包体积)

📊 影响范围

修改的文件

  • src/detector.js - 添加 v145 映射,更新兜底逻辑,VS2010 标记为不支持
  • src/installer.js - 移除 VS2010 特殊处理逻辑
  • src/setup.hta - 添加 MSVC 使用说明模态窗口
  • src/ui.js - 添加 MSVC 使用说明相关函数
  • assets/docs/msvc-usage.md - 新增文件,完整的 MSVC 使用指南

统计

  • 5 files changed, 382 insertions(+), 42 deletions(-)

✅ 测试

  • 安装器正常运行
  • VS2026 工具集正确识别为 v145
  • MSVC 使用说明模态窗口正常显示
  • ESC 键可以关闭模态窗口
  • VS2010 显示为不支持状态

🔗 相关资源

Summary by CodeRabbit

发布说明

  • 文档

    • 新增 Visual Studio/MSVC 使用指南,包含快速入门、配置说明与常见问题。
  • 新功能

    • 在界面中添加 MSVC 使用指南模态框与“查看完整文档”入口。
    • 安装成功后显示 MSVC 使用按钮并可直接打开指南。
    • 支持 Visual Studio 2026 识别与展示。
  • 改进

    • 移除对 Visual Studio 2010 的支持提示。
    • 简化旧版 Visual Studio 的库路径处理与相关提示。

- 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)
Copilot AI review requested due to automatic review settings February 8, 2026 10:14
@wysaid wysaid added enhancement New feature or request documentation Improvements or additions to documentation labels Feb 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 8, 2026

Warning

Rate limit exceeded

@wysaid has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 50 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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

Cohort / File(s) Summary
MSVC 版本映射与检测
src/detector.js
新增对 VS2026 (toolset v145) 的映射(minor 50–59 -> v145/VS2026),将未知较新 minor 路径指向 v145,且将 VS2010 支持标记设为不支持。
安装器路径与库解析
src/installer.js
移除对 vs-legacy 的按版本分支,统一将 VS2010 与 VS2012–2015 视为不支持,简化库路径构造,固定按架构拼接目录。
UI 模态与交互逻辑
src/setup.hta, src/ui.js
在 setup 界面加入 MSVC 使用说明模态(重复插入模态块),并在 ui.js 中添加 MSVC 专用处理:showMsvcGuideModalcloseMsvcGuideopenMsvcFullDocs,并将 MSVC 类型纳入已有模态/ESC/overlay 处理流。
文档
assets/docs/msvc-usage.md
新增完整的 MSVC/Visual Studio 使用指南文档,包含创建说明、快速入门代码示例、项目配置与故障排除等。

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 使用说明
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

bug

兔子诗

🐰 新版编译来敲门,
检测映射添新篇;
指南模态跳窗现,
文档细述步步全,
老树退场嫩芽鲜。

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确反映了PR的主要变更:添加MSVC使用指南和修复VS2026工具集映射,这是PR的核心目标。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch msvc_usage

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wysaid
Copy link
Copy Markdown
Contributor Author

wysaid commented Feb 8, 2026

@Auggie review

@wysaid wysaid requested a review from yixy-only February 8, 2026 10:17
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Feb 8, 2026

🤖 Augment PR Summary

Summary: This PR adds a Visual Studio/MSVC usage guide to the installer and fixes MSVC toolset detection for the VS2026 toolchain.

Changes:

  • Adds a new end-user guide (assets/docs/msvc-usage.md) covering project creation, sample code, troubleshooting, and FAQs.
  • Updates MSVC toolset mapping so MSVC 14.50+ is recognized as v145 (VS2026), and adjusts the fallback mapping logic accordingly.
  • Marks Visual Studio 2010 as unsupported and removes VS2010-specific library directory handling from the installer.
  • Adds a new “Visual Studio EGE 使用指南” modal to the HTA UI, including an external link to the full documentation.
  • Extends the UI “使用说明” flow to show the guide for vs / vs-legacy entries and allows closing via ESC / overlay click.

Technical Notes: Toolset detection extracts a 2-digit “minor” key from MSVC version strings (e.g., 14.50.xxxxx50) and uses range-based fallbacks to avoid pointing to non-existent library directories.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

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';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 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');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.jsvsVersions 配置,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();

Comment on lines +7 to +9
> **提示**:如果您还未安装 EGE,请先使用安装程序将 EGE 安装到 Visual Studio。

> **✨ 优势**:Visual Studio 使用 EGE 无需手动配置链接器选项,自动链接所需库文件!
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

修复 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.

Suggested change
> **提示**:如果您还未安装 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.

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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>';
  }

Comment on lines +1418 to +1422
// MSVC/Visual Studio 显示使用说明
if (type === 'vs' || type === 'vs-legacy') {
showMsvcGuideModal();
return;
}
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

showUsageGuidevs-legacy 无条件显示 MSVC 指南,但 vs-legacy 包含 VS2010~2015 且在 detector 中标记为不支持。建议在这里优先判断 ide.supported === false 并改为打开 showUnsupportedVSGuide()(或直接 return),避免给不支持版本展示“可用”的使用指南。

Copilot uses AI. Check for mistakes.
Comment on lines +1488 to +1490
<div id="msvcGuideModal" class="modal-overlay" onclick="handleModalOverlayClick(event, 'msvcGuideModal')">
<div class="modal codeblocks-guide-modal">
<div class="modal-header">
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

MSVC 使用说明窗口复用了 codeblocks-guide-modal 样式类,这会把 Code::Blocks 的配色/尺寸规则耦合到 MSVC 模态框上,后续调整任意一个都会影响另一个。建议改用已有的 guide-modal-common,并为 MSVC 单独加一个 msvc-guide-modal(只覆盖 header 渐变等差异)。

Copilot uses AI. Check for mistakes.
Comment on lines +624 to +629
// VS2010~VS2015 已不再支持(supported: false,正常流程不会走到这里)
log(" 警告: " + ide.name + " 已不被支持,请升级到 VS2017+", "warning");
return {
"x86": "msvc",
"x64": "msvc"
};
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

vs-legacy 已标记为不支持,但这里仍返回 msvc 并继续走安装流程;而 install()/installToIDE() 内没有检查 ide.supported,因此一旦通过其他入口传入 vs-legacy(例如后续批量安装/脚本调用),会尝试向 VS2010~2015 安装不兼容的库。建议在安装入口处显式拒绝 supported === false(直接失败并提示升级),而不是返回可安装的 lib mapping。

Suggested change
// 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.");

Copilot uses AI. Check for mistakes.
- 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
@wysaid wysaid merged commit 8febc3e into main Feb 8, 2026
2 checks passed
@wysaid wysaid deleted the msvc_usage branch February 8, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants