Skip to content

feat: add CKB dependency check and dialog for Visual C++ Redistributable#3498

Open
chenyukang wants to merge 1 commit into
developfrom
fix/vcredist-version-check
Open

feat: add CKB dependency check and dialog for Visual C++ Redistributable#3498
chenyukang wants to merge 1 commit into
developfrom
fix/vcredist-version-check

Conversation

@chenyukang

Copy link
Copy Markdown
Contributor

Summary

Fix bundled CKB startup handling when Microsoft Visual C++ Redistributable is missing or outdated on Windows.

Changes

  • Check the installed x64 VC++ Redistributable version instead of only checking whether the registry key exists.
  • Require VC++ Redistributable version 14.44.0.0 or newer.
  • Show the existing CKB dependency dialog when bundled CKB reports a VC++ Redistributable version error at runtime.
  • Update the dependency dialog copy to mention both missing and outdated runtimes.
  • Add tests for version parsing, preflight checks, and runtime stderr detection.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Windows handling for starting the bundled CKB node when the Microsoft Visual C++ Redistributable (x64) is missing or below the required minimum, by adding version-aware preflight checks and runtime stderr detection that triggers the existing dependency dialog.

Changes:

  • Add registry output parsing + numeric version comparison and enforce MINIMUM_REDIST_VERSION during the Windows preflight check.
  • Introduce a shared “CKB dependency” dialog utility and wire runtime detection (stderr) via a new RxJS subject to show the dialog.
  • Add/extend unit tests for version parsing/comparison and for triggering the dependency dialog flows; update i18n copy to mention “missing or too old”.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/neuron-wallet/src/utils/redist-check.ts Replace “registry key exists” check with version-aware support check and export helper utilities/constants.
packages/neuron-wallet/tests/utils/redist-check/index.test.ts Add unit tests for version parsing/comparison and expand win32/not-win32 behavior coverage.
packages/neuron-wallet/src/utils/ckb-dependency-dialog.ts Extract dependency dialog + URL opening + quit behavior into a shared utility.
packages/neuron-wallet/src/services/node.ts Reuse the extracted dependency dialog utility instead of inlining the Electron dialog logic.
packages/neuron-wallet/src/models/subjects/ckb-dependency.ts Add a new subject to notify the app when CKB reports a dependency problem at runtime.
packages/neuron-wallet/src/services/ckb-runner.ts Detect VC++ redistributable version errors from bundled CKB stderr and notify via the new subject.
packages/neuron-wallet/src/controllers/app/subscribe.ts Subscribe to the new dependency subject to stop monitoring and show the dependency dialog once.
packages/neuron-wallet/tests/services/node.test.ts Add a test ensuring the dependency dialog is shown and node startup is skipped when preflight fails.
packages/neuron-wallet/tests/services/ckb-runner.test.ts Add tests for VC++ error detection and subject notification from stderr.
packages/neuron-wallet/src/locales/en.ts Update dependency dialog copy to mention missing/outdated runtimes.
packages/neuron-wallet/src/locales/zh.ts Update dependency dialog copy to mention missing/outdated runtimes (Chinese).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +17 to +21
const setPlatform = (platform: string) => {
Object.defineProperty(process, 'platform', {
value: platform,
})
}
Comment on lines +140 to +145
try {
stopMonitor('ckb')
await showCkbDependencyDialog()
} finally {
isShowingCkbDependencyDialog = false
}
Comment on lines +35 to +37
export const isVcredistVersionError = (message: string) => {
return /(?:VC\+\+|Visual C\+\+) Redistributable/i.test(message) && /Version is below|download\/upgrade/i.test(message)
}
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.

3 participants