diff --git a/README.md b/README.md index ccdc533..596f3f6 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/README_CN.md b/README_CN.md index 03f26b4..f6e28ae 100644 --- a/README_CN.md +++ b/README_CN.md @@ -16,7 +16,8 @@ > > 本工具当前支持版本: > - ✅ Cursor v0.44.11 及以下版本 -> - ❌ 最新的 0.45.x 版本(暂不支持) +> - ✅ Windows: 最新的 0.45.x 版本(已支持) +> - ⚠️ Mac/Linux: 最新的 0.45.x 版本(测试中) > > 使用前请确认您的 Cursor 版本。 diff --git a/scripts/run/cursor_win_id_modifier.ps1 b/scripts/run/cursor_win_id_modifier.ps1 index 7354d8e..72b061f 100644 --- a/scripts/run/cursor_win_id_modifier.ps1 +++ b/scripts/run/cursor_win_id_modifier.ps1 @@ -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,