node-system-icon icon indicating copy to clipboard operation
node-system-icon copied to clipboard

Doesn't fetch correct icons for Windows 10

Open akodkod opened this issue 6 years ago • 1 comments

Hi,

I've used system-icon on my Mac and everything works properly (thanks). But when I've run my application on Windows 10 this is always (almost) fetch default icon for files.

Also, sometimes I got an error when I try to get folder icon. It's really random error because when I re-run it works.

Please, see screenshot for proof.

system icon

This is my code:

export function saveFolderIcon(filePath, fileName, callback) {
  const foldersIconsPath = config.get('foldersIconsPath')

  getIconForPath(filePath, ICON_SIZE_MEDIUM, (err, res) => {
    if (err) return console.error(err)

    const folderIconPath = path.join(foldersIconsPath, `${fileName}-64x64.png`)

    fs.writeFile(folderIconPath, res, callback)
  })
}


export function saveExtIcons(...) {
  // ...

  getIconForExtension(ext, ICON_SIZE_MEDIUM, (errExt, res) => {
    if (errExt) return console.error(errExt)

    const iconPath = path.join(extIconsPath, iconName)
    fs.writeFile(iconPath, res)
  })

  // ...
}

Any ideas?

akodkod avatar Mar 15 '18 20:03 akodkod