Skip to content

feat(nsis): add support for more Windows Installer options #9119

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 4 commits into
base: master
Choose a base branch
from

Conversation

mtdvlpr
Copy link

@mtdvlpr mtdvlpr commented May 20, 2025

Closes #9105

Copy link

changeset-bot bot commented May 20, 2025

🦋 Changeset detected

Latest commit: cf2ddfa

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 Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

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

UNINSTALL_URL_HELP: options.uninstallUrlHelp || this.packager.info.metadata.homepage || undefined,
UNINSTALL_URL_INFO_ABOUT: options.uninstallUrlInfoAbout || this.packager.info.metadata.homepage || undefined,
UNINSTALL_URL_UPDATE_INFO: options.uninstallUrlUpdateInfo || this.packager.info.metadata.homepage || undefined,
UNINSTALL_URL_README: options.uninstallUrlReadme || this.packager.info.metadata.homepage || undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think undefined may have unexpected side effects. Note: defines.ENABLE_LOGGING_ELECTRON_BUILDER = null where null is used as a flag (I guess implicitly represents a boolean in the nsis scripts?)

Easy way around this - only set the defines var when provided a value

const { homepage } = this.packager.info.metadata
// `use` from builder-util IIRC
use(options.uninstallUrlHelp || homepage, (it) => defines.UNINSTALL_URL_HELP = it)
use(options.uninstallUrlInfoAbout || homepage, (it) => defines.UNINSTALL_URL_INFO_ABOUT = it)
use(options.uninstallUrlUpdateInfo || homepage, (it) => defines.UNINSTALL_URL_UPDATE_INFO = it)
use(options.uninstallUrlReadme || homepage, (it) => defines.UNINSTALL_URL_README = it)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, wondering if we need to allow disabling the field from being set if the developer doesn't want their homepage to show there. Curious on your thoughts? Basically, uninstallUrlHelp?: string | false

Copy link
Author

Choose a reason for hiding this comment

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

I don't think that's necessary. The only use case for defining the homepage is to show it somewhere, whether that's the npm registry or somewhere else, you want that homepage to be linked to the project.

@mtdvlpr mtdvlpr requested a review from mmaietta May 25, 2025 09:19
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.

Add support for Windows Installer Properties for the Uninstall Registry Key
2 participants