electron / windows-installer

Build Windows Installers for Electron apps
MIT License
1.55k stars 259 forks source link

`setupIcon` config failed when `productName` contains chinese character ;`Fatal error: Unable to load file` #490

Open rosendolu opened 8 months ago

rosendolu commented 8 months ago

Reproduce Steps

Clone this repo https://github.com/rosendolu/electron-app-debug

git clone https://github.com/rosendolu/electron-app-debug
npm i 
npm run make
// forge.config.js
...,
    {
      name: '@electron-forge/maker-squirrel',
      config: {
          // The ICO file to use as the icon for the generated Setup.exe
          setupIcon: path.resolve(__dirname, './icon/app.ico'),
      },
    },
// package.json
...,
  "name": "electron-app",
  "productName":"electron中文",

You will got this error

img_v2_1cb741c3-2fbe-45da-b866-e32145406c6g

But if you remove the chinese characters of productName in package.json

// package.json
...,
  "name": "electron-app",
  "productName":"electron",

Or just remove the custom setupIcon conf

// forge.config.js
...,
    {
      name: '@electron-forge/maker-squirrel',
      config: {
          // The ICO file to use as the icon for the generated Setup.exe
          // setupIcon: path.resolve(__dirname, './icon/app.ico'),
      },
    },

Every works well !

As above pic shows , spawn process exit with code 1,but I can`t figure out how to solve it ,any advice would be grateful.

anaisbetts commented 8 months ago

This is a still-open bug in Squirrel.Windows at the moment, I'm not sure that there is any way to fix it at the moment other than by using Roman characters in the name, sorry :(