Squirrel.Windows icon indicating copy to clipboard operation
Squirrel.Windows copied to clipboard

Squirrel Startup Exe Icon missing

Open AzonInc opened this issue 3 years ago • 8 comments

I'm generating Setup Files witrh the Electron-Forge Squirrel Maker. However after trying several things and seraching for similar Issues, its not possible to get the App Icon working.

It's still the default Package Icon, which shouldn't be there (see: Restaurant Companion.exe) image The Packaged App has the correct Icon assigned (Restaurant Companion.exe, squirrel.exe): image The Control Panel Icon is also correct: image

My Forge Config:

const path = require('path');
const package = require('./package.json');

module.exports = {
  packagerConfig: {
    asar: true,
    icon: path.resolve(__dirname, 'src', 'assets', 'images', 'icon.ico')
  },
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      platforms: ['win32'],
      config: (arch) => {
        return {
          name: 'RestaurantCompanion',
          authors: 'Brogli Informatik GmbH',
          exe: 'Restaurant Companion.exe',
          noMsi: true,
          remoteReleases: '',
          loadingGif: path.resolve(__dirname, 'src', 'assets', 'images', 'setup-animation.gif'),
          setupExe: `RestaurantCompanion-${package.version}-setup-${arch}.exe`,
          setupIcon: path.resolve(__dirname, 'src', 'assets', 'images', 'icon.ico'),
          iconUrl: "https://REMOVED/restaurant-companion/icon.ico",
          signWithParams: process.env['WINDOWS_CODESIGN_ARGS']
        }
      }
    },
    {
      name: '@electron-forge/maker-zip',
      platforms: ['darwin', 'win32']
    },
    {
      name: '@electron-forge/maker-deb',
      platforms: ['linux']
    },
    {
      name: '@electron-forge/maker-rpm',
      platforms: ['linux']
    }
  ]
};

AzonInc avatar Feb 12 '22 16:02 AzonInc

@AzonInc have you figured out what was going on yourself? I've been looking into it and may have some insight. What does your package.json look like? Specifically the productName and name fields.

easternmotors avatar May 06 '22 16:05 easternmotors

Hi, @easternmotors . I was not able to get it working yet.

Here the relevant package json part:

  "name": "restaurant-companion",
  "productName": "Restaurant Companion",
  "version": "1.6.0-beta.5",
  "description": "Restaurant CMS - Companion App",
  "main": "src/main.js",
  "scripts": {
    "install": "electron-rebuild",
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make --platform win32",
    "publish": "electron-forge publish",
    "version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
  },
  "keywords": [],
  "author": {
    "name": "BIT GmbH",
    "email": "[email protected]"
  },
  "license": "MIT",
  "config": {
    "forge": "./forge.config.js"
  },```

AzonInc avatar May 07 '22 19:05 AzonInc

Did anyone manage to get to the bottom of this? Best we can tell, there may be a stale icon in some registry entry somewhere.

thorsent avatar Mar 13 '23 20:03 thorsent

@thorsent no, still experiencing this issue. It only seems to be an issue when one of the variable which has a fallback of packageJSON.name is overwritten (like productName in the example from @AzonInc above -- if not set it defaults to packageJSON.name). If I had to guess, the issue is that somewhere it is pulling the variable from packageJSON.name for a path instead of the custom name being set, causing a failed lookup -- but this is just a guess. I haven't had time in a while to dive into the root cause.

easternmotors avatar Mar 14 '23 18:03 easternmotors

@AzonInc, I had a similar issue with the icon and upon doing some research, I discovered that the ID (name in package.json) should not contain dots or spaces. I had a dot in the name, so I changed it to a dash. However, this did not resolve the issue. Then, I tried removing all non-alphabetical characters, and after making this change, the icon started to work properly.

lukasz-mical avatar Apr 13 '23 07:04 lukasz-mical

I followed @lukasz-mical's advice and removed the spaces from my packagerConfig.name in my forge.config.js

This fixed the setup.exe icon on Windows for me.

lggarrison avatar Nov 27 '23 22:11 lggarrison

My support team informs me that some antivirus programs may prevent rcedit from modifying the icon (perceiving it as an attack on an executable). Setting environment variable DEBUG=* causes rcedit to output logs which may help trace when this happens.

Not sure if this is therefore independent of the reported issues with spaces and other non-alphabetical characters.

thorsent avatar Jan 22 '24 21:01 thorsent