Skip to content

Releases

v17

Choose a tag to compare

@LeoOfGit LeoOfGit released this 25 Oct 09:14

🇺🇸 [v17] - WinGet De-elevation & Native Uninstaller Pipeline, Concurrent Pre-download Engine, PNPM Full Integration & Hybrid Management, Adaptive Task Monitor, Venv Repair Wizard, Package Search Delegate Redesign & Self-Hosting Guard

🇨🇳 [v17] - WinGet 用户级提权卸载双层保障、并发预下载引擎、PNPM 后端与全局混合纳管、自适应任务监控、虚拟环境修复向导、包搜索委托重构与宿主自保护 (中文说明)

本次 V17 版本是一次里程碑式的架构升级与体验飞跃。针对管理员模式下 WinGet 卸载用户级程序的底层限制,构建了“原生注册表卸载器 + Windows 令牌降权执行”的双层彻底清理保障;WinGet 批量更新引入了基于线程池的并发预下载流水线;Node.js 模块全面整合 pnpm 现代化包管理器并支持与 npm 全局包混合并存、精准路由;新增了自适应宽窄屏的任务监控浮窗;针对损坏的 Python 虚拟环境推出了三合一修复向导;全新重构了包搜索与添加对话框为轻量级原生 Delegate 架构,彻底消除列表点选迟滞与双击失效;同时引入了源码开发模式下的宿主环境文件锁自保护机制与 Wheel 离线下载/导出能力。

🛡️ WinGet 用户级程序提权卸载双层保障体系 (De-elevation & Native Uninstaller)

  • 核心痛点解决:OmniPack 默认以管理员权限启动以支撑系统级操作,但 WinGet 1.29+ 版本内置了安全拦截(0x8A15007D:禁止在提权上下文中卸载用户级应用),导致常规卸载强行中断。
  • 一级保障(ARP 原生卸载器解析):深度扫描 HKLM/HKCU 注册表卸载键值,精准定位应用原生卸载程序(UninstallString / QuietUninstallString)。针对 MSI 安装包自动转译为 MsiExec.exe /X {GUID},针对标准 EXE 卸载程序自动追加静默参数(/SILENT, /S, /qb),并通过 start "" /wait 保证在终端中同步等待,彻底清理应用程序文件、快捷方式与注册表,不留磁盘垃圾残留。
  • 二级保障(Windows 令牌降权执行器 core/de_elevate.py):针对绿色便携版(Portable)等无注册表项的 WinGet 应用,通过 advapi32.GetTokenInformation + TokenLinkedToken 获取当前会话绑定的标准用户(Medium Integrity)主令牌(若无分割令牌则抓取 explorer.exe 桌面进程令牌),调用 CreateProcessWithTokenW 降权启动 winget uninstall。顶层入口暴露 --de-elevate 参数,单文件打包后依然可秒级调用。
  • UWP/MSIX 卸载重构:识别 MSIX\... 前缀包,自动路由至 PowerShell Get-AppxPackage | Remove-AppxPackage,解决微软商店应用在管理员环境下的卸载难题。

⚡ WinGet 批量更新并发预下载流水线 (Concurrent Pre-Download Engine)

  • 多线程并发预下载 (WingetConcurrentDownloadWorker):在执行批量更新前,利用 ThreadPoolExecutor 并发拉取待更新应用的安装包与清单(winget download),消除长时间串行下载阻塞。
  • 本地清单离线安装:自动解析下载缓存目录中的 <pkg_id>.installer.yaml 清单文件,后续安装指令直接以 --manifest <path> 模式在终端中顺序静默执行,极大提升批量升级速度与网络容错率。

📦 PNPM 现代化后端接入与全局包混合纳管 (PNPM Integration & Hybrid Management)

  • pnpm 引擎完整支持:配置中心新增 use_pnpm 开关与 pnpm_path 自定义路径,支持自动探测系统 PATH、%LOCALAPPDATA%\pnpm 及 %APPDATA%\npm。
  • 全局环境混合扫描与精准操作路由:自动扫描并解析 pnpm list -g --json,与全局 npm 包合并展示;全局包卡片智能显示高亮橙色 [pnpm] 标识;卸载或更新时,系统根据包的实际安装来源自动分发为 npm 或 pnpm 命令,互不干扰、精准执行。
  • 健壮的输出流解析 (extract_json_from_output):基于 json.JSONDecoder.raw_decode,从夹杂有更新提示、警告信息与 banner 的终端输出中稳健剥离出合法 JSON 数据。

🏷️ SemVer 2.0.0 规范比对与全渠道(Channel/Dist-Tags)实时感知

  • 语义化版本规范比对:实现完全符合 SemVer 2.0.0 规范的 parse_semver、semver_compare 与 is_newer_semver,正确判定预发布阶段(如 1.2.3 > 1.2.3-alpha.1),支持点分隔与短横线混合语法。
  • 扩展渠道识别:支持 10 类频道识别正则(alpha, beta, rc, canary, next, nightly, preview, dev, insiders, experimental)。
  • 高速 dist-tags 获取与动态配置更新:NpmDistTagsWorker 优先通过 HTTP 直连 npm registry 获取 dist-tags,秒级响应;包配置对话框支持动态刷新远端渠道,切换更新渠道后即时根据 SemVer 计算最新版本并触发更新。

📊 自适应任务监控浮动面板 (TaskMonitorWidget)

  • 自适应宽/窄屏布局:常驻于控制台与终端之间,自适应宽屏(34px 单行紧凑)与窄屏(72px 双行拓展)模式,任务启动时自动分配合理的面板高度。
  • 多步骤全流程追踪:为 WinGet、Python、Node.js 运行时安装等核心流程提供标准多步骤指示(如:获取源 -> 下载包 -> 校验签名 -> 系统安装)。
  • 精细化网络指标:实时呈现已下载/总字节数、瞬时下载速度、剩余时间(ETA)、动态进度条,并提供直达官方 Release 页面的逃逸按钮。

🛠️ Python 虚拟环境破损诊断与一键修复向导 (EnvRepairDialog)

  • 破损状态感知:Environment 数据模型新增 is_broken 与 broken_reason;当虚拟环境关联的底层 Python 解释器丢失或损坏时,卡片呈现显眼的 ⚠️ Damaged 状态与红色修复入口。
  • 三合一修复向导:
    • 策略 A(自动重装):通过系统包管理器自动重新安装缺失的对应版本 Python;
    • 策略 B(环境迁移):一键将该虚拟环境无缝重定向迁移绑定到当前系统中已有的其它有效 Python 解释器;
    • 策略 C(手动命令):生成并一键复制手动终端修复命令。

🔒 源码开发宿主环境自保护机制 (Self-Hosting Guard)

  • 宿主环境识别 (is_self_hosting_env):在以源码方式开发/运行 OmniPack 时,自动识别当前正在托管主程序进程的虚拟环境(匹配 sys.prefix 与 sys.executable,在打包后的 Frozen 独立环境下自动放行)。
  • 文件锁拦截与告警:宿主环境卡片显示 [当前宿主] 高亮标签;当尝试在该环境中更新/卸载被进程占用的核心库(如 PySide6)或升级解释器时,触发拦截弹窗,规避 Windows 文件锁(WinError 32 / WinError 5)导致的崩溃。

📥 Python Wheel 批量离线下载与 URL 导出

  • Wheel 离线下载 (DownloadWheelsWorker):在虚拟环境卡片菜单中支持一键为所有待更新的包批量下载 .whl 安装文件至本地目录。
  • 下载直链批量导出 (ExportWhlUrlsWorker):结合 PyPI JSON API 与 Simple 索引,智能解析适配平台的 wheel 下载直链并一键导出为文本列表。

⚙️ 后端运行时自检与跨 Shell 命令渲染强化

  • 后台自动安装缺失后端 (BackendAutoInstallerWorker):软件启动后后台异步自检 uv 与 pnpm,若开启自动安装选项则自动静默部署并写入持久化配置。设置中心同步支持手动安装与在线更新。
  • 命令渲染器语法保护 (ShellCommandRenderer):针对 Windows start "" /wait 语法做特殊保护,避免 subprocess.list2cmdline 将 "" 转义导致 cmd 语法错误;针对 PowerShell 自动转译为 Start-Process -Wait;多段命令根据 Shell 类型智能使用 & 或 ; 连接。
  • 设置中心异步优化:引入 SystemUrlDetectThread 在后台异步探测系统级镜像源,彻底消除打开设置面板时的微卡顿。

🔍 包搜索与添加交互体验革新 (Package Search & Delegate Redesign)

  • Qt 原生委托渲染重构 (PackageItemDelegate):彻底废除在 QListWidget 中为每个条目挂载子部件(setItemWidget)的传统模式,改用 Qt 官方标准的 QStyledItemDelegate 进行轻量自绘。
  • 点选与双击事件拦截根治:彻底消除原 QLabel/QWidget 容器对鼠标事件的拦截与吞噬。列表项现已支持任意文字或间隙区域的100% 灵敏单击、双击直达配置/安装、以及键盘回车键(itemActivated)秒级确认。
  • 重复点击响应与选区状态健全:同时联动 itemClicked 与 itemSelectionChanged 信号,确保用户即使重复点击已选中的条目,输入框亦能即时刷新并重新激活下一步按钮。
  • 搜索定时器智能阻断与异步竞态隔离:用户在匹配列表中点选条目时,即刻终止正在倒计时的防抖搜索定时器(_search_timer);取消正在运行的后台 worker 时严格递增 _search_seq 序号,彻底阻断迟滞网络响应对当前列表的重绘冲刷,杜绝界面闪烁与选中状态被清空。
  • 精确匹配自动高亮:搜索结果返回时,若列表中存在与当前输入框完全匹配的项,自动将其置为当前选中高亮项,显著提升搜索装包直觉体验。

