Skip to content

fix(nsis): Change the ProgID to a more correct, more unique format #9241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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