Skip to content

Conversation

sabonerune
Copy link
Contributor

fix #9229

Change the format of the ProgID to something more unique.

The format recommended by Microsoft is:

  • [Program].[Component].[Version]
  • No spaces
  • Version portion is optional (but strongly recommended.)
  • Have no more than 39 characters.
  • Contain no punctuation (including underscores and slashes) except one or more periods.
  • Do not start with a digit.

https://learn.microsoft.com/windows/win32/shell/fa-progids#programmatic-identifier-elements-used-by-file-associations
https://learn.microsoft.com/windows/win32/com/-progid--key

In this PR, we set it as follows:

  • [Version] is omitted.
    This is useful if you have different versions of the same application installed at the same time, but electron
    -builder doesn't seem to expect this.
  • [Program] can contain up to 19 characters from the beginning of the following string.
    • productFilename with invalid characters removed.
    • If productFilename begins with a number, App will be added.
    • If all characters in productFilename are invalid, App${guid} will be used.
  • Set [Component] as follows:
    • Fill the ProgID up to 30 characters with ext or name, removing any unusable characters.
    • Finally, remove the hyphens and fill UUID.v5(name || ext, guid) up to the maximum ProgID.

I believe this will allow for the generation of unique ProgIDs while maintaining a certain degree of readability in the registry.


Is the Changeset patch correct?
I consider this change an undocumented, detailed behavior change in electron-builder.
However, custom NSIS scripts that expect the ProgID to be name or ext may no longer work correctly.

@mmaietta
Copy link
Collaborator

mmaietta commented Aug 7, 2025

I consider this change an undocumented, detailed behavior change in electron-builder.
However, custom NSIS scripts that expect the ProgID to be name or ext may no longer work correctly.

Based on this comment, this sounds like a Breaking change since we can't guarantee whether other custom NSIS scripts rely on this functionality. Curious on your thoughts? If we're aligned, then this will need to be pushed to the v27 release plans

Copy link

changeset-bot bot commented Sep 1, 2025

🦋 Changeset detected

Latest commit: 09f2f4e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Major
dmg-builder Major
electron-builder-squirrel-windows Major
electron-builder Major
electron-forge-maker-appimage Major
electron-forge-maker-nsis-web Major
electron-forge-maker-nsis Major
electron-forge-maker-snap Major

Not sure what this means? Click here to learn what changesets are.

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

@sabonerune
Copy link
Contributor Author

Changed changesets to major.

I submitted this as a patch because the documentation does not explain how the name is used and how the ProgID is determined.
Also, I don't think there is any need to be concerned with code that relies on internal workings.

However, considering that there is little information in the documentation for custom NSIS scripts, it may be better to make them major.

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.

ProgID used in NSIS associations may not be unique enough to be appropriate.
2 participants