Skip to content

feat(updater): add Chocolatey as optional Windows package manager#111

Merged
dbfx merged 3 commits intomainfrom
feat/chocolatey-support
Apr 3, 2026
Merged

feat(updater): add Chocolatey as optional Windows package manager#111
dbfx merged 3 commits intomainfrom
feat/chocolatey-support

Conversation

@dbfx
Copy link
Copy Markdown
Contributor

@dbfx dbfx commented Apr 3, 2026

Summary

  • Adds Chocolatey (choco) as an alternative Windows package manager in the Software Updater, alongside winget
  • Adds a Windows package manager dropdown in Settings so users can choose between winget and Chocolatey
  • Automatically falls back to the other manager if the preferred one is not installed
  • Full upgrade pipeline: normal attempt, elevation fallback via UAC, and --force retry

Changes

  • src/main/services/software-updater.ts — Chocolatey backend (parse, check, upgrade), Windows dispatcher with fallback
  • src/shared/types.tswindowsPackageManager setting, 'choco' in packageManagerName union
  • src/main/services/settings-store.ts / src/renderer/src/stores/settings-store.ts — Default: winget
  • src/main/services/ipc-validation.ts — Validation for the new setting
  • src/renderer/src/pages/SettingsPage.tsx — Windows-only dropdown in General section
  • src/renderer/src/pages/SoftwareUpdaterPage.tsx — "choco not found" error with install link
  • Locale files — i18n strings for settings and error messages
  • Test files — Parse function tests + validation tests

Test plan

  • npm test — all 1937 tests pass
  • Manual: Settings page shows dropdown on Windows, hidden on other platforms
  • Manual: Selecting Chocolatey persists and Software Updater uses choco outdated
  • Manual: If preferred manager missing, falls back to the other automatically
  • Manual: Upgrade pipeline works (choco upgrade <id> -y) with elevation fallback

🤖 Generated with Claude Code

Add Chocolatey (`choco`) as an alternative to winget in the Software
Updater, with a Settings dropdown to choose between them. Falls back
to the other manager automatically if the preferred one is not installed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ec9f39294

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/services/software-updater.ts
Comment thread src/main/services/software-updater.ts Outdated
Pass the packageManagerName from the scan result through to runUpdates
so updates use the manager that produced the app IDs, not the current
setting. Also return per-app errors when no manager is available instead
of a silent no-op.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dbfx dbfx merged commit e030f6b into main Apr 3, 2026
7 of 8 checks passed
@dbfx dbfx deleted the feat/chocolatey-support branch April 3, 2026 09:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a819e552a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +810 to +812
// Fallback: use the setting preference with availability check
const settings = getSettings()
const preferChoco = settings.windowsPackageManager === 'choco'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require stable manager selection for Windows update runs

This fallback path still binds update execution to the current setting when source is omitted, so callers that only send appIds can dispatch IDs to the wrong backend if settings/availability change between check and run. Fresh evidence: while the renderer now passes source, handleUpdateRun in src/main/services/cloud-agent.ts (around lines 2328-2343) still calls runUpdates(appIds, () => {}) without manager context, so previously checked winget IDs can be sent to Chocolatey (or vice versa) and fail.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant