Use relative paths for signing to avoid weird 7z error

This commit is contained in:
Damien Guard 2016-10-27 20:51:40 -07:00
parent 4edb3fe5c7
commit e4ff2b2296
No known key found for this signature in database
GPG Key ID: DC14FA2FB1465DB6

View File

@ -57,9 +57,10 @@ module.exports = function (packagedAppPath, codeSign) {
for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/*-full.nupkg`)) {
if (nupkgPath.includes(CONFIG.appMetadata.version)) {
console.log(`Extracting signed executables from ${nupkgPath} for use in portable zip`)
const appPath = path.normalize(packagedAppPath)
spawnSync('7z.exe', ['e', nupkgPath, 'lib\\net45\\*.exe', '-aoa', `-o"${appPath}"`])
spawnSync(process.env.COMSPEC, ['/c', `move /y "${path.join(appPath, 'squirrel.exe')}" "${path.join(appPath, 'update.exe')}"`])
const outPath = path.dirname(nupkgPath)
const appPath = path.relative(outPath, packagedAppPath)
spawnSync('7z.exe', ['e', path.relative(outPath, nupkgPath), 'lib\\net45\\*.exe', '-aoa', `-o${appPath}`], { cwd:outPath })
spawnSync(process.env.COMSPEC, ['/c', `move /y ${path.join(appPath, 'squirrel.exe')} ${path.join(appPath, 'update.exe')}`], { cwd:outPath })
return
}
}