Merge pull request #63 from Rameshv/versionedit

Version info added to the final executable using rcedit
This commit is contained in:
=^._.^= 2015-06-27 19:24:11 -05:00
commit 59228f2214
2 changed files with 20 additions and 6 deletions

View File

@ -42,6 +42,17 @@ 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 should contain a hash of the application metadata to be embedded into the executable (Windows only). Keys supported
- CompanyName
- LegalCopyright
- FileDescription
- OriginalFilename
- FileVersion
- ProductVersion
- ProductName
- InternalName
```
This will:

View File

@ -62,24 +62,27 @@ function buildWinApp (opts, cb, newApp) {
var finalPath = path.join(opts.out || process.cwd(), opts.name + '-win32', 'resources')
common.asarApp(finalPath, function (err) {
if (err) return cb(err)
updateIcon()
updateResourceData()
})
} else {
updateIcon()
updateResourceData()
}
})
}
function updateIcon () {
function updateResourceData () {
var finalPath = path.join(opts.out || process.cwd(), opts.name + '-win32')
if (!opts.icon) {
if (!opts.icon && !opts['version-string']) {
return cb(null, finalPath)
}
var exePath = path.join(opts.out || process.cwd(), opts.name + '-win32', opts.name + '.exe')
rcedit(exePath, {icon: opts.icon}, function (err) {
var rcOptions = {
icon: opts.icon,
'version-string': opts['version-string']
}
rcedit(exePath, rcOptions, function (err) {
cb(err, finalPath)
})
}