Skip to content

fix(nsis-web): appPackageUrl regression: stop appending arch paths to explicit URLs#9655

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-app-package-url-regression
Draft

fix(nsis-web): appPackageUrl regression: stop appending arch paths to explicit URLs#9655
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-app-package-url-regression

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 24, 2026

When a user explicitly sets appPackageUrl in nsisWeb, arch-specific filenames were still being appended to it (e.g. https://example.com/download/latest/MyApp-1.0.0-x64.nsis.7z), making version-independent download URLs impossible.

Root cause: APP_PACKAGE_URL_IS_INCOMPLETE was unconditionally set in WebInstallerTarget.configureDefines, causing the NSIS template to always append /${APP_64_NAME} (etc.) regardless of whether the URL was user-supplied or auto-computed.

Changes

  • WebInstallerTarget.ts: Move defines.APP_PACKAGE_URL_IS_INCOMPLETE = null inside the if (appPackageUrl == null) branch — the flag is now only set when the URL is auto-computed from publish configs (a base URL that genuinely needs arch filename appended at runtime). An explicit appPackageUrl is used as-is.

  • webInstallerTest.ts: Add regression test asserting that APP_PACKAGE_URL_IS_INCOMPLETE is absent from defines when appPackageUrl is explicitly provided.

// Before: https://example.com/download/latest → https://example.com/download/latest/MyApp-1.0.0-x64.nsis.7z ❌
// After:  https://example.com/download/latest → https://example.com/download/latest ✅
nsisWeb: {
  appPackageUrl: "https://example.com/download/latest",
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Regression in nsis-web target for appPackageUrl option</issue_title>
<issue_description>

  • Electron-Builder Version: 25.0.5
  • Node Version: n/a
  • Electron Version: n/a
  • Electron Type (current, beta, nightly): n/a
  • Target: nsis-web, Windows x64

Since #6964 the appPackageUrl doesn't work as intended because extra paths are appended to the URL, which means it's not possible to download the latest at a single URL (see #7732 for an example).

My understanding is that APP_PACKAGE_URL_IS_INCOMPLETE intentionally tried to skip setting the package name based on architecture, instead using the name specified with appPackageUrl, but #6964 will use the regular naming.</issue_description>

Comments on the Issue (you are @copilot in this section)

@mmaietta Would you mind sharing a minimum reproducible repo/gist for this issue? I'd like to create a unit test for this

Re: the PR, I'm wondering if it's just safer to revert, but I'd still like to do the unit test to prevent future regressions.</comment_new>
<comment_new>@mmaietta
Community PR contribution is welcome 🙃 </comment_new>


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 24, 2026

⚠️ No Changeset found

Latest commit: 1765aac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…COMPLETE when URL is auto-computed

Co-authored-by: mmaietta <5238867+mmaietta@users.noreply.github.com>
Agent-Logs-Url: https://github.com/electron-userland/electron-builder/sessions/9dde5509-d9a6-4528-a729-9efa7ee3f1f5
Copilot AI changed the title [WIP] Fix regression in nsis-web target for appPackageUrl option Fix nsis-web appPackageUrl regression: stop appending arch paths to explicit URLs Mar 24, 2026
Copilot AI requested a review from mmaietta March 24, 2026 16:59
@mmaietta mmaietta changed the title Fix nsis-web appPackageUrl regression: stop appending arch paths to explicit URLs fix(nsis-web): appPackageUrl regression: stop appending arch paths to explicit URLs Mar 26, 2026
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.

Regression in nsis-web target for appPackageUrl option

2 participants