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

App name not set correctly in Windows EXE metadata #166

Closed
p-bakker opened this issue Oct 23, 2015 · 19 comments
Closed

App name not set correctly in Windows EXE metadata #166

p-bakker opened this issue Oct 23, 2015 · 19 comments
Labels
bug 🐛 build-target:windows Bundling an Electron app specifically for Windows

Comments

@p-bakker
Copy link

Hi,

EDITED: This case is only about the item below. The case started out with more issues, but those are split off into separate cases and either already fixed, or related to issues outside Electron-packager. Only the item below remains:

  • If I run the executable and right-click on its icon after it launched, the name 'Electron' still shows (but with the icon I specified)

INITIAL CASE DESCRIPTION:
For the past day and a half I've been trying to package my app as a Windows executable. While the basic process works, I run into the following issues:

  • If I look at the file details of the created .exe:
    -- the 'File version' is still set to the used Electron version, although i specify another version
    -- the 'Product version' is empty
  • If I run the executable and right-click on its icon after it launched, the name 'Electron' still shows (but with the icon I specified)
  • If I pin the app, a new icon is created (when right-clicking that it also shows 'Electron', but also with the icon I specified)

Note that the generated .exe did get the supplied fileName, the suplied icon and that 'File description', 'Product name', 'Copyright' and 'Original filename' are set as specified

In my main.js I do call this: app.setAppUserModelId('com.squirrel.myCompany.myCompany');

I work on Windows 10 and am using the latest electron-packager version and use electron 0.34.0

This is the command I use:

electron-packager .\app\ myCompany --platform=win32 --arch=x64 --version="0.34.0" --overwrite --app-version="1.0" --icon="myCompany.ico" --app-bundle-id=myCompany --helper-bundle-id=myCompany --version-string.CompanyName="myCompany Inc." --version-string.ProductName=myCompany --version-string.FileDescription=myCompany --version-string.LegalCopyright="Copyright (C) 2015 myCompany Inc. All rights reserved." --version-string.ProductVersion=1.0 --version-string.FileVersion=1.0 --version-string.InternalName=myCompany --version-string.OriginalFilename=myCompany

I've seen many cases related to this, but all are marked as closed and should be included in the latest releases.

As I've looked everywhere for solutions and tried all that I could find and none worked, I'm posting this as a bug.

@malept malept added bug 🐛 help wanted Needs a contributor from the community labels Oct 23, 2015
@malept
Copy link
Member

malept commented Oct 23, 2015

The the first bullet point is #129/#143. Could you please test the change in #143 and report back in that PR?

@p-bakker
Copy link
Author

I had already seen that one and tried to manually make the same code changes as in that case, but that didn't solve the issue for me.

I manually tried calling rcedit on my exe and was able to alter the ProductVersion using the set-version-string syntax of rcedit, and that worked.

So the fact that it doesn't work from electron-builder makes me assume that there is something else going wrong, which might also be why the manually added codechanges from #129/#143 didn't help

@malept malept added the build-target:windows Bundling an Electron app specifically for Windows label Oct 23, 2015
@p-bakker
Copy link
Author

I might not have expressed myself clearly in my previous comment: I think the fix for #129 is valid, just that for me other things are going wrong due to which the File version still isn't set after applying the code changes from #129 manually

@p-bakker
Copy link
Author

The third bullet item might not be specific to electron-packager, but to electron itself: I've now tested running plain electron and I also see duplicated icons there once you pin the app. Maybe need to reopen electron/electron#1954

@max-mapper
Copy link
Contributor

I'm not good at Windows stuff, but wanted to mention it would be really helpful to know if we have tests for the reported bugs here. Even better, if we don't have any tests, if we could get some failing tests then that would be super amazing.

@p-bakker
Copy link
Author

For the third bullet item: see electron/electron#1954. It might be a Windows 10 and/or Electron issue, so not something specific to the electron-packager

@malept malept changed the title Several possible related Windows build issues App name not set correctly in Windows EXE metadata Oct 25, 2015
@malept
Copy link
Member

malept commented Oct 25, 2015

I assume that myCompany--platform=win32 in your command is a typo only in the issue text and not when it is run?

I've updated the issue title to reflect that this GitHub issue is only about the second bullet point now.

@p-bakker
Copy link
Author

yeah, that was just a typo, edited it now.

I don't think it is correct to dismiss the first item just yet: The first item is still an issue and not covered by #129. While the cause of #129 would explain the FileVersion not being set properly, it doesn't explain the ProductVersion not being set.

As for the second bullet: I've located the .lnk file that shows on the TaskBar and it is named Electron, hence it shows as Electron. Don't know if it is named Electron because is shows as Electron or that it shows as Electron because it is named Electron, but anyway: it shouldn't be Electron

@malept
Copy link
Member

malept commented Oct 25, 2015

I'm not a big fan of omnibus issues - it makes it more difficult to figure out what the issue's current status is. I'd rather there be a separate issue for the ProductVersion problem.

@p-bakker
Copy link
Author

ok, no problem: I've added them all in here originally, because they were all Windows 'branding' related issues and I had no idea how they related to each other.

I've created #172 for the issues described under the first bullet item

@p-bakker
Copy link
Author

For sake of completeness: the third bullet item seems to be a Windows 10 bug, scheduled to be fixed in the next Windows 10 update: electron/electron#1954 (comment)

@p-bakker
Copy link
Author

And again for the sake of completeness: the first bullet item was/is a combination of #129 and electron/node-rcedit#10

@p-bakker
Copy link
Author

Updated Windows 10 yesterday: the proper name now shows when right-clicking the icon on the taskbar, so seems to have been a Windows 10 issue, resolved in Win10 update "Threshold 2"

@nithinc989
Copy link

"elpackage": "electron-packager ./ MYCompany --platform=win32 --arch=x64 --overwrite --icon=./MYCompany.ico --win32metadata.CompanyName='MYCompany Inc.' --win32metadata.ProductName=myName --win32metadata.FileDescription='MY Company' --appCopyright='Copyright © 2015 MYCompany Inc. All rights reserved.'"
above is a line from my package.json.
when I run the command npm run elpackage i am getting the FileDescription in my exe just MY, the part after the space is not accounted, It should actually be MY Company and similarly with appCopyright in my exe I got just Copyright instead of Copyright © 2015 MYCompany Inc. All rights reserved.
When I run the command directly everything is alright and I get the name and copyright correctly.
Is this an issue with the electron-packager or the way I am using it?
Can someone help please?
Thanks in advance

@malept
Copy link
Member

malept commented Jun 28, 2017

@nithinc989 this is probably an issue with NPM and not Electron Packager, if it works correctly when you run the command directly.

@nithinc989
Copy link

Thanks for the reply,
I figured out now that it was not an issue with npm, I had to use double quotes escaped and not single quotes. That solved my problem. In case anyone is facing similar issue they can use it as shown below.
"elpackage": "electron-packager ./ MYCompany --platform=win32 --arch=x64 --overwrite --icon=./MYCompany.ico --win32metadata.CompanyName=\"MYCompany Inc.\" --win32metadata.ProductName=myName --win32metadata.FileDescription=\"MY Company\" --appCopyright=\"Copyright © 2015 MYCompany Inc. All rights reserved.\""

@malept It would be great if you could add certificate adding option in the electron packager itself.
Now for adding the certificate I need to create a bundled exe using electron-winstaller. I don't know if that is possible with packager but its just something that would be good to have if it can be done. :) .
If it is already there could you please point me in the right direction.

@malept
Copy link
Member

malept commented Jun 29, 2017

@nithinc989 Since Electron Packager doesn't create installers, there's no need for it to add the certificate. I suggest either using electron-winstaller, or import your Electron app project to Electron Forge (which uses both Packager and -winstaller internally).

@nithinc989
Copy link

@malept
Thanks for the reply and clarification and the suggestions,
Electron winstaller is what I am trying to use currently but which is giving me path too long errors because of sqlite3's chained dependency so I was thinking if I could add the certificate to the exe that packager creates then I no longer have to worry about work around for sqlite3 issue.
Was Just looking for a shortcut..:p

@craxal
Copy link

craxal commented Jul 1, 2017

I seem to be encountering this issue as well, only I'm using a custom-built Electron based on 1.7.2 and the programmatic API to run the packager. I'm using electron-packager@7.7.0 (later versions don't seem to work with custom-built Electron.

My logs show I'm passing the correct values for CompanyName, LegalCopyright, ProductName, FileDescription, and OriginalFilename to the packager. However, none of these values are correct when I examine them in the .exe Properties window.

@malept malept removed the help wanted Needs a contributor from the community label Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 build-target:windows Bundling an Electron app specifically for Windows
Projects
None yet
Development

No branches or pull requests

5 participants