Is there a way to have electron-forge add a Windows desktop shortcut when the user installs the app?
This is handled via a separate module, please see the documentation in electron/windows-installer's README.
Thank you, this is exactly what I needed. It works perfectly.
The name of the shortcut defaults to Electron is there a way to change it?
@Armageddonas check out the issue tracker for electron-squirrel-startup, that should be more helpful.
@Armageddonas You need to configure the win32metadata options of packagerConfig to change the details the shortcut uses 馃憤
MarshallOfSound I have added the metadata to the packagerConfig section and it's still showing 'Electron' for the shortcut name. I might be using the incorrect fields. Could you check over my config section and see if i'm doing it right? I also have the "name" and "productName" at the top of the package.json file.
"config": {
"forge": {
"make_targets": {
"win32": [
"squirrel"
],
"darwin": [
"zip"
],
"linux": [
"deb"
]
},
"electronPackagerConfig": {
"packageName": "MyApp",
"name": "MyApp",
"productName": "MyApp"
},
"electronWinstallerConfig": {
"packageName": "MyApp",
"name": "MyApp",
"productName": "MyApp"
},
"electronInstallerDebian": {},
"electronInstallerRedhat": {},
"github_repository": {
"owner": ""
},
"windowsStoreConfig": {
"packageName": "MyApp",
"name": "MyApp",
"productName": "MyApp"
}
}
},
Here is the Squirrel setup log showing it's creating the shortcut but doesn't change the name.
SquirrelSetup.log
2017-02-07 09:44:25> Program: Starting Squirrel Updater: --createShortcut=MyApp.exe
2017-02-07 09:44:25> ApplyReleasesImpl: About to create shortcuts for MyApp.exe, rootAppDir D:\Users\parkour86\AppData\Local\MyApp
2017-02-07 09:44:25> ApplyReleasesImpl: Creating shortcut for MyApp.exe => D:\Users\parkour86\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc.\Electron.lnk
2017-02-07 09:44:25> ApplyReleasesImpl: About to save shortcut: D:\Users\parkour86\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\GitHub, Inc.\Electron.lnk (target D:\Users\parkour86\AppData\Local\MyApp\MyApp.exe, workingDir D:\Users\parkour86\AppData\Local\MyApp\app-0.0.3, args , toastActivatorCSLID c2b9ff11-e8c9-57ce-9b4d-d4793aaffa03)
2017-02-07 09:44:25> ApplyReleasesImpl: Creating shortcut for MyApp.exe => D:\Users\parkour86\Desktop\Electron.lnk
2017-02-07 09:44:25> ApplyReleasesImpl: About to save shortcut: D:\Users\parkour86\Desktop\Electron.lnk (target D:\Users\parkour86\AppData\Local\MyApp\MyApp.exe, workingDir D:\Users\parkour86\AppData\Local\MyApp\app-0.0.3, args , toastActivatorCSLID c2b9ff11-e8c9-57ce-9b4d-d4793aaffa03)
2017-02-07 09:44:25> ApplyReleasesImpl: Examining Pin: Sublime Text 3.lnk
@parkour86 when @MarshallOfSound mentioned win32metadata, he meant the parameter in Electron Packager.
@MarshallOfSound @malept Thank you both for your answers i am glad. The following configuration worked
```
"electronPackagerConfig": {
"version-string":{
"ProductName": "MG Downloader",
"CompanyName": "mgd"
}
}
````
Productname defines the name of the shortcut, not sure if the companyName is needed. version-string works but it is deprecated, i don't remember if i tried with win32metadata.
@Armageddonas version-string is now named win32metadata.
Your awesome @Armageddonas. It worked. For anyone else having this issue the variables are case sensitive. I tried it lowercase and it didn't work.
Feel free to resolve this issue as everything seems to be working nicely.
Using this (with win32metadata), I'm able to get Windows shortcuts but have two issues that I'm wondering if anybody can help me with. The packaged version of the app has a custom icon, but when I use make and then run the installer, it loses the icon. This causes the short cut not to have an icon either. Also, the start menu shortcut ends up in the GitHub folder for some reason...
Also don't forgot to pass FileDescription, otherwise the value will defaults to "Electron"
"electronPackagerConfig": {
"version-string":{
"FileDescription": "MG Downloader",
"ProductName": "MG Downloader",
"CompanyName": "mgd"
}
}
@thecuriousdev version-string has been removed in Forge v4, and also win32metadata.FileDescription defaults to the app name, see the corresponding changes in Electron Packager for details.
Most helpful comment
This is handled via a separate module, please see the documentation in electron/windows-installer's README.