Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Create exe with one name & use another for the add/remove programs list #2813

Closed
warrenbuckley opened this issue Apr 19, 2018 · 6 comments

Comments

@warrenbuckley
Copy link

  • 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 :)

@develar
Copy link
Member

develar commented Apr 20, 2018

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.

@warrenbuckley
Copy link
Author

warrenbuckley commented Apr 20, 2018

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
image

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

image

And yes shortcut name is fine
image

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

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 :)

@skreborn
Copy link

@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.productName = info.config.productName || info.metadata.productName || info.metadata.name!
this.productFilename = sanitizeFileName(this.productName)

@stale
Copy link

stale bot commented Jul 2, 2019

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.

@stale stale bot added the backlog label Jul 2, 2019
@warrenbuckley
Copy link
Author

Feel free to close this and re-open if it its needed.

@Tanimodori
Copy link

This issue is fixed in #5409, just use win.executableName or any other platforms you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants