Click here to Skip to main content
16,022,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
JSON
"config": {
  "forge": {
    "packagerConfig": {},
    "makers": [
      {
        "name": "@electron-forge/maker-squirrel",
        "config": {
          "name": "my_app"
        }
      }
    ]
  }
}


What I have tried:

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.
Posted
Updated 19-Sep-24 3:28am
v2

1 solution

The following might help in your config section:
JSON
"noMsi": true,
"shortcutName": "My App",
"createDesktopShortcut": true
Add this part to what you currently have and that should help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900