Please be aware that the examples for icon file path tend to assume that main.js is under the base directory. If the file is not in the base directory of the app, the path specification must account for that fact.
For example, if the main.js is under the src/ subdirectory, and the icon is under assets/icons/, this icon path specification will work:
icon: __dirname + "../assets/icons/icon.png"