Update Cursor version support in README and Windows script

- Updated README files to indicate support for Cursor 0.45.x on Windows
- Added version detection function in Windows PowerShell script
- Improved version information display and user guidance
- Marked Mac/Linux 0.45.x support as under testing
This commit is contained in:
煎饼果子卷鲨鱼辣椒 2025-02-04 22:11:38 +08:00
parent e9bcc02a10
commit fe5c1253e9
3 changed files with 44 additions and 39 deletions

View File

@ -16,7 +16,8 @@
>
> This tool currently supports:
> - ✅ Cursor v0.44.11 and below
> - ❌ Latest 0.45.x versions (temporarily unsupported)
> - ✅ Windows: Latest 0.45.x versions (Supported)
> - ⚠️ Mac/Linux: Latest 0.45.x versions (Under testing)
>
> Please check your Cursor version before using this tool.

View File

@ -16,7 +16,8 @@
>
> 本工具当前支持版本:
> - ✅ Cursor v0.44.11 及以下版本
> - ❌ 最新的 0.45.x 版本(暂不支持)
> - ✅ Windows: 最新的 0.45.x 版本(已支持)
> - ⚠️ Mac/Linux: 最新的 0.45.x 版本(测试中)
>
> 使用前请确认您的 Cursor 版本。

View File

@ -43,8 +43,46 @@ Write-Host "$BLUE================================$NC"
Write-Host "$GREEN Cursor ID 修改工具 $NC"
Write-Host "$BLUE================================$NC"
Write-Host ""
Write-Host "$YELLOW[重要提示]$NC 本工具仅支持 Cursor v0.44.11 及以下版本"
Write-Host "$YELLOW[重要提示]$NC 最新的 0.45.x 版本暂不支持"
# 获取并显示 Cursor 版本
function Get-CursorVersion {
try {
# 主要检测路径
$packagePath = "$env:LOCALAPPDATA\Programs\cursor\resources\app\package.json"
if (Test-Path $packagePath) {
$packageJson = Get-Content $packagePath -Raw | ConvertFrom-Json
if ($packageJson.version) {
Write-Host "$GREEN[信息]$NC 当前安装的 Cursor 版本: v$($packageJson.version)"
return $packageJson.version
}
}
# 备用路径检测
$altPath = "$env:LOCALAPPDATA\cursor\resources\app\package.json"
if (Test-Path $altPath) {
$packageJson = Get-Content $altPath -Raw | ConvertFrom-Json
if ($packageJson.version) {
Write-Host "$GREEN[信息]$NC 当前安装的 Cursor 版本: v$($packageJson.version)"
return $packageJson.version
}
}
Write-Host "$YELLOW[警告]$NC 无法检测到 Cursor 版本"
Write-Host "$YELLOW[提示]$NC 请确保 Cursor 已正确安装"
return $null
}
catch {
Write-Host "$RED[错误]$NC 获取 Cursor 版本失败: $_"
return $null
}
}
# 获取并显示版本信息
$cursorVersion = Get-CursorVersion
Write-Host ""
Write-Host "$YELLOW[重要提示]$NC 最新的 0.45.x (以支持)"
Write-Host ""
# 检查并关闭 Cursor 进程
@ -171,8 +209,6 @@ function Update-MachineGuid {
}
}
# 创建或更新配置文件
Write-Host "$GREEN[信息]$NC 正在更新配置..."
@ -422,39 +458,6 @@ function Write-ConfigFile {
}
}
function Get-CursorVersion {
try {
# 主要检测路径
$packagePath = "$env:LOCALAPPDATA\Programs\cursor\resources\app\package.json"
if (Test-Path $packagePath) {
$packageJson = Get-Content $packagePath -Raw | ConvertFrom-Json
if ($packageJson.version) {
Write-Host "$GREEN[信息]$NC 检测到 Cursor 版本: $($packageJson.version)"
return $packageJson.version
}
}
# 备用路径检测
$altPath = "$env:LOCALAPPDATA\cursor\resources\app\package.json"
if (Test-Path $altPath) {
$packageJson = Get-Content $altPath -Raw | ConvertFrom-Json
if ($packageJson.version) {
Write-Host "$GREEN[信息]$NC 检测到 Cursor 版本: $($packageJson.version)"
return $packageJson.version
}
}
Write-Host "$YELLOW[警告]$NC 无法检测到 Cursor 版本"
Write-Host "$YELLOW[提示]$NC 请确保 Cursor 已正确安装"
return $null
}
catch {
Write-Host "$RED[错误]$NC 获取 Cursor 版本失败: $_"
return $null
}
}
function Compare-Version {
param (
[string]$version1,