mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-02-03 04:08:24 +00:00
version-string hash added to update the windows executable resource
using rcedit
This commit is contained in:
parent
81340093ee
commit
d2a2f05476
11
readme.md
11
readme.md
@ -42,6 +42,17 @@ ignore do not copy files into App whose filenames regex .match this
|
|||||||
prune runs `npm prune --production` on the app
|
prune runs `npm prune --production` on the app
|
||||||
asar packages the source code within your app into an archive
|
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)
|
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:
|
This will:
|
||||||
|
13
win32.js
13
win32.js
@ -62,15 +62,15 @@ function buildWinApp (opts, cb, newApp) {
|
|||||||
var finalPath = path.join(opts.out || process.cwd(), opts.name + '-win32', 'resources')
|
var finalPath = path.join(opts.out || process.cwd(), opts.name + '-win32', 'resources')
|
||||||
common.asarApp(finalPath, function (err) {
|
common.asarApp(finalPath, function (err) {
|
||||||
if (err) return cb(err)
|
if (err) return cb(err)
|
||||||
updateIcon()
|
updateResourceData()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
updateIcon()
|
updateResourceData()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateIcon () {
|
function updateResourceData () {
|
||||||
var finalPath = path.join(opts.out || process.cwd(), opts.name + '-win32')
|
var finalPath = path.join(opts.out || process.cwd(), opts.name + '-win32')
|
||||||
|
|
||||||
if (!opts.icon) {
|
if (!opts.icon) {
|
||||||
@ -78,8 +78,11 @@ function buildWinApp (opts, cb, newApp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var exePath = path.join(opts.out || process.cwd(), opts.name + '-win32', opts.name + '.exe')
|
var exePath = path.join(opts.out || process.cwd(), opts.name + '-win32', opts.name + '.exe')
|
||||||
|
var rcOptions = {
|
||||||
rcedit(exePath, {icon: opts.icon}, function (err) {
|
icon: opts.icon,
|
||||||
|
'version-string': opts['version-string']
|
||||||
|
}
|
||||||
|
rcedit(exePath, rcOptions, function (err) {
|
||||||
cb(err, finalPath)
|
cb(err, finalPath)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user