This major V17 release introduces comprehensive architectural upgrades: a dual-tier de-elevation and native uninstaller pipeline to bypass elevated WinGet restrictions when removing user-scope packages, a concurrent pre-download engine for batch updates, full pnpm backend integration with hybrid global package management, SemVer 2.0.0 compliance with dynamic dist-tags channel detection, an adaptive task monitor panel, a 3-way virtual environment repair wizard, a lightweight item delegate redesign for package search, and a self-hosting execution guard.

🛡️ WinGet De-elevation & Native Uninstaller Pipeline

  • User-Scope Uninstall Fix under Administrator: Overcomes the WinGet 1.29+ elevated blockage (0x8A15007D) when attempting to uninstall user-scoped packages while OmniPack runs with administrative privileges.
  • Tier 1 (ARP Registry Uninstaller): Inspects HKLM and HKCU uninstall registries to locate the official uninstaller executable (UninstallString / QuietUninstallString). Automatically converts MSI packages to MsiExec.exe /X {GUID} and appends silent switches (/SILENT, /S, /qb) to ensure complete file and registry cleanup without leftovers.
  • Tier 2 (Token De-elevation Fallback core/de_elevate.py): For portable and registry-less applications, duplicates the standard user (Medium Integrity) token from TokenLinkedToken (or the desktop explorer.exe shell) and spawns non-elevated winget uninstall via CreateProcessWithTokenW. CLI entry point exposed as --de-elevate.
  • UWP/MSIX Direct Removal: Dispatches MSIX packages directly to PowerShell Get-AppxPackage | Remove-AppxPackage.

⚡ WinGet Concurrent Pre-Download Engine

  • Multi-threaded Pre-downloads (WingetConcurrentDownloadWorker): Downloads packages and manifests concurrently using a configurable ThreadPoolExecutor ahead of batch updates, avoiding serial network bottlenecks.
  • Local Manifest Execution: Discovers <pkg_id>.installer.yaml files within download directories and runs offline installations sequentially with --manifest <path>.

📦 PNPM Backend Integration & Hybrid Global Management

  • Full pnpm Engine Support: Configurable via use_pnpm and pnpm_path with automatic path discovery across standard Windows directories and PATH.
  • Hybrid Global Scanning & Intelligent Routing: Seamlessly scans and merges pnpm list -g --json with npm global packages. Displays an orange [pnpm] badge on relevant package cards and dispatches remove/update commands to the respective package manager automatically.
  • Resilient JSON Output Parsing (extract_json_from_output): Extracts structured JSON from command outputs even when surrounded by update notifications and console banners.

🏷️ SemVer 2.0.0 Engine & Dynamic Dist-Tags Perception

  • Strict SemVer Compliance: Implements parse_semver, semver_compare, and is_newer_semver supporting prerelease phases (e.g. 1.2.3 > 1.2.3-alpha.1) across hyphenated and dotted notations.
  • Extended Channel Detection: Recognizes 10 prerelease channels (alpha, beta, rc, canary, next, nightly, preview, dev, insiders, experimental).
  • High-Speed HTTP Dist-Tags: Queries npm registry directly via HTTP before falling back to CLI npm view, and recalculates updates immediately when the channel changes in package settings.

📊 Adaptive Task Monitor Panel (TaskMonitorWidget)

  • Responsive Wide/Narrow Modes: Automatically toggles between a 34px single-line bar and a 72px expanded view according to available width, dynamically allocating splitter heights.
  • Multi-Step Flow Tracking: Visualizes 4-step execution pipelines (Fetch Release -> Download Pkg -> Verify Signature -> System Install) for runtimes and WinGet upgrades.
  • Live Transfer Metrics: Reports bytes downloaded, total size, download speed, ETA, and provides an escape URL button linking directly to release artifacts.

🛠️ Virtual Environment Repair Wizard (EnvRepairDialog)

  • Broken Environment State Tracking: Flags environments whose underlying Python interpreters are missing or damaged (is_broken / broken_reason) with a prominent ⚠️ Damaged indicator.
  • 3-Way Remediation: Offers automatic re-installation of the missing Python version, one-click migration/re-pointing to an existing system Python interpreter, or manual command generation.

🔒 Self-Hosting Environment Protection Guard

  • Host Detection (is_self_hosting_env): Identifies when a virtual environment is currently hosting the running OmniPack process in source development mode (bypassed in frozen standalone mode).
  • File-Lock Collision Prevention: Marks host cards with a [当前宿主] badge and intercepts modifications to locked libraries (e.g. PySide6) or the active interpreter to prevent Windows file lock crashes (WinError 32 / WinError 5).

📥 Python Wheel Batch Download & URL Export

  • Wheel Downloader (DownloadWheelsWorker): Downloads matching .whl b...
Read more

v16

v16

Choose a tag to compare

@LeoOfGit LeoOfGit released this 09 Jun 08:33

🇺🇸 [v16] - WinGet Unified Architecture Unification, UWP Provisioned Sync, Localized Console Table Parsing Repair & Stability Guard

🇨🇳 [v16] - WinGet 统一架构合并、UWP 备置应用离线感知、本地化表格解析修复与系统保护卫士 (中文说明)

本次更新对 WinGet 系统应用管理模块进行了重大架构重构,合并了原本拆分的系统与用户环境卡片,并引入了对 UWP 备置应用的离线感知及注册机制。此外,彻底修复了非英文 Windows 系统下因控制台全角字符导致的应用名称截断,并引入了系统保护应用防误删与经典软件去重功能。

📦 WinGet 面板环境卡片合并与统一纳管

  • 统一卡片架构:移除了原本拆分的 System (Machine) 和 User 两个独立 WinGet 环境卡片,将其重构为统一的“所有应用(Applications)”环境卡片(类型为 winget),优化了 UI 空间的利用并简化了操作逻辑。
  • 智能位置标签:软件包卡片旁直接根据其实际部署目录标注 [sys](系统级)或 [user](用户级)高亮标签,同时完美支持两个 Scope 同存时的 [sys] [user] 双重视角。

🧩 UWP/MSIX 备置应用离线状态感知与本地重注册

  • 注册表与清单感知:引入对 Windows 注册表中 AppxAllUserStore 节点以及系统 WindowsApps 文件夹下 AppxManifest.xml 清单文件的离线检索与信息抓取,使用户能够在不拥有特权的情况下感知系统已备置的包。
  • 离线 UWP 发现与 Staged 标记:即使当前用户未注册或已卸载了某个自带 UWP 应用,系统依然能在应用列表中发现它,并以带有 [Staged] 标记的 Missing 状态展示。
  • 一键重注册(用户范围安装):针对此类已备置但未注册的应用,界面提供快捷的复合功能键(±),用户一键即可调动 Add-AppxPackage 将其在当前用户账户中重注册与部署。

🔒 系统保护应用安全锁与经典 Win32 去重

  • 核心 UWP 卸载拦截:自动从注册表读取拥有 NonRemovable(不可移除)属性的系统级及微软核心应用(如 App Installer, Microsoft Store, Edge 等),并在 UI 列表中强制置灰其卸载(Remove)按钮,同时悬停提示系统保护状态,防误操作导致崩溃。
  • ARP 经典程序去重 (ARP Deduplication):重构去重审计逻辑,通过 GUID 校验以及名称+版本哈希去重,彻底解决了经典 Win32 应用程序因注册表别名在列表中冗余展示的问题。

🐛 本地化控制台解析与参数精度纠偏

  • 表头分词正则纠偏:修复了在解析 WinGet 数据表头时,正则表达式由于排除了全角宽度占位符 \x00 而导致将单个词(如“名称”、“版本”)拆分为多个列的缺陷。更新后的正则全面兼容全角字符宽度,防止解析时产生列错位。
  • 解决名称截断与徽章错配:解决了测试机器上由于列错位导致应用名称只显示前几个字符,以及数据源列被错配导致全部降级显示为 [L](Local 本地源)标签的问题。修复后,系统能够正确识别并渲染 [W](WinGet 官方源)和 [S](MS Store 商店源)标签。
  • 元组动作目标导航:操作目标(ActionTarget)格式升级为 target_id:scope:version 元组定位,以支撑在统一列表中精确控制特定版本或具体范围的应用行为。

This release introduces a major architectural simplification to the WinGet module, unifying the separate Machine and User environments into a single application management panel and adding deep status scanning for staged UWP apps. It also fixes East-Asian localized table header parsing, prevents accidental removal of system-protected core applications, and removes duplicate Win32 entries.

