I’m working on an Electron app and using electron-forge to build the executable file. My goal is to create an installer that behaves like a typical Windows installer, including creating an app icon/shortcut on the desktop after installation.
Here’s what I’ve done so far:
Installed electron-forge and set up my project
Ran the command npm run make, which successfully creates the .exe file
Used the @electron-forge/maker-squirrel package as my maker
The problem is that when I run the installer, it installs the app, but no shortcut is created on the desktop. The app runs fine, but I need it to also create a desktop icon.
Here’s part of my package.json related to the maker:
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "my_app",
"setupIcon": "./assets/icon.ico", // Optional, to set a custom installer icon
"iconUrl": "https://yourwebsite.com/icon.ico", // URL to the icon for the app
"shortcutName": "MyApp", // Set the shortcut name
"createDesktopShortcut": true, // Create a desktop shortcut
"createStartMenuShortcut": true // Optionally create a start menu shortcut
}
}
]
}
}
What should I change or add to ensure the installer creates a desktop shortcut? Do I need to configure something additional for the Squirrel installer? Any help would be greatly appreciated.
Trying get execute able file for Mac and Linuxyour text
Tom Stevenson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.