Skip to content

fix:解决Windows平台下脚本失败问题#464

Merged
phantom5099 merged 2 commits into1024XEngineer:mainfrom
pionxe:main
Apr 26, 2026
Merged

fix:解决Windows平台下脚本失败问题#464
phantom5099 merged 2 commits into1024XEngineer:mainfrom
pionxe:main

Conversation

@pionxe
Copy link
Copy Markdown
Collaborator

@pionxe pionxe commented Apr 25, 2026

原因:在基于较老版本 .NET Framework 的 PowerShell 5.1 中,[System.Runtime.InteropServices.RuntimeInformation] 类的 ProcessArchitecture 属性可能未定义或无法正确求值,从而向脚本返回 。

…System.Runtime.InteropServices.RuntimeInformation] 类的 ProcessArchitecture 属性可能未定义或无法正确求值,从而向脚本返回 。
Copy link
Copy Markdown

@fennoai fennoai Bot left a comment

Choose a reason for hiding this comment

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

Reviewed in 4 passes (code quality, performance, security, documentation). One noteworthy issue found after deduplication.

Comment thread scripts/install.ps1 Outdated
}

$Architecture = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToUpperInvariant()
$Architecture = $env:PROCESSOR_ARCHITECTURE.ToUpperInvariant()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

$env:PROCESSOR_ARCHITECTURE reflects the current PowerShell process architecture, not always the OS architecture. In a 32-bit shell on a 64-bit OS this can be x86, causing an Unsupported architecture failure even when an x86_64 asset should be installable. Consider resolving architecture with PROCESSOR_ARCHITEW6432 (when set) before PROCESSOR_ARCHITECTURE, and add a null/empty guard before calling ToUpperInvariant().

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@phantom5099
Copy link
Copy Markdown
Collaborator

这边测试之后可以用了吗

@pionxe
Copy link
Copy Markdown
Collaborator Author

pionxe commented Apr 26, 2026

这边测试之后可以用了吗

可以,你可自行验证,将这次修改的脚本下载至本地,在powershell中使用.\install.ps1

@phantom5099 phantom5099 merged commit 26b3406 into 1024XEngineer:main Apr 26, 2026
3 checks passed
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.

2 participants