Skip to content

feat(plugin-electron): patch packaged executable with gpupatch - #70

Draft
Armaldio wants to merge 1 commit into
mainfrom
feature/gpupatch-integration
Draft

feat(plugin-electron): patch packaged executable with gpupatch#70
Armaldio wants to merge 1 commit into
mainfrom
feature/gpupatch-integration

Conversation

@Armaldio

Copy link
Copy Markdown
Member

What

Adds a "Patch executable" checkbox to the Electron plugin. When enabled, the packaged Windows executable is patched with gpupatch, which injects NvOptimusEnablement and AmdPowerXpressRequestHighPerformance so the app always uses the discrete GPU on laptops.

How

  • New patchExecutable boolean input surfaced as Windows-only via the platforms: ['win32'] chip (see ParamEditor.vue).
  • src/shared/libs/plugin-electron/gpupatch.ts maps the host platform/arch to a gpupatch release asset, downloads the CLI once to <userData>/thirdparty/gpupatch, and patches the packaged exe in place (temp file + rename to avoid the CLI's interactive stdin wait).
  • forge() runs the patch after a package build when enabled; non-win32 targets are skipped with a log message.
  • Wired through package-v2.ts, defaults in utils.ts, DesktopApp.Electron type, and the c3toSteam preset.

Testing

  • Unit tests for the asset-name mapping (gpupatch.spec.ts) — 24/24 tests pass.
  • typecheck:node: no new errors (59 pre-existing, unrelated).
  • ESLint clean on new files.

Notes

  • Includes a changeset (minor) per repo convention.
  • Runs on the host OS and patches the win32 target binary, so Windows builds can be patched from any supported host.

Adds a 'Patch executable' checkbox to the Electron plugin. When enabled, the
packaged Windows executable is patched with gpupatch to force high-performance
discrete GPU utilization. The option is surfaced as Windows-only in the UI and
the gpupatch CLI is downloaded on first use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant