Version:
"electron-builder": "^20.9.0"
Target:
Windows: NSI
Hello,
I am after some help in creating my Electron application for windows using NSI which creates the installer for me.
I wish to have Electron to produce the exe as one name and to have a different name used for the add/remove programs uninstall list.
Here is a copy of my build section from my package.json
"build": {
"appId": "lucene.index.explorer",
"productName": "Lucene Index Explorer",
"extraResources": {
"from": "../LIE.Server/bin/dist/",
"to": "LIE.Server/bin/dist/",
"filter": [
"**/*"
]
},
"win": {
"target": [
"nsis"
],
"icon": "build/icon.png"
},
"nsis": {
"deleteAppDataOnUninstall": true,
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"shortcutName": "Lucene Index Explorer",
"artifactName": "LIE.Setup.${version}.${ext}"
}
}
So if I set productName to LIE which will generate a LIE.exe and the Desktop and Start Menu shortcut shows up as Lucene Index Explorer by using shortcutName however in the Add or Remove Programs list it displays as LIE as opposed to Lucene Index Explorer.
Is there any config setting I have missed or can use, so I can achieve this please?
This will just make life easier for people viewing the running processes with Task Manager on Windows to see the running LIE.Server process and the main LIE application along side each in the list of processes IMO.
Look forward to hearing back from you.
Thanks,
Warren :)
I cannot reproduce. And shortcutName not required since it is equal to product name.
Please remove old app, restart windows and install again. Still no product name? Attach your exe or send me by email to test and attach here dist/electron-builder-effective-config.yaml.
dist/electron-builder-effective-config.yaml
directories:
output: dist
buildResources: build
appId: lucene.index.explorer
productName: Lucene Index Explorer
extraResources:
from: ../LIE.Server/bin/dist/
to: LIE.Server/bin/dist/
filter:
- '**/*'
win:
target:
- nsis
icon: build/icon.png
nsis:
deleteAppDataOnUninstall: true
createDesktopShortcut: true
createStartMenuShortcut: true
artifactName: 'LIE.Setup.${version}.${ext}'
electronVersion: 1.8.4
So the installer gets generated as LIE.Setup.1.0.0 just fine

However the actual final application exe is called Lucene Index Explorer.exe which I want to be named LIE.exe

And yes shortcut name is fine

So the only problem I have is that the final application .exe is not called LIE.exe

I attempted to set productName: "lie" and also have shortcutName: "Lucene Index Explorer" which solves the problem of my final executable being called lie.exe and the desktop shortcut and start menu item being called the full name.
However by doing it this way the list of programs to remove will list/display it as LIE 1.0.0 and users are unlikely to know to search for that when trying to uninstall the program.
If you need any more details or specifics from me @develar let me know and thanks again for the awesome help :)
@warrenbuckley I don't think this is currently possible, as productFileName (which is later used to identify the actual output file name - the one you are trying to change) is generated based on productName using simple sanitization.
If I'm right and this is the case though, it shouldn't be too hard to add the productFileName option to the configuration file and only fall back on productName if it's not provided.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Feel free to close this and re-open if it its needed.
Most helpful comment
@warrenbuckley I don't think this is currently possible, as
productFileName(which is later used to identify the actual output file name - the one you are trying to change) is generated based onproductNameusing simple sanitization.If I'm right and this is the case though, it shouldn't be too hard to add the
productFileNameoption to the configuration file and only fall back onproductNameif it's not provided.https://github.com/electron-userland/electron-builder/blob/2dda5fcb45d99a0a991d195a2f577e3dbca775eb/packages/electron-builder-lib/src/appInfo.ts#L32-L33