📦 WinGet Panel Unification & Scope Integration

  • Unified Environment Card: Consolidated the separate System (Machine) and User WinGet cards into a single "Applications" environment, streamlining layout flow.
  • Contextual Scope Tagging: Explicitly indicates target application boundaries by showing [sys] or [user] labels directly on package cards (or both when co-existing).
  • Precise Action Targets: Action target pointers now follow a structured target_id:scope:version format to allow version-specific and scope-specific operations in a shared environment view.

🧩 UWP/MSIX Staged App Detection & Re-registration

  • Staged State Scanning: Queries the local HKLM registry databases and scans AppxManifest.xml packages offline to discover UWP packages provisioned at the system level but not registered for the current user.
  • Staged Status Visualization: Lists provisioned apps as missing packages marked with a special [Staged] badge.
  • One-Click Re-registration: Provides a contextual compound action button (±) that executes standard PowerShell registration (Add-AppxPackage -Register) for staged MSIX/Appx packages instantly.

🔒 Non-Removable Protection & ARP Deduplication

  • Core App Lock: Auto-detects system-protected NonRemovable applications (e.g. Microsoft Store, Edge, App Installer) and disables their uninstall controls in the UI with a warning tooltip to prevent system damage.
  • ARP Deduplication: Leverages GUID validations alongside normal name/version hashing to clean up duplicate Win32 listings originating from overlapping registry paths.

🐛 Localized Console Slicing & Parsing Fixes

  • Regex Width Corrections: Restored normal tokenization of Winget table headers on localized systems (e.g. Chinese Windows) by correcting column segmentation regex to handle full-width characters, avoiding column misalignment.
  • Resolved Truncation & Source Badge Shifts: Fixed the column mapping offsets that previously sliced application names to 1-2 characters and shifted source classifications, defaulting every package to the local fallback [L] badge. Correct [W] (WinGet) and [S] (MS Store) labels are now fully operational.

v15

v15

Choose a tag to compare

@LeoOfGit LeoOfGit released this 08 Jun 12:26

🇺🇸 [v15] - Cross-Platform Runtime Installers (macOS/Linux), WinGet Automated Setup (Windows), Runtime Setup Guide UI, Virtual Environment File-Lock Guard & Resilient Network API

🇨🇳 [v15] - 跨平台运行时一键安装(macOS/Linux)、WinGet 系统级全自动安装(Windows)、运行环境引导界面、虚拟环境升级文件锁防御与高可用 API (中文说明)

本次更新大幅扩展了 OmniPack 的运行环境自愈与安装能力,正式引入对 macOS 和 Linux 平台的运行时一键下载与自动配置支持,并在 Windows 平台上实现了缺失 WinGet 时的后台全自动下载及安装。此外,在 UI 层面引入了常驻且直观的“运行环境安装引导界面”(RuntimeSetupWidget),同时增强了 Pip 虚拟环境升级时的进程文件锁静默冲突保护,避免因 IDE 占用导致环境受损,并进一步优化了网络 API 容灾重试逻辑。

🚀 跨平台运行环境一键自愈与安装引导 (Auto-Setup & Guide UI)

为了给缺失运行环境的用户提供无痛的起步体验,本次更新将底层的一键自愈链路与上层的智能引导界面进行了深度整合:

  • 智能缺失引导界面:当在 Pip 面板、Npm 面板或 WinGet 面板中未检测到任何可用环境时,UI 底部会自动展现精美的“运行环境安装引导”卡片(RuntimeSetupWidget)。支持强制调试标志(force_show_setup: true),优化了窗口拉伸时的固定高度及按钮字符渲染,并集成跳转至官网下载历史版本的 "Other Version" 链接。
  • Windows 系统级一键修复 WinGet:若当前系统缺失或损坏了 WinGet 客户端,OmniPack 将通过 PowerShell 自动从 GitHub 抓取最新官方 .msixbundle,并后台静默部署其必须的 Microsoft.VCLibs 与 Microsoft.UI.Xaml 依赖组件,实现 WinGet 从无到有的全自动安装(支持代理与进度回传)。
  • macOS/Linux 运行时一键安装:
    • Linux 自动极速部署:缺失 Python 时自动通过极速 Python 工具 uv 进行一键下载安装;缺失 Node.js 时,则会自动下载对应架构(x64/arm64)的官方二进制包,全自动解压并软链接(symlink)至用户本地 ~/.local/bin。
    • macOS 官方包静默流式安装:支持一键下载官方 Python/Node.js 的 .pkg 安装包,并调用系统 open -W 指令拉起系统 GUI 安装器并同步等待其完成。

🔒 虚拟环境升级文件锁冲突防御 (Venv File-Lock Guard)

针对 Python 虚拟环境升级(python -m venv --upgrade)时易被外部进程锁定导致损坏的痛点,引入了文件锁静默拦截与诊断机制:

  • 占用锁精准诊断:一旦检测到由于 PyCharm、VSCode 或 OmniPack 自身等进程锁定了 python.exe 文件导致复制失败,程序将静默拦截原始命令行的乱码输出,转而向用户抛出极其清晰易懂的错误引导,提醒其关闭所有可能占用该环境的程序后再试,从根本上防止虚拟环境损坏。

⚙️ 稳定性提升与底层解析优化 (Stability & Parsing Optimizations)

对网络 API 交互、配置文件解析以及测试套件生命周期进行了全方位的健壮性加固:

  • 高可用 API 容灾重试:重构了 _fetch_runtime_index 获取机制,增加了最多 3 次的网络连接重试及退避延迟,并在多线程并发访问时引入 0.3 秒睡眠保护,完美解决了因 Cloudflare 防御导致的 SSL 握手超时()和高达 50% 的 API 获取失败率。
  • 解析与配置容错:优化了 pyvenv.cfg 的读取兼容性,对缺失 Python 关键字的前缀版本行进行自动修正,确保各种非标准虚拟环境的版本号均能被精准读取;同时为 msvc_path.cfg 增加了详细的说明注释,明确了 Nuitka 编译器的查找和回退逻辑。
  • 测试框架进程级崩溃修复:修复了在自动化测试(pytest)环境下,由于底层拉取版本的异步 QThread 仍处于运行状态而导致 C++ Fatal Error 强制掐断测试进程的生命周期 Bug,自动化测试恢复 100% 通过率。

This release expands OmniPack's environment self-healing capabilities by introducing official runtime installers for macOS and Linux, as well as a fully automated, proxy-supported background install process for WinGet on Windows. A new dedicated setup guide UI (RuntimeSetupWidget) automatically assists users in bootstrapping missing runtimes. Furthermore, this update introduces robust file-lock guards for virtual environment upgrades to prevent IDE-locked process failures, optimizes pyvenv.cfg reading tolerances, and integrates exponential backoff retries for network runtime API indexes.

🚀 Cross-Platform Runtime Auto-Setup & Guide UI

  • Contextual Setup Prompts: Displays a beautifully styled setup card (RuntimeSetupWidget) at the bottom of the scroll view when Pip, Npm, or WinGet panels have zero loaded environments, allowing users to trigger installation pipelines instantly. Fixed vertical stretching bugs by applying Fixed size policies, corrected missing & ampersand bugs in buttons, and added a custom force_show_setup debugging flag.
  • External Legacy Version Links: Added a convenient "Other Version" hyperlink next to the version selector, allowing users to quickly access the official Python/Node.js download pages for specific legacy versions.
  • Zero-Dependency WinGet Deployment: If WinGet is missing or broken on Windows, OmniPack runs a proxy-aware PowerShell worker to fetch the latest .msixbundle directly from the official GitHub repository and install it alongside necessary Microsoft Appx dependencies (VCLibs and UI.Xaml).
  • One-Click macOS & Linux Installers:
    • Linux Automated Deployments: If a Python runtime is missing, the application installs it using uv; for missing Node.js runtimes, it pulls the official tar.xz binary pack (tailored for x64/arm64) and symlinks the binary links (node, npm, npx) to the user's local path.
    • macOS Official Installer Execution: Automatically fetches the official .pkg packages for macOS Darwin and executes them using the interactive open -W system installer pipeline, pausing runtime updates until completion.

🔒 Virtual Environment Upgrade File-Lock Guard

  • Silent File-Lock Diagnostics: Detects if virtual environment upgrades fail due to locked executable files (python.exe occupied by IDEs, running scripts, or OmniPack itself). Intercepts console errors and warns the user with clear instructions, preventing environment corruption.

⚙️ Stability, API Resilience & Parsing Optimizations

  • Resilient Retry Pipeline: Rewrote _fetch_runtime_index to protect network indexing queries with a 3-pass retry fallback and connection sleep offsets. This completely mitigates SSL handshake timeouts caused by aggressive CDN rate-limiting, resolving a ~50% failure rate anomaly.
  • Robust Config Parsing: Automatically normalizes and prepends missing "Python" keywords when parsing version lines inside pyvenv.cfg configs, ensuring correct local scans. Also documented the compiler discovery order and Zig backup routes directly within msvc_path.cfg.
  • Pytest QThread Fatal Error Fix: Isolated and bypassed asynchronous QThread instantiations during automated pytest lifecycles to prevent premature garbage collection from triggering C++ fatal aborts, restoring the test suite to a 100% green passing state.

v14

