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

Version info added to the final executable using rcedit #63

Merged
merged 2 commits into from
Jun 28, 2015

Conversation

Rameshv
Copy link
Contributor

@Rameshv Rameshv commented Jun 12, 2015

This PR fixes the following issue Set product name, file description copyright on Windows
#30

As per the comment #30 (comment) by @felicienfrancois, rcedit is already doing it.

This patch has following changes

  • User need to pass version-string hash in the options. THis has following fields
                   CompanyName
                   LegalCopyright
                   FileDescription
                   OriginalFilename
                   FileVersion
                   ProductVersion
                   ProductName
                   InternalName
  • instead of passing just the icon to rcedit, now the version-string is also passed.

Below the sample grunt config

   electron:{
    win : {
      options: {
        name : 'Fresenius',
        dir : 'build/',
        out : 'package/app/win32',
        version : '0.25.3',
        platform: 'win32',
        arch : 'x64',
        icon : 'app/static/assets/icon.ico',
        'version-string': {
          'CompanyName': 'Pocketworks UK.',
          'LegalCopyright': 'Copyright 2015 Pocketworks UK. All rights reserved."',
          'FileDescription' : 'Fresenius',
          'OriginalFilename' : 'Fresenius.exe',
          'FileVersion' : '0.0.1',
          'ProductVersion' : '0.0.1',
          'ProductName' : 'Fresenius',
          'InternalName' : 'Fresenius.exe'
        }
      }
    }
  },

We dont need resourcehacker dependency after all..

Below screenshot is the output of above config.

screen shot 2015-06-12 at 6 21 55 pm

@malept
Copy link
Member

malept commented Jun 12, 2015

You're going to want to rebase this into one commit.

@Rameshv
Copy link
Contributor Author

Rameshv commented Jun 12, 2015

Done @malept

@@ -42,6 +42,18 @@ ignore do not copy files into App whose filenames regex .match this
prune runs `npm prune --production` on the app
asar packages the source code within your app into an archive
sign should contain the identity to be used when running `codesign` (OS X only)
version-string This is a hash which holds the verision details of the generated exe (windows only).
These are the following keys it supports
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More consistent description, IMO:

should contain a hash of the application metadata to be embedded into the executable (Windows only). Keys supported:

Opinions on whether the keys should be prefixed with * or - to visually indicate a list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep @malept your message is more appropriate. And i think - is suitable for list.

Also i can make a pull to https://github.com/sindresorhus/grunt-electron on how to specify the hash. That will be easier

@Rameshv
Copy link
Contributor Author

Rameshv commented Jun 12, 2015

Companion pr made to the grunt-electron sindresorhus/grunt-electron#2 with updated readme on how to use the version-string in grunt config

@junosuarez
Copy link
Contributor

Hmm, it's not working on my machine:
image

electron-packager @ d2a2f05
win32 8.1 x64

@junosuarez
Copy link
Contributor

Also: how do we want to handle platform-specific options? Are there any of these properties which overlap on other platforms so we can avoid duplicate config? /cc @maxogden

@Rameshv
Copy link
Contributor Author

Rameshv commented Jun 17, 2015

hey @jden i think i got the issue. if there is no icon specified, it skips the entire rcedit call.

      if (!opts.icon) {
        return cb(null, finalPath)
      }

i ll fix it and push in few..

max-mapper added a commit that referenced this pull request Jun 28, 2015
Version info added to the final executable using rcedit
@max-mapper max-mapper merged commit 59228f2 into electron:master Jun 28, 2015
@kfranqueiro
Copy link
Contributor

Is this supposed to be usable via command-line arguments? If it requires a hash, I'm not sure how that's possible...

@Rameshv
Copy link
Contributor Author

Rameshv commented Jun 29, 2015

hi @kfranqueiro it is possible to use this with command line arguments too. packager uses minimist which parses the hashes too. You can do this way

electron-packager|versionedit ✗⇒ 
node example.js --name=Test --dir='out' --version-string.CompanyName=pocketworks --version-string.LegalCopyright='Copyright 2015 Pocketworks UK. All rights reserved.'
{ _: [],
  name: 'Test',
  dir: 'out',
  'version-string': 
   { CompanyName: 'pocketworks',
     LegalCopyright: 'Copyright 2015 Pocketworks UK. All rights reserved.' } }

@alexwarren
Copy link

Looks like FileVersion is being ignored? It's not updating for me, and I can see in the screenshot for this PR that it's not updated there either.

@kfranqueiro
Copy link
Contributor

I noticed this as well, and was wondering if it's actually an issue with rcedit.

@Rameshv
Copy link
Contributor Author

Rameshv commented Jul 2, 2015

@alexwarren @kfranqueiro FileVersion is the correct property metadata name. I just verified it in an exe with the resource hacker. Yep it seems like the issue is with rcedit

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

Successfully merging this pull request may close these issues.

6 participants