forge icon indicating copy to clipboard operation
forge copied to clipboard

`setupIcon` in `@electron-forge/maker-squirrel` config does not make use of `fromBuildIdentifier`

Open eliw00d opened this issue 2 years ago • 1 comments

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

If I set setupIcon to the result of fromBuildIdentifier, I get Fatal error: Unable to set icon.

    {
      name: '@electron-forge/maker-squirrel',
      config: {
        name: fromBuildIdentifier({ beta: 'Beta', prod: 'Prod' }), // works
        setupIcon: fromBuildIdentifier({ beta: './assets/betaSetup.ico', prod: './assets/prodSetup.ico' }), // does not work
      },
    },

Proposed solution

It seems as though name works correctly but not setupIcon. So, it just needs to be proxified like name.

Alternatives considered

As a workaround, I am able to do:

    {
      name: '@electron-forge/maker-squirrel',
      config: {
        name: fromBuildIdentifier({ beta: 'Beta', prod: 'Prod' }), // works
        setupIcon: fromBuildIdentifier({ beta: './assets/betaSetup.ico', prod: './assets/prodSetup.ico' }).map[buildIdentifier], // works
      },
    },

Where buildIdentifier is defined as a constant at the top of the config file.

Additional information

I am using 6.0.5.

eliw00d avatar Feb 16 '23 21:02 eliw00d

I've encountered this as well. It looks like the implementation of fromBuildIdentifier isn't correct. It simply doesn't work at all. maybe just remove it from the docs for now? I can setup my own maps easily.

dopry avatar Feb 07 '25 05:02 dopry