v14

Choose a tag to compare

@LeoOfGit LeoOfGit released this 07 Jun 14:03

🇺🇸 [v14] - Environment Editing & Renaming, Winget Self-Upgrade, Winget Diagnostics & Enhancements, Copyable Dialogs & Package Details

🇨🇳 [v14] - 环境编辑与重命名、Winget自身升级、Winget细节增强与去重优化、可复制对话框文本与包详情 (中文说明)

本次更新引入了对虚拟环境的直接编辑与重命名支持,提供了 Winget 包管理器自身(App Installer)的一键检测与升级能力,并极大提升了界面文本的可交互性,支持全局对话框文本复制和一键复制包详细信息。同时,对 Winget 扫描结果进行了架构识别与去重优化,并对底层 UI 工具函数进行了清理和重构。

✏️ 环境编辑与重命名

  • 右键直接管理:现在可以在 Pip 和 Npm 面板的环境卡片上,右键菜单中直接选择 “✏️ Rename Environment” 来修改环境展示名称,或选择 “⚙️ Edit Settings” 来编辑该环境的路径等详细设置。
  • 智能高亮跳转:点击“编辑设置”后,程序会自动打开统一设置对话框,并以极高精度自动定位高亮到该环境,提供无缝的使用体验。

🚀 Winget 包管理器自身升级支持

  • 版本实时展示:在 Winget 机器和用户卡片上,现在会显示 Winget 当前的具体版本号(如 Winget v1.9.25200)。
  • 一键升级自身:若检测到 Winget 有可用更新,卡片头部会显示闪烁的 Wg 按钮并显示升级路径(如 v1.9.25200 -> v1.10.x)。用户点击后会弹出确认框,确认后通过内置终端执行 winget upgrade --id Microsoft.AppInstaller 升级。

📋 可复制对话框与包详情一键复制

  • 全局文本可复制:安装了全局事件过滤器,使主程序中弹出的所有 QMessageBox 和 QDialog 的标签文本均支持鼠标选中和复制(Ctrl+C),便于用户在遇到报错时复制异常信息进行排查。
  • 包配置一键复制:在包的“配置包”对话框中,新增了 “Copy Details”(复制详情)按钮。一键即可将该包的名称、ID、安装源、已安装版本、可用版本以及安装路径(如有)拷贝至剪贴板。

🔍 Winget 细节增强与去重优化

  • 安装位置标记:在包卡片和配置对话框中,对通过传统注册表安装的包增加 [Win32] 标记,对通过现代包管理器安装的包增加 [MSIX] 标记。
  • 架构信息自动追加:智能从包 ID 中使用正则抓取 x64、x86、arm64 等架构信息,自动追加在 UI 展示 of 包名后(如 Python 3.10 (x64)),避免同名多架构包造成视觉混淆。
  • 扫描去重机制:对具有相同 ID、源和版本的包进行去重过滤,避免重复显示。

⚙️ NPM 与其他细节优化

  • NPM 全局路径展示:在设置面板中,不再单一显示 "global" 字样,而是会自动扫描并缓存呈现真实的 NPM 全局安装路径(如 System Global 对应的系统实际 node_modules 根目录)。
  • 代码重构与清理:抽象并复用了 update_widget_style_property 和 clear_layout 辅助函数,避免冗余样式刷新的 boilerplate 代码。彻底移除了未使用的临时测试脚本 test_winpty.py。

This release introduces direct support for editing and renaming environments from context menus, enables one-click detection and upgrading of the Winget package manager itself (App Installer), and significantly improves UI text interactivity with copyable dialog text and package detail export buttons. Furthermore, it refactors core UI utilities and enhances Winget operations with automatic architecture appending, installation source tagging, and scan deduplication.

✏️ Environment Renaming & Settings Editing

  • ContextMenu Integration: Pip and Npm environment card headers now support right-click context options: "✏️ Rename Environment" to quickly modify the alias, and "⚙️ Edit Settings" to modify the environment parameters.
  • Automatic Highlighting: Editing an environment automatically launches the Settings Dialog and focuses directly on the selected environment row for seamless adjustments.

🚀 Winget Package Manager Self-Upgrade

  • Version Display: Automatically queries and displays the version of the winget executable directly on the Machine and User environment cards.
  • One-Click Upgrade: Detects if Microsoft.AppInstaller has an update available, displaying the upgrade path (e.g. Winget v1.9.25200 -> v1.10.x) and showing a dedicated Wg update button. Clicking it prompts for confirmation and triggers the CLI upgrade pipeline.

📋 Copyable Dialog Labels & Package Details Export

  • Selectable Dialog Labels: Registered a global event filter to make text labels inside all QMessageBox and QDialog selectable and copyable, allowing users to easily capture error tracebacks.
  • Copy Package Details: Added a "Copy Details" button in package configuration dialogs, enabling users to copy all metadata (Name, ID, Source, Versions, and Install Location) to the clipboard.

🔍 Winget Diagnostics & Enhancements

  • Type Badge Tagging: Displays [Win32] badges for classic desktop registry installations and [MSIX] badges for modern app package formats in details and lists.
  • Architecture Identification: Automatically extracts architecture descriptors (x64, x86, arm64, arm) from package IDs and appends them to package names (e.g., Python 3.10 (x64)) to avoid name collisions.
  • Deduplication: Filters out duplicate items carrying identical IDs, sources, and versions.

⚙️ NPM & Miscellaneous Optimizations

  • NPM Global Path Resolution: Replaced the generic "global" keyword in Settings with a dynamically queried and cached physical prefix path (or "System Global") for NPM global installations.
  • Refactoring & Cleanups: Unified UI updates with modular update_widget_style_property and clear_layout functions. Deleted the obsolete test_winpty.py script.

v13

v13

Choose a tag to compare

@LeoOfGit LeoOfGit released this 06 Jun 14:03

🇺🇸 [v13] - User site-packages Integration, Drag-and-Drop Reordering, Batch Import & Proxy Sync

🇨🇳 [v13] - 用户目录包融合、拖拽排序、批量导入与代理同步 (中文说明)

本次更新支持了对系统 Python 用户站点包(User site-packages)的自动探测与深度融合管理。完美解决了第三方包安装在用户漫游目录下导致主程序遗漏读取的问题,并提供鼠标悬停物理路径提示,保障了在任何权限场景下的平滑运行。同时引入了主界面环境卡片拖拽重排、右键删除、快捷批量导入,以及代理配置同源同步等提升用户体验的重大改进。

📦 用户目录包(User-Site)深度融合与并列展示

  • 双路径并发扫描:全面打破系统 site-packages 和 用户 user-site 之间的壁垒。程序在扫描系统环境包时,会自动探测其 site.getusersitepackages() 物理路径,并执行并发读取与合并。
  • 支持并列展示与冗余可见:彻底去除了对包名的强制去重合并字典。如果系统全局和用户目录下同时安装了同名包,OmniPack 将并列完整展示,让用户轻松发现冗余并自主决策。
  • 特异性依赖树组装:重构了 merge_dependency_info 依赖树合并机制。现在,即便存在同名冗余包,所有的实例实体均能正确绑定并展现出各自完备的依赖拓扑图,不存在任何依赖项丢失。
  • 树状就近定位路由:当展开父卡片懒加载子依赖时,算法会根据父节点的安装位置(系统/用户)执行就近匹配;如果只有单方安装,则安全跨目录跨路由关联。

🔄 主界面拖拽重排与右键管理

  • 直观的环境卡片拖拽:在 Pip 和 Npm 环境列表中,用户可以直接使用鼠标拖动环境卡片进行排序。在拖动过程中提供了亮蓝色的放置指示线,调整后的顺序会自动同步保存至配置文件(omnipack_config.json)。
  • 右键上下文菜单删除:在环境卡片 Header 上点击右键可快速唤出上下文菜单,一键删除/移除该环境,无需再进入设置对话框进行繁琐操作。

➕ 列表底部快捷添加环境与批量导入

  • 常驻快捷按钮:在 Pip 和 Npm 面板环境列表底部新增了“➕ Add Environment”常驻按钮,使添加环境更加便捷。
  • 多通道添加与批量导入 (Batch Paste):支持选择“项目/虚拟环境文件夹”、“python.exe/package.json 配置文件”、或“手动输入路径”。此外,新增了**“Batch Paste... (批量粘贴)”**功能,允许用户直接从 Windows 资源管理器或 Everything 中复制多行路径一键导入,极大提升了多项目导入的效率。

🎨 包名高亮染色与悬停物理路径

  • 亮黄字体染色:去除了原有的 [User] 徽章,改用精美的亮黄色(#ffb703)直接对用户目录包的包名进行高亮染色,保持了极简清爽的现代暗黑 UI 美学。
  • 悬停 Tooltip 物理路径:无论在何层级、何深度的依赖卡片,只要将鼠标悬停在包名上,Tooltip 就会瞬间呈现出包在硬盘上的具体物理安装路径(如系统包显示为 C:\Program Files\...,用户包显示为 C:\Users\Leo\...),让物理布局一目了然。

🖥️ 系统/用户环境变量卡片 Tooltip 悬停显示

  • 移除 [PATH] 后缀:清理了 Python 与 Node.js 环境卡片标题后原本追加的 [PATH] 后缀。
  • 智能系统/用户变量识别:通过 Windows 注册表精确判断 Python 与 npm 路径归属:
    • 如果在系统环境变量中找到(无论用户变量中是否也存在),鼠标悬停在卡片名称上时会通过 Tooltip 提示 "In the System Variables"。
    • 如果仅在用户环境变量中找到,Tooltip 会提示 "In the User Variables"。

⚙️ 智能 PTY 命令分流与权限安全兜底 & 代理配置优化

  • 带位置标签的 Target 传输:UI 层与 PTY 交互时,包卡片将向操作队列注入如 numpy:user 或 numpy:system 等位置标签,命令行构建器根据标签智能生成卸载/升级命令(分流为 --target <user-site-path> 或 --system --python ...)。
  • 无特权安装 Fallback 兜底:在系统 Python 下安装或升级新包时,一旦探测到主程序运行在普通用户特权下(无管理员特权),会自动降级并使用 --target <user-site-path> 将包安装到用户目录中,彻底规避因写保护引起的 Permission Denied 错误,实现零报错流畅体验。
  • 代理配置同源同步 (Same for HTTP and HTTPS):在 Settings -> Proxy 设置中,增加了 “Same for HTTP and HTTPS” 复选框。勾选后,HTTPS 代理配置将自动同步并锁定为 HTTP 代理配置的值,避免了重复输入的冗余操作。

This release integrates full support for Python user site-packages (--user installs) into OmniPack's ecosystem. It resolves the problem where packages installed in the user's roaming directory were hidden from the UI, introducing a clean, badge-free color-highlighting scheme, hover-based physical path tooltips, and non-deduped parallel dependency chains for perfect environment visualization and smart permissions fallback. Furthermore, it introduces major user experience enhancements, including direct drag-and-drop reordering, right-click environment deletion, multi-channel batch path paste import, and unified HTTP/HTTPS proxy synchronization.

📦 Deep User-Site Integration & Dual-Path Parallel Scan

  • Bilingual Parallel Detection: OmniPack now automatically queries site.getusersitepackages() for system Python environments and launches concurrent listings of global site-packages and user site-packages.
  • Deduplication Removal for Redundant Visibility: Eliminated the dictionary-based name deduplication. When a package is installed in both system and user directories (possibly at different versions), OmniPack lists them side-by-side, allowing users to spot redundancies and choose which one to manage.
  • Instance-Level Dependency Merger: Refactored merge_dependency_info to enrich all concurrent instances of a package with tree dependencies, avoiding the issue where one of the duplicates appeared as a leaf or isolated node.
  • Location-Aware Child Resolution: When lazy-loading dependencies, child cards prioritize matching the parent node's location (system vs. user). If a mismatch occurs, the tree safely links across paths and inherits the correct style and path.

🔄 In-App Drag-and-Drop Reordering & Quick Management

  • Visual Drag-and-Drop: Users can now drag environment cards within Pip and Npm lists to reorder them directly. A bright-blue position indicator line assists during sorting, and the updated order is dynamically written to omnipack_config.json.
  • Right-Click Context Menu: Right-clicking the header of any environment card now opens a context menu allowing users to instantly delete/remove the environment, eliminating the need to use the settings dialog.

➕ Add Environment Shortcuts & Batch Paste

  • On-Panel Add Button: A permanent "➕ Add Environment" button is integrated at the bottom of the environment lists in Pip and Npm panels for easier management.
  • Multi-Channel Import with Batch Paste: Added options to add environments via folder picker, file browser (e.g., python.exe or package.json), or raw manual path input. Additionally, a new "Batch Paste..." option is introduced, permitting users to paste multiple paths (e.g. copied from File Explorer or Everything) to import them in a single batch.

🎨 Hover-to-Path Tooltips & Clean Color Highlight

  • Bespoke Yellow Highlighting: Replaced the [User] badge with an elegant bright-yellow (#ffb703) styling directly on the package name label for user-site installations, keeping the modern dark-themed aesthetic clean.
  • Physical Path Hover Tooltips: Hovering over any package name in the list displays its exact installation path (e.g., C:\Program Files\... for system packages and C:\Users\<User>\... for user packages) at any level of the dependency tree.

🖥️ Smart System/User PATH Environment Variable Tooltips

  • Removed [PATH] Suffixes: Removed the legacy [PATH] string appended to the title of Python and Node.js environment cards for a cleaner dark UI.
  • Dynamic Registry/PATH Tooltips: Uses dynamic Windows Registry validation to intelligently identify if a Python or npm executable is globally available:
    • If located in the System Environment Variables (even if duplicated in the User space), the card's title hover tooltip will display "In the System Variables".
    • If isolated only to the User Environment Variables, the tooltip will display "In the User Variables".

⚙️ Location-Aware PTY Commands & Permissions Fallback & Proxy Sync

  • Target Location Tagging: Package rows now generate target actions containing position markers (like numpy:user vs. numpy:system). The command builder parses these to automatically select --target <user-site-path> or --system --python <path>.
  • Non-Admin Installation Fallback: When installing or updating packages on a system Python without administrator privileges, OmniPack automatically routes the install command to the user site-packages directory via --target, resolving Permission Denied write errors on protected directories.
  • Unified Proxy Option: Added a "Same for HTTP and HTTPS" checkbox in Settings -> Proxy. When checked, the HTTPS proxy input is disabled and locked to automatically synchronize with the HTTP proxy value, simplifying the proxy configuration.

v12

v12

Choose a tag to compare

@LeoOfGit LeoOfGit released this 04 Jun 00:48

🇺🇸 [v12] - Intelligent Constraint-Safe Updates, FS Watcher & Marker Redesign

🇨🇳 [v12] - 智能依赖约束更新、文件系统联动同步与终端状态检测重构 (中文说明)

本次更新显著增强了包管理的智能化程度,引入了自动探测安全中间版本的能力,并实现了 UI 与物理硬盘状态的实时同步。同时,底层终端状态追踪机制进行了重构,极大地提升了在高压力输出场景下的任务可靠性。

🛡️ 智能依赖约束更新

  • 安全中间版本推荐:引入 safe_update_version 逻辑。当包的最新版本因依赖关系被其他包锁定(Breaks Constraints)时,OmniPack 现在会自动探测版本历史,并推荐一个在约束范围内的“最高安全版本”。
  • 可视化约束引导:
    • 针对受限包引入全新的蓝色 UI 主题 (PkgVersionUpdateConstrained)。
    • 悬停提示 大幅增强:不仅显示“可能导致冲突”,还会详细列出是哪些上游包施加了什么范围的约束(例如:Django 要求 djangorestframework<3.15),让用户对版本锁定原因一目了然。
    • “一键全选过时包”逻辑优化:会自动包含这些受限但可安全升级到中间版本的包,而彻底无法无损升级的包仍保持手动确认模式。
  • 预发布版本智能过滤:引入 is_prerelease_version 逻辑,在探测可用包版本及安全中间版本时自动排除 alpha、beta、rc 等非稳定的预发布版本,防止用户在自动升级中误入预览版分支。

🔄 实时文件系统联动

  • 环境自愈同步:在 PipPanel 和 NpmPanel 中集成了 QFileSystemWatcher。
  • 命令行脱机联动:当用户直接在系统终端或内置终端中运行 pip install 或 npm install 等命令导致本地文件变化时,OmniPack 会在静默期(Debounce)后自动触发环境刷新,确保 UI 状态始终与物理硬盘保持实时一致,无需手动点击刷新按钮。

🧩 终端状态检测重构

  • 基于物理文件的 Marker 机制:彻底重构了 PTY 终端任务结束的检测逻辑。由原来的“拦截输出流并正则匹配 UUID”改为“写入临时标记文件 (.done)”。
  • 极致稳定性:解决了在极高并发输出、ANSI 颜色代码干扰或终端自动换行时,正则匹配 UUID 标记位可能失效导致界面无限加载的问题。新机制完全免疫任何终端字符流干扰。

⚙️ 底层健壮性与代理优化

  • 集成终端代理自动联动:集成 PTY 终端在启动时会自动读取并继承全局代理配置。一旦软件的代理启用,PTY 进程将同步注入 HTTP_PROXY、HTTPS_PROXY 以及 NPM 专用的 NPM_CONFIG_PROXY 与忽略证书校验环境变量(如 NODE_TLS_REJECT_UNAUTHORIZED=0),从而保证内置命令行操作和主程序具备一致的网络穿透能力。
  • 多级版本探测 API 容灾回退:在 Pip 可用版本扫描中引入三级 Fallback 保护。当默认的 pip index 命令由于不支持或源限制无法查询时,会自动请求 PyPI 官方 JSON 接口;对于私有源则尝试拉取其 Simple API 的 JSON 响应,最终回退到直接请求 HTML 并以正则从链接名中解析提取版本号。这彻底解决了弱网、局域网或特定私有镜像源下无法探测更新的问题。
  • 安装规范(Spec)智能清洗:
    • 新增 extract_npm_package_name 智能包名提取算法,能自动在各种复杂的 npm 安装 spec(如本地路径、Workspace 符号链接、Git URL、别名包等)中剥离噪音并提取出最终注册到 node_modules 里的真实包名。
    • 在 Pip 局部扫描中,引入 extract_pip_requirement_name 对传入的包名先过滤约束条件等参数再扫描,双端齐下确保局部更新和扫描解析时不发生错位。
  • 控制台 ANSI OSC 控制流净化:升级了内置的流式 ANSI 剥离器,增加了对 OSC 控制序列(如终端改名、标题重设等 \x1b]... 指令)的过滤支持,有效规避了高彩 PTY 流在向只读日志投射时的字符杂音与乱码。

🏗️ 性能与细节改进

  • 渲染精度修复:修复了 RealTerminalPanel 在渲染 pyte 缓冲区时过度裁剪行尾空格导致交互式光标定位偏移的 Bug。
  • 并发性能优化:Pip 环境在计算依赖约束时引入了版本缓存池,大幅减少了重复查询 PyPI 元数据带来的网络开销。

This release significantly enhances package management intelligence by introducing constraint-safe intermediate version recommendations and real-time synchronization with physical disk states. Additionally, the underlying PTY terminal tracking mechanism has been refactored to achieve ultimate stability under heavy CLI output.

🛡️ Intelligent Constraint-Safe Updates

  • Safe Update Recommendations: Introduced safe_update_version logic. When a package's latest version is locked by other packages (Breaks Constraints), OmniPack now automatically probes its version history to recommend the highest available version within the constraint range.
  • Visual Constraint Guidance:
    • Applied a brand-new blue UI theme (PkgVersionUpdateConstrained) for constrained packages.
    • Greatly enhanced ToolTips: Instead of just displaying "may break version constraints," they now detail the exact upstream packages and constraint ranges (e.g., Django requires djangorestframework<3.15) for clear version locking diagnostics.
    • Optimized "Select Outdated" logic: Now automatically includes constrained packages that can be safely upgraded to an intermediate version, while packages that cannot be safely upgraded still require manual confirmation.
  • Prerelease Version Filtering: Introduced is_prerelease_version logic to automatically exclude unstable pre-release versions (like alpha, beta, rc, pre, dev) during package version detection and safe intermediate recommendations, avoiding unintentional upgrades to unstable builds.

🔄 Real-time File System Watcher

  • Auto-Refresh on External Changes: Integrated QFileSystemWatcher in PipPanel and NpmPanel.
  • Command-line Offline Synchronization: When users run commands like pip install or npm install directly in an external system terminal or the built-in terminal, OmniPack automatically triggers environment scanning after a quiet debounce period, keeping the UI state consistent with the physical disk without manual refreshes.

🧩 Terminal Marker Redesign

  • File-based Marker Mechanism: Completely refactored PTY terminal command completion detection. Shifted from "intercepting stdout and regex-matching UUID" to "writing a temporary marker file (.done)".
  • Ultimate Stability: Resolved the issue where the UUID marker regex matching failed due to high-concurrency outputs, ANSI color code interference, or terminal line wrapping, which previously led to infinite UI loading. The new mechanism is entirely immune to any terminal stream text noise.

⚙️ Core Robustness & Proxy Enhancements

  • Terminal Proxy Auto-Sync: The integrated PTY terminal now inherits global proxy configurations upon startup. When active, it automatically injects HTTP_PROXY, HTTPS_PROXY, npm-specific NPM_CONFIG_PROXY, and SSL certificate bypass variables (NODE_TLS_REJECT_UNAUTHORIZED=0), ensuring the terminal CLI commands share the same network penetration capabilities as the main UI.
  • Fallback Version Discovery: Implemented a 3-level fallback version query pipeline for Pip. If the default pip index fails or is unsupported, OmniPack queries the official PyPI JSON API, falls back to simple repository API JSON endpoints, and ultimately parses simple HTML directories with regex to extract version numbers from wheel/sdist packages, safeguarding functionality on restricted, offline, or private index mirrors.
  • Smart Spec Extraction:
    • Added the extract_npm_package_name algorithm to parse complex npm installation specs (local paths, workspaces, Git URLs, alias packages with @npm:) and isolate the clean package name registered in node_modules.
    • Added extract_pip_requirement_name in Pip partial scanning to strip constraint parameters before queries, ensuring alignment for partial sync operations.
  • OSC Sequence Filtering: Upgraded the streaming ANSI stripper to filter out Operating System Command (OSC) sequences (such as terminal title changes like \x1b]0;...), keeping the read-only simulated console clean and free of control character noise.

