From 3d1450ced08d3e7f5aecd08357a75b2003a1d331 Mon Sep 17 00:00:00 2001 From: yeongpin Date: Sun, 23 Mar 2025 21:13:08 +0800 Subject: [PATCH 1/8] Update CHANGELOG for v1.7.18 with fixes for write permissions and other issues. Add new translation keys for error messages in English and Chinese (Simplified and Traditional) locales. --- CHANGELOG.md | 4 ++++ locales/en.json | 4 ++-- locales/zh_cn.json | 3 ++- locales/zh_tw.json | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4355127..63b9d6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## v1.7.18 (Pre-Release) +1. Fix: No Write Permission | 修復沒有寫入權限 +2. Fix: Some Issues | 修復一些問題 + ## v1.7.17 1. Fix: Remove 10 options Totally Reset Cursor | 修復完全重置 Cursor 選項 diff --git a/locales/en.json b/locales/en.json index de6b1a2..1f40309 100644 --- a/locales/en.json +++ b/locales/en.json @@ -102,8 +102,8 @@ "package_not_found": "Package.json Not Found: {path}", "check_version_failed": "Check Version Failed: {error}", "stack_trace": "Stack Trace", - "version_too_low": "Cursor Version Too Low: {version} < 0.45.0" - + "version_too_low": "Cursor Version Too Low: {version} < 0.45.0", + "no_write_permission": "No Write Permission: {path}" }, "register": { "title": "Cursor Registration Tool", diff --git a/locales/zh_cn.json b/locales/zh_cn.json index 32a1fd1..728b025 100644 --- a/locales/zh_cn.json +++ b/locales/zh_cn.json @@ -102,7 +102,8 @@ "package_not_found": "package.json未找到: {path}", "check_version_failed": "检查版本失败: {error}", "stack_trace": "堆栈跟踪", - "version_too_low": "Cursor版本太低: {version} < 0.45.0" + "version_too_low": "Cursor版本太低: {version} < 0.45.0", + "no_write_permission": "没有写入权限: {path}" }, "register": { "title": "Cursor 注册工具", diff --git a/locales/zh_tw.json b/locales/zh_tw.json index e904c19..cdc9eeb 100644 --- a/locales/zh_tw.json +++ b/locales/zh_tw.json @@ -100,7 +100,8 @@ "package_not_found": "package.json未找到: {path}", "check_version_failed": "檢查版本失敗: {error}", "stack_trace": "堆疊跟踪", - "version_too_low": "Cursor版本太低: {version} < 0.45.0" + "version_too_low": "Cursor版本太低: {version} < 0.45.0", + "no_write_permission": "沒有寫入權限: {path}" }, "register": { From 8943266f6e21d34aafc7d1b4dc9ec1fbbcff039f Mon Sep 17 00:00:00 2001 From: Nigel1992 Date: Mon, 24 Mar 2025 23:01:24 +0100 Subject: [PATCH 2/8] fix: Improve Linux path detection and config handling --- reset_machine_manual.py | 52 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/reset_machine_manual.py b/reset_machine_manual.py index 975c6bd..c9f383f 100644 --- a/reset_machine_manual.py +++ b/reset_machine_manual.py @@ -37,10 +37,41 @@ def get_cursor_paths(translator=None) -> Tuple[str, str]: config_dir = os.path.join(get_user_documents_path(), ".cursor-free-vip") config_file = os.path.join(config_dir, "config.ini") + # Create config directory if it doesn't exist + if not os.path.exists(config_dir): + os.makedirs(config_dir) + + # Default paths for different systems + default_paths = { + "Darwin": "/Applications/Cursor.app/Contents/Resources/app", + "Windows": os.path.join(os.getenv("LOCALAPPDATA", ""), "Programs", "Cursor", "resources", "app"), + "Linux": ["/opt/Cursor/resources/app", "/usr/share/cursor/resources/app", os.path.expanduser("~/.local/share/cursor/resources/app")] + } + + # If config doesn't exist, create it with default paths if not os.path.exists(config_file): - raise OSError(translator.get('reset.config_not_found') if translator else "找不到配置文件") + for section in ['MacPaths', 'WindowsPaths', 'LinuxPaths']: + if not config.has_section(section): + config.add_section(section) - config.read(config_file, encoding='utf-8') # Specify encoding + if system == "Darwin": + config.set('MacPaths', 'cursor_path', default_paths["Darwin"]) + elif system == "Windows": + config.set('WindowsPaths', 'cursor_path', default_paths["Windows"]) + elif system == "Linux": + # For Linux, try to find the first existing path + for path in default_paths["Linux"]: + if os.path.exists(path): + config.set('LinuxPaths', 'cursor_path', path) + break + else: + # If no path exists, use the first one as default + config.set('LinuxPaths', 'cursor_path', default_paths["Linux"][0]) + + with open(config_file, 'w', encoding='utf-8') as f: + config.write(f) + else: + config.read(config_file, encoding='utf-8') # Get path based on system if system == "Darwin": @@ -51,15 +82,26 @@ def get_cursor_paths(translator=None) -> Tuple[str, str]: section = 'LinuxPaths' else: raise OSError(translator.get('reset.unsupported_os', system=system) if translator else f"不支持的操作系统: {system}") - + if not config.has_section(section) or not config.has_option(section, 'cursor_path'): raise OSError(translator.get('reset.path_not_configured') if translator else "未配置 Cursor 路徑") - + base_path = config.get(section, 'cursor_path') + # For Linux, try to find the first existing path if the configured one doesn't exist + if system == "Linux" and not os.path.exists(base_path): + for path in default_paths["Linux"]: + if os.path.exists(path): + base_path = path + # Update config with the found path + config.set(section, 'cursor_path', path) + with open(config_file, 'w', encoding='utf-8') as f: + config.write(f) + break + if not os.path.exists(base_path): raise OSError(translator.get('reset.path_not_found', path=base_path) if translator else f"找不到 Cursor 路徑: {base_path}") - + pkg_path = os.path.join(base_path, "package.json") main_path = os.path.join(base_path, "out/main.js") From a8966de771a1ef3c32c709fcd846eca046bd55f1 Mon Sep 17 00:00:00 2001 From: yeongpin Date: Tue, 25 Mar 2025 06:37:20 +0800 Subject: [PATCH 3/8] Add new translation key for 'path_not_found' in English and Chinese (Simplified and Traditional) locales, ensuring consistent error messaging across languages. --- locales/en.json | 3 ++- locales/zh_cn.json | 3 ++- locales/zh_tw.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/locales/en.json b/locales/en.json index 6054903..82bbc21 100644 --- a/locales/en.json +++ b/locales/en.json @@ -104,7 +104,8 @@ "check_version_failed": "Check Version Failed: {error}", "stack_trace": "Stack Trace", "version_too_low": "Cursor Version Too Low: {version} < 0.45.0", - "no_write_permission": "No Write Permission: {path}" + "no_write_permission": "No Write Permission: {path}", + "path_not_found": "Path Not Found: {path}" }, "register": { "title": "Cursor Registration Tool", diff --git a/locales/zh_cn.json b/locales/zh_cn.json index 992e854..96f4b25 100644 --- a/locales/zh_cn.json +++ b/locales/zh_cn.json @@ -104,7 +104,8 @@ "check_version_failed": "检查版本失败: {error}", "stack_trace": "堆栈跟踪", "version_too_low": "Cursor版本太低: {version} < 0.45.0", - "no_write_permission": "没有写入权限: {path}" + "no_write_permission": "没有写入权限: {path}", + "path_not_found": "路径未找到: {path}" }, "register": { "title": "Cursor 注册工具", diff --git a/locales/zh_tw.json b/locales/zh_tw.json index 75b178e..6ab8447 100644 --- a/locales/zh_tw.json +++ b/locales/zh_tw.json @@ -102,7 +102,8 @@ "check_version_failed": "檢查版本失敗: {error}", "stack_trace": "堆疊跟踪", "version_too_low": "Cursor版本太低: {version} < 0.45.0", - "no_write_permission": "沒有寫入權限: {path}" + "no_write_permission": "沒有寫入權限: {path}", + "path_not_found": "路徑未找到: {path}" }, "register": { From eb6ef6bb3b898d0d4d52140a4aab5e4471f435d8 Mon Sep 17 00:00:00 2001 From: Pin Studios Date: Tue, 25 Mar 2025 06:51:28 +0800 Subject: [PATCH 4/8] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63b9d6f..1b481d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## v1.7.18 (Pre-Release) 1. Fix: No Write Permission | 修復沒有寫入權限 -2. Fix: Some Issues | 修復一些問題 +2. Fix: Improve Linux path detection and config handling | 修正 linux 路徑和config寫入讀取 +3. Fix: Locale path_no_exist missing | 修正 path_no_exist 語言遺失 +4. Fix: Some Issues | 修復一些問題 ## v1.7.17 1. Fix: Remove 10 options Totally Reset Cursor | 修復完全重置 Cursor 選項 From 4ef293da81b6ec940413b56488952cf9161879dd Mon Sep 17 00:00:00 2001 From: Pin Studios Date: Tue, 25 Mar 2025 06:52:29 +0800 Subject: [PATCH 5/8] Update .env --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 95a7d79..2a2c066 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -version=1.7.17 -VERSION=1.7.17 +version=1.7.18 +VERSION=1.7.18 From 80e99462947cf30c9621415bf2f5fcd1b94bed2e Mon Sep 17 00:00:00 2001 From: Pin Studios Date: Tue, 25 Mar 2025 16:12:04 +0800 Subject: [PATCH 6/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b481d7..d5e30ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log -## v1.7.18 (Pre-Release) +## v1.7.18 1. Fix: No Write Permission | 修復沒有寫入權限 2. Fix: Improve Linux path detection and config handling | 修正 linux 路徑和config寫入讀取 3. Fix: Locale path_no_exist missing | 修正 path_no_exist 語言遺失 From 7405c61cc9ec3af2bdc5fd7b12ca957e18624e70 Mon Sep 17 00:00:00 2001 From: Ali Asghar Ranjbar Date: Wed, 26 Mar 2025 08:26:56 +0330 Subject: [PATCH 7/8] fix: modified the change language option number --- logo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logo.py b/logo.py index 7a0faa6..83f4c76 100644 --- a/logo.py +++ b/logo.py @@ -83,7 +83,7 @@ muhammedfurkan plamkatawe """ OTHER_INFO_TEXT = f"""{Fore.YELLOW} Github: https://github.com/yeongpin/cursor-free-vip{Fore.RED} -Press 7 to change language | 按下 7 键切换语言{Style.RESET_ALL}""" +Press 8 to change language | 按下 8 键切换语言{Style.RESET_ALL}""" # center display LOGO and DESCRIPTION CURSOR_LOGO = center_multiline_text(LOGO_TEXT, handle_chinese=False) @@ -98,4 +98,4 @@ def print_logo(): print(CURSOR_OTHER_INFO) if __name__ == "__main__": - print_logo() \ No newline at end of file + print_logo() From 18fc0532fdfd4b0f9e5e2bba7640d4f05541f533 Mon Sep 17 00:00:00 2001 From: imbajin Date: Wed, 26 Mar 2025 18:24:10 +0800 Subject: [PATCH 8/8] fix: inconsistent message --- logo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logo.py b/logo.py index 7a0faa6..83f4c76 100644 --- a/logo.py +++ b/logo.py @@ -83,7 +83,7 @@ muhammedfurkan plamkatawe """ OTHER_INFO_TEXT = f"""{Fore.YELLOW} Github: https://github.com/yeongpin/cursor-free-vip{Fore.RED} -Press 7 to change language | 按下 7 键切换语言{Style.RESET_ALL}""" +Press 8 to change language | 按下 8 键切换语言{Style.RESET_ALL}""" # center display LOGO and DESCRIPTION CURSOR_LOGO = center_multiline_text(LOGO_TEXT, handle_chinese=False) @@ -98,4 +98,4 @@ def print_logo(): print(CURSOR_OTHER_INFO) if __name__ == "__main__": - print_logo() \ No newline at end of file + print_logo()