🏗️ Performance & UI Refinement

  • Rendering Precision Fix: Fixed a bug where RealTerminalPanel over-clipped trailing spaces when rendering pyte buffers, which previously led to interactive cursor offsets.
  • Concurrent Optimization: Integrated a version caching pool in Pip dependency constraint resolution, dramatically reducing repetitive PyPI registry metadata queries.

v11

v11

Choose a tag to compare

@LeoOfGit LeoOfGit released this 01 Jun 09:44

🇺🇸 [v11] - Security Upgrades, Atomic Config & Bulletproof WinGet Parser

🇨🇳 [v11] - 安全防御升级、配置原子化写入与 WinGet 解析防弹重构 (中文说明)

本次更新不仅解决了 WinGet 复杂输出场景下的表格解析崩溃问题,还大幅增强了底层的运行稳定性和网络安全性。涵盖配置文件的断电保护、下载件的安全签名校验以及 HTTP 代理的忽略证书特性。

🛡️ 网络安全与下载防御

  • 下载校验与数字签名防御:
    • 在 core/runtime_update.py 中引入了 Windows 平台原生的 Get-AuthenticodeSignature 强校验机制。自动验证下载的解释器/运行时安装包的 SHA256 指纹。
    • 实施严格的发行商白名单防御:强制要求签名归属于 “Python Software Foundation”、“Node.js Foundation” 或 “OpenJS Foundation”,一旦签名无效或发行商不匹配,将立即销毁文件并阻断安装,杜绝了由于网络劫持造成的投毒攻击。
  • 代理证书忽略特性:
    • 在 core/network_proxy.py 中新增了 insecure(忽略证书校验)设置项支持。开启后,不仅 urllib 请求会降级使用非受信任上下文,向下游 NPM 子进程注入环境变量时也会同步附加 NPM_CONFIG_STRICT_SSL=false 及 NODE_TLS_REJECT_UNAUTHORIZED=0,大幅提升了对企业内网或中间人抓包代理(如 Fiddler/Charles)环境的连通兼容性。

⚙️ 核心稳定性改进

  • 原子化配置写盘与损坏自愈:
    • 彻底重构了 core/config.py 中的存盘策略,采用 tmp 文件双缓冲机制配合 os.fsync 强制刷盘后安全原子替换(os.replace),彻底终结了因为系统断电、蓝屏或强杀进程导致的 omnipack_config.json 内容变为空白进而丢失所有状态的致命 Bug。
    • 增加了防崩溃自愈机制:在解析 JSON 配置失败时,会自动将损坏文件备份为 .corrupt.<timestamp>.json 并回退至默认配置以确保软件正常启动。
  • 精简发布包体积:
    • 修正了 build_app.py,移除了将 pypi_search_cache.json 强行打包进应用根目录的行为,确保了发版程序的纯净与轻量化。
  • 严格测试覆盖:
    • 编写了 test_winget_sanitize_output 流水线测试,并且修复了旧代码里因不合规的 Python invalid escape sequence 产生的运行告警。

🧩 WinGet 解析引擎终极重构

  • 控制字符与 ANSI 无伤过滤:
    • 在 core/winget_helpers.py 的 _sanitize_terminal_output 中实现了严苛的流接管,一比一高仿终端退格符 (\b) 与回车符 (\r) 逻辑,直接无视乱码和隐形控制符,确保表格列头不被进度条动画吃掉。
  • 动态列头坐标纠偏与 Ultimate Fallback:
    • 引入表头坐标偏移探测算法应对加载条占位符,且增加了极限回退机制:当标准的 ------ 分隔线被完全截断抹除时,底层算法会退化为扫描 Name 与 Id 关键字强行锚定列坐标,实现真正的乱码免疫。

This update addresses table parsing crashes in complex WinGet output scenarios and significantly enhances underlying runtime stability and network security. Major highlights include power-loss protection for config files, publisher verification for runtime downloads, and SSL verification bypassing for HTTP proxies.

🛡️ Network Security & Verification

  • Authenticode Signature Verification:
    • Introduced Windows native Get-AuthenticodeSignature strong verification in core/runtime_update.py to automatically verify SHA256 checksums of downloaded Python/Node.js installers.
    • Implemented strict publisher whitelist defense: Enforces signatures belonging to "Python Software Foundation", "Node.js Foundation", or "OpenJS Foundation". Installations are immediately aborted and files destroyed if signatures are invalid or publishers mismatch, preventing poisoning via network hijacking.
  • Insecure SSL/TLS Bypass:
    • Added insecure option in core/network_proxy.py. When enabled, it downgrades urllib requests to an untrusted SSL context and injects environment variables NPM_CONFIG_STRICT_SSL=false and NODE_TLS_REJECT_UNAUTHORIZED=0 to downstream NPM processes, improving compatibility with corporate intranets or proxy sniffers (e.g., Fiddler/Charles).

⚙️ Core Stability & Reliability

  • Atomic Config Writes & Auto-Recovery:
    • Completely refactored the saving strategy in core/config.py using a double-buffer tmp file mechanism with os.fsync disk flushing before atomic replacement (os.replace). This prevents omnipack_config.json corruption from power outages, system crashes, or process terminations.
    • Added self-healing recovery: Automatically backs up corrupted configurations as .corrupt.<timestamp>.json and reverts to defaults to ensure a successful application launch.
  • Packaging Optimization:
    • Corrected build_app.py to exclude pypi_search_cache.json from the application's root directory, ensuring a clean and lightweight package size.
  • Strict Test Coverage:
    • Added pipeline testing for WinGet terminal output sanitization (test_winget_sanitize_output) and fixed running warnings regarding Python invalid escape sequences.

🧩 Bulletproof WinGet Parser

  • Zero-Damage Control Character Filtering:
    • Implemented a strict stream filter in _sanitize_terminal_output (winget_helpers.py) that mimics backspace (\b) and carriage return (\r) terminal behaviors, filtering out progress animations and corrupt characters to preserve tabular columns.
  • Dynamic Offset & Ultimate Fallback:
    • Introduced column-header coordinate offset detection to handle loading bars and implemented an ultimate fallback. If the standard ------ separator line is truncated, the engine falls back to scanning Name and Id keywords to anchor column boundaries.

v10

v10

Choose a tag to compare

@LeoOfGit LeoOfGit released this 31 May 16:07

[v10] - 真实 PTY 交互终端集成、WinGet 代理自愈保障与安全机制升级 (Real PTY Terminal, WinGet Proxy Auto-Heal & Security Upgrades)

本次更新新加入了真正的 PTY (Pseudo-Terminal) 交互终端 集成,彻底摒弃了此前纯文本模拟控制台的局限性。支持完整的 ANSI 渲染、键盘捕获、命令同步注入以及增量刷新;同时,重构了 WinGet 命令行代理切换机制,引入了稳健的“启动即自愈代理”及系统级崩溃弹窗屏蔽锁;此外,将高风险的环境卸载与冲突警告模态确认(QMessageBox)重新安全归位,全面实现了全防灾与高流畅度运行。

🚀 真实 PTY 伪终端整合与静默同步 (Real PTY Terminal & Silent Sync)

  • 跨平台 PTY 后端与 ANSI 高彩渲染 (PTY Engine & ANSI Rendering):
    • Windows 下动态引入 pywinpty,macOS/Linux 直接调用标准库 pty 实现 0 增量跨平台共享。底层引入 pyte 解析器,完美高亮流式呈现 uv、pip、npm 等包管理器的动态字符进度条,杜绝了乱码和刷屏。
  • 按键劫持与双控制台热切换 (Input Hijack & Coexistence):
    • 重构 _TerminalTextEdit 文本框实现全按键劫持(支持 Tab 补全、方向键历史、密码隐形及 Ctrl+C 中断)。右侧区域以 QSplitter 动态组合:上为 Simulated 只读日志,下为 Real Terminal 伪终端,支持热切换和首选项持久化。
  • 环境静默同步与增量 Fast Refresh (Venv Sync & Fast Refresh):
    • 用户在界面跳转或激活虚拟环境时,主程序静默向 PTY 发送 cd/activate 命令实现终端联动。
    • 面板操作(如批量更新)直接转为命令行写入 PTY 终端,末尾拼接 UUID 标记(Marker)。后台正则检测 Marker,命令一结束即触发增量快速刷新 (Fast Refresh),避免了界面长期锁定。

⚙️ WinGet 代理自愈保障与模拟控制台联动 (WinGet Proxy Auto-Heal & Console Logging)

  • 启动自愈 WinGet 代理状态 (Start-up Auto-Heal):
    • 当软件启动并首次切入 WinGet 面板触发扫描刷新时,只要检测到配置文件中的代理为启用状态,系统会自动静默拉起 winget settings --enable ProxyCommandLineOptions 确保命令,彻底自愈因版本覆盖安装或先前配置丢失导致代理实际未生效的系统级问题。
  • 诊断指示标签降噪与控制台投射 (Settings Dialog Logging & Target Label):
    • 移除了由于配置或开关 WinGet 代理而弹出的所有前台模态对话框,将其静默且纯文本地输出在 WinGet 设置最下方的诊断状态标签(self.winget_diag_label)中。
    • 引入 _log_to_parent 机制,在开始/结束执行 WinGet 代理或源设置时,向外层模拟控制台原样输出执行 of CLI 命令(如 Executing: winget settings...)与任务终态(Success/Error)。
  • 防 GC 闪退与系统级弹窗完全封印 (Thread GC Protection & SetErrorMode):
    • 采用活跃线程防收留集合,杜绝后台自愈 QThread 因局部变量被 Python 垃圾回收所引发的 PySide 经典闪退。
    • 主入口点 run_main() 注入 SetErrorMode(0x0001 | 0x0002 | 0x8000),从根本上封锁并免除了管理员权限下执行商店别名 winget 偶发的 0xc0000142 系统级初始化崩溃弹窗。

🛡️ 高风险操作强模态确认安全归位 (Secure Action Recovery)

  • QMessageBox 强阻断避免误操作:
    • 纠正了非模态提示所带来的潜在环境损坏风险,将涉及 Python/Node.js/WinGet 三大板块的软件卸载、批量卸载、升级依赖约束警告以及构建分支切换提示等高风险破坏性操作全部重新改回 QMessageBox 的强阻断式模态询问弹窗,坚决捍卫用户开发环境的安全性。

v9

v9

Choose a tag to compare

@LeoOfGit LeoOfGit released this 22 May 07:31

[v9] - WinGet 系统级与用户级包管理支持 (WinGet System & User Package Management)

本次更新新加入了 Windows 系统内置包管理器 WinGet 的完整集成,支持对系统全局以及当前用户级别的软件进行可视化扫描、自动更新、锁定(Pin)、卸载与安装。同时完成了 UI 面板注册架构重构,支持在不同操作系统下动态加载对应管理器。

🚀 WinGet 深度整合 (WinGet Support)

  • 环境双 Scope 扫描 (Dual Scope Scanning):
    • 支持 系统范围 (System/Machine) 与 用户范围 (User) 的独立环境扫描,分别对应虚拟路径 winget://machine 和 winget://user。
    • 智能跨范围数据迁移与去重 (Smart Package Redistribution):读取 Windows 注册表 Uninstall 键下的 InstallLocation(支持 32/64 位及 HKLM/HKCU 注册表路径,支持 %USERPROFILE% 等前缀分析),将物理路径在用户目录下的软件智能划归为 User 范围,将 Program Files 等目录下的软件划归为 Machine 范围;若同一应用在两个范围重复安装,卡片上会自动显示 [Also Installed In User/Machine] 徽章标记,防重复探测。
  • 等宽列切片命令行解析 (Console Tabular Parser):
    • 使用字符渲染宽度解析机制(自动对东亚宽字符进行 padding/restore),通过固定列宽切片,彻底解决了 Winget 本地化(多语言)输出以及部分列数据为空时导致的列错位、合并漂移等解析难题。
  • 生命周期完整管控 (Full Lifecycle Actions):
    • 安装 (Install):支持直接输入 WinGet ID 进行精准安装,支持自动推荐及静默安装。
    • 更新 (Update & Batch Update):支持对单款应用更新,或勾选多款应用进行 批量并发升级。
    • 静默/交互卸载 (Uninstall/Remove):支持单款及批量并发静默卸载,带有安全确认对话框。
    • 锁定更新 (Blocking Pin):原生集成 winget pin。用户可以在 UI 界面通过 ⚙ 按钮直接锁定软件更新,锁定后显示 [Pinned] 徽章,同时不会被 "Outdated" 全局选项自动勾选。
    • 版本异常与降级保护:当本地安装版本新于 Registry 注册表最新版本时,自动显示 [⚠ Newer] 徽章并阻止误升级。
    • 多层 Scope 自动回退 (Scope Fallback):当安装或升级因权限/路径冲突在 Machine 范围失败时,会自动回退尝试以 user 范围(如 winget install --scope user)再次运行,最大程度保障操作成功率。

⚙️ 后端设置与实时诊断 (WinGet Settings & Diagnostics)

  • WinGet 后端管理 (Backend Settings):
    • Settings 页面新增 WinGet 后端设置(仅在 Windows 操作系统下可见)。
    • 自定义引擎路径:支持自动探测系统 PATH 上的 winget.exe,也支持用户手动浏览并指定特定路径。
    • 安装模式选择:支持配置默认的安装模式:静默模式 (silent)、交互模式 (interactive)、默认模式 (default)。
    • 实时诊断面板:可在 Settings 界面实时查看 WinGet 可用状态、绝对路径、当前版本号、已开启的 Registry 源个数以及详细的源状态错误。

🏗️ UI 面板注册重构 (Unified Panel Registration)

  • 动态面板系统:
    • 重构了主窗口 ui/main_window.py 内部结构,将写死的 Pip/Npm 面板完全抽象,改为基于配置字典的 _register_panel() 动态面板注册机制。
    • 按平台加载:仅当检测到 Windows 系统时才注册 WinGet 面板,其他系统自动隐藏,消除了跨平台冗余。
    • 统一了动态 Splitter 尺寸联动同步、首屏卡片防抖懒加载扫描、状态栏 counts 更新以及当前活动 Tab 的持久化记忆逻辑。

📦 通用控件与编译增强 (General Widget & Script Improvements)

  • 徽章渲染系统扩展:PackageCard 增加元数据 Badge 渲染机制,支持带有悬停提示 (ToolTip) 与自定义 QSS 样式的多种彩色徽章(如 [Pinned]、[Also Installed]、[⚠ Newer]、[Unknown])。
  • 可配置化 gear 动作按钮:当包 metadata 标记 supports_config 为 True 时,卡片上会自动渲染 ⚙ 配置图标并绑定专属弹窗(如 Python/Npm 显示 tag/版本,WinGet 显示 Pin/卸载路径等)。
  • 跨平台 Nuitka 编译缓存清理补丁:
    • 优化了 scripts/patch_nuitka_msvc.py 中的 pyc 缓存清理机制,使用 importlib.util.cache_from_source(path) 进行动态缓存路径解析,不再依赖硬编码的 Python 版本后缀,自动清理全平台/多版本 __pycache__ 缓存。

v8

v8

Choose a tag to compare

@LeoOfGit LeoOfGit released this 19 May 03:23

[v8] - 编译器加固、运行时安装回退与交互增强 (Compiler Hardening, Installer Fallback & UX)

本次更新围绕三大主题:构建系统从单一 Zig 编译器升级为 MSVC 优先的智能编译链(兼顾缓存与性能)、winget 不可用时自动回退至官方安装器下载、以及一键展开/折叠等多项 UI 交互改进。

🛠️ 构建系统 MSVC 编译器支持 (MSVC Compiler Toolchain)

此前构建仅使用 Zig 编译器后端,无法利用 MSVC 的跨构建缓存(clcache)加速。本轮实现完整 MSVC 自动检测链:

  • detect_msvc_env() 自动检测引擎:支持三层搜索策略——① 显式路径(msvc_path.cfg 配置文件 → MSVC_VCVARS_PATH 环境变量 → VS Insiders 默认路径);② VS Insiders 扁平布局(Microsoft Visual Studio\18\Insiders\VC\Auxiliary\Build\vcvars64.bat);③ 传统布局(<year>\<edition>\VC\Auxiliary\Build\vcvars64.bat)。找到 vcvars64.bat 后通过 _capture_vcvars_env() 捕获完整环境变量并通过 MSVC_USE_SCRIPT 传递给 SCons。
  • _capture_vcvars_env() 路径空格修复:使用 shell=True + cmd /V:ON /C "call \"<path>\" && set" 替代手动拼接命令串,彻底解决 Visual Studio 路径含空格时 subprocess.run 参数解析失败的问题。
  • 编译器优先级:detect_msvc_env() 成功 → 使用 MSVC(--msvc=X.Y);失败 → 回退 Zig。MSVC 模式下可复用 clcache 跨构建缓存,大幅加速重复编译。
  • build_app.py 命令行参数:新增 --clean 选项(清理 dist 目录后全量重编译),不带参数时默认增量构建复用缓存。
  • Nuitka MSVC 补丁脚本:新增 scripts/patch_nuitka_msvc.py,为 Nuitka 的 SconsUtils.py 注入 MSVC_USE_SCRIPT 环境变量支持,使得 SCons 能通过环境变量而非注册表/vswhere 发现非标准安装的 Visual Studio(如 Insiders 版)。支持 --check / --revert 操作,自动清理 .pyc 缓存。
  • 入口点重命名:OmniPack.pyw → OmniPack.py,构建与调试入口统一。

🔄 运行时安装器回退:winget 不可用时的自动救援 (Runtime Installer Fallback)

winget 在某些系统/网络环境下源不可用(failed when opening source / 0x8d15000f),导致 Python/Node.js 运行时更新完全失败。本轮新增从官方源下载安装器的完整回退链路:

  • 下载引擎:download_runtime_installer() 从 python.org / nodejs.org 下载官方安装器到临时目录,支持断点监控(每 ~0.8s 或每 5 MiB 回调进度),下载不完整自动清理。
  • 静默安装命令生成:build_installer_run_command() — Python 使用 /quiet InstallAllUsers=1 PrependPath=1;Node.js 使用 msiexec /i <msi> /quiet /norestart。
  • winget 失败检测:RuntimeUpdateWorker (pip/npm) 检测子进程输出中的 failed when opening source 或 0x8d15000f,区分 "winget 源不可用" 与 "其他命令失败"。
  • runtime_update_done 信号扩展:从 3 参数 (env_path, success, message) 扩展为 5 参数 (env_path, success, message, winget_failed, target_version),下游 Panel 可判断是否需要触发安装器回退。
  • 用户交互对话框:_offer_installer_fallback() 弹出三选项对话框 — "Download & Install" 自动下载并静默安装、"Open Download Page" 在浏览器中打开下载页、"Cancel" 跳过。
  • RuntimeInstallerWorker:在 pip_panel.py / npm_panel.py 中分别实现,基于 BaseCmdWorker 共享基类,实时输出下载进度与安装状态到控制台。

🖥️ UI 交互增强 (UI/UX Improvements)

  • 一键展开/折叠所有环境卡片:工具栏新增 Expand 三态复选框。部分展开时显示半选态(PartiallyChecked),点击后统一展开;全展开时显示勾选态,点击后全部折叠。每个环境卡片展开/折叠时通过 expand_toggled 信号驱动复选框状态同步。
  • Settings 环境列表增强:拖拽排序保存后,主界面卡片顺序即时同步重排(_reorder_env_cards());双击编辑已有环境;按 Delete 键快捷删除选中项(eventFilter 监听 Qt.Key_Delete);提示文案更新为 "Drag to reorder; Double click to edit; Del key to remove"。
  • Settings Auto Detect 重构:Python 自动扫描从内联路径遍历重构为调用 find_system_pythons() 统一函数,利用带标签的扫描结果(py_info["name"] / py_info["tags"])通过 config_mgr.add_pip_env() 正式接口添加,消除重复代码。

🧠 依赖解析增强 (Dependency Resolution)

  • PEP 508 环境标记求值引擎:dep_resolver.py 新增完整的 marker 解析与求值链 — split_requirement_marker() 分离 requirement 与 marker → marker_applies() 优先使用 packaging.markers.Marker.evaluate()(若可用)→ _evaluate_marker_fallback() 内置回退求值器。支持 python_version、sys_platform、os_name、platform_machine 等全部标准 marker 变量,自动跳过不适用于当前平台/环境的依赖项(如 sys_platform != "win32" 的条件依赖不再污染 Windows 上的依赖树)。
  • 版本约束智能简化:simplify_constraint() 合并冗余约束 — >=1.0, >=1.5 → >=1.5;<2.0, <=1.9 → <=1.9 — 使依赖树中显示的需求更清晰精简。
  • _restore_package_state() 新参数:新增 restore_update_state 开关。完整后台扫描(--outdated 已重新查询)时设为 False,不再从旧包状态恢复过期的 has_update / latest_version,避免陈旧数据污染新扫描结果。

📦 NPM 环境路径解析修正 (NPM Path Resolution)

  • resolve_env_command_context() 统一方法:替代此前分散在各 Worker 中的 is_global = (env.type == "global" or env.path == "global") 判断。正确识别三种场景:
    • 标记为 global → -g 标志,无 cwd
    • 路径为 %APPDATA%\npm\node_modules(Roaming 全局包)→ -g --prefix <dir>,确保更新包文件同时刷新同级 CLI shims
    • 路径以 node_modules 结尾 → cwd 为其父目录,支持本地项目
  • roaming_modules_path():返回 Windows Roaming npm 的 node_modules 路径。
  • get_global_prefix_and_root():通过 npm prefix -g / npm root -g 查询全局安装位置。
  • 所有 NPM Worker(NpmScanWorker、NpmUpdateCheckWorker、NpmActionWorker、NpmBatchUpdateWorker)统一采用新方法并支持 --prefix 参数。

⚡ 控制台日志优化 (Console Log Refinements)

  • 命令感知心跳标签:\r 进度行与 \n 日志行分流处理 — \r 结尾的行视为进度条更新(按 ~0.8s 节流避免刷屏),\n 结尾的行即时输出。
  • 上下文感知心跳:长时间无输出时的心跳消息根据命令类型动态切换 — uv/pip → "downloading/installing packages...",npm → "downloading npm packages...",winget → "waiting for winget..."。
  • 长静默提示精简:30 秒无输出的提示从多行详细说明精简为一行 "still no output from subprocess — large download or build in progress"。
  • uv -v 详情标志:UpdateWorker、BatchUpdateWorker、InstallWorker 中 uv pip install 命令统一添加 -v 标志,提供更丰富的下载/构建日志。

🐧 跨平台增强

  • macOS Python.org 框架路径:find_system_pythons() 新增扫描 /Library/Frameworks/Python.framework/Versions/X.Y/bin/python3,自动发现通过官方 pkg 安装的 Python。