Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Revert "temp check-in so that we can get a new build"
Browse files Browse the repository at this point in the history
This reverts commit 9134587.
  • Loading branch information
bsclifton committed Aug 31, 2017
1 parent 1853c35 commit 7389575
Showing 1 changed file with 56 additions and 56 deletions.
112 changes: 56 additions & 56 deletions tools/buildInstaller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const isDarwin = process.platform === 'darwin'
const isLinux = process.platform === 'linux'
var outDir = 'dist'
var arch = 'x64'
// var widevineCdmArch = 'win_x64'
var widevineCdmArch = 'win_x64'
var cmds

if (isWindows) {
if (process.env.TARGET_ARCH === 'ia32') {
arch = 'ia32'
// widevineCdmArch = 'win_x86'
widevineCdmArch = 'win_x86'
}
}
const buildDir = 'Brave-' + process.platform + '-' + arch
Expand All @@ -26,33 +26,33 @@ const raiseError = (errorMessage) => {
process.exit(1)
}

// if (isDarwin || isWindows) {
// const requiredText = 'is required for widevine signing'
// if (!process.env.SIGN_WIDEVINE_PASSPHRASE) {
// raiseError('SIGN_WIDEVINE_PASSPHRASE ' + requiredText)
// }
// if (!process.env.SIGN_WIDEVINE_CERT) {
// raiseError('SIGN_WIDEVINE_CERT ' + requiredText)
// }
// if (!process.env.SIGN_WIDEVINE_KEY) {
// raiseError('SIGN_WIDEVINE_KEY ' + requiredText)
// }
if (isDarwin || isWindows) {
const requiredText = 'is required for widevine signing'
if (!process.env.SIGN_WIDEVINE_PASSPHRASE) {
raiseError('SIGN_WIDEVINE_PASSPHRASE ' + requiredText)
}
if (!process.env.SIGN_WIDEVINE_CERT) {
raiseError('SIGN_WIDEVINE_CERT ' + requiredText)
}
if (!process.env.SIGN_WIDEVINE_KEY) {
raiseError('SIGN_WIDEVINE_KEY ' + requiredText)
}

// // check if widevine script exists
// const fs = require('fs')
// if (!fs.existsSync('tools/signature_generator.py')) {
// raiseError('`tools/signature_generator.py` ' + requiredText)
// }
// }
// check if widevine script exists
const fs = require('fs')
if (!fs.existsSync('tools/signature_generator.py')) {
raiseError('`tools/signature_generator.py` ' + requiredText)
}
}

if (isDarwin) {
const identifier = process.env.IDENTIFIER
if (!identifier) {
raiseError('IDENTIFIER needs to be set to the certificate organization')
}

// const wvBundle = buildDir + '/Brave.app/Contents/Frameworks/Brave Framework.framework/Brave Framework'
// const wvPlugin = buildDir + '/Brave.app/Contents/Frameworks/Brave Framework.framework/Libraries/WidevineCdm/_platform_specific/mac_x64/widevinecdmadapter.plugin'
const wvBundle = buildDir + '/Brave.app/Contents/Frameworks/Brave Framework.framework/Brave Framework'
const wvPlugin = buildDir + '/Brave.app/Contents/Frameworks/Brave Framework.framework/Libraries/WidevineCdm/_platform_specific/mac_x64/widevinecdmadapter.plugin'
cmds = [
// Remove old
'rm -f ' + outDir + '/Brave.dmg',
Expand All @@ -65,8 +65,8 @@ if (isDarwin) {

// sign for widevine
'cd ..',
// 'python tools/signature_generator.py --input_file "' + wvBundle + '" --flag 1',
// 'python tools/signature_generator.py --input_file "' + wvPlugin + '"',
'python tools/signature_generator.py --input_file "' + wvBundle + '" --flag 1',
'python tools/signature_generator.py --input_file "' + wvPlugin + '"',

// Package it into a dmg
'build ' +
Expand All @@ -88,42 +88,42 @@ if (isDarwin) {
}

// sign for widevine
// const wvExe = buildDir + '/Brave.exe'
// const wvPlugin = buildDir + '/WidevineCdm/_platform_specific/' + widevineCdmArch + '/widevinecdmadapter.dll'
// cmds = [
// 'python tools/signature_generator.py --input_file "' + wvExe + '" --flag 1',
// 'python tools/signature_generator.py --input_file "' + wvPlugin + '"'
// ]
// execute(cmds, {}, (err) => {
// if (err) {
// raiseError('signing for widevine failed' + JSON.stringify(err))
// return
// }
const wvExe = buildDir + '/Brave.exe'
const wvPlugin = buildDir + '/WidevineCdm/_platform_specific/' + widevineCdmArch + '/widevinecdmadapter.dll'
cmds = [
'python tools/signature_generator.py --input_file "' + wvExe + '" --flag 1',
'python tools/signature_generator.py --input_file "' + wvPlugin + '"'
]
execute(cmds, {}, (err) => {
if (err) {
raiseError('signing for widevine failed' + JSON.stringify(err))
return
}

// Because both x64 and ia32 creates a RELEASES and a .nupkg file we
// need to store the output files in separate directories
outDir = path.join(outDir, arch)
// Because both x64 and ia32 creates a RELEASES and a .nupkg file we
// need to store the output files in separate directories
outDir = path.join(outDir, arch)

var muonInstaller = require('muon-winstaller')
var resultPromise = muonInstaller.createWindowsInstaller({
appDirectory: buildDir,
outputDirectory: outDir,
title: 'Brave',
authors: 'Brave Software',
loadingGif: 'res/brave_splash_installing.gif',
setupIcon: 'res/brave_installer.ico',
iconUrl: 'https://brave.com/favicon.ico',
signWithParams: format('-a -fd sha256 -f "%s" -p "%s" -t http://timestamp.verisign.com/scripts/timstamp.dll', path.resolve(cert), certPassword),
noMsi: true,
exe: 'Brave.exe'
var muonInstaller = require('muon-winstaller')
var resultPromise = muonInstaller.createWindowsInstaller({
appDirectory: buildDir,
outputDirectory: outDir,
title: 'Brave',
authors: 'Brave Software',
loadingGif: 'res/brave_splash_installing.gif',
setupIcon: 'res/brave_installer.ico',
iconUrl: 'https://brave.com/favicon.ico',
signWithParams: format('-a -fd sha256 -f "%s" -p "%s" -t http://timestamp.verisign.com/scripts/timstamp.dll', path.resolve(cert), certPassword),
noMsi: true,
exe: 'Brave.exe'
})
resultPromise.then(() => {
cmds = [
`mv ${outDir}/Setup.exe ${outDir}/BraveSetup-${arch}.exe`
]
execute(cmds, {}, console.log.bind(null, 'done'))
}, (e) => console.log(`No dice: ${e.message}`))
})
resultPromise.then(() => {
cmds = [
`mv ${outDir}/Setup.exe ${outDir}/BraveSetup-${arch}.exe`
]
execute(cmds, {}, console.log.bind(null, 'done'))
}, (e) => console.log(`No dice: ${e.message}`))
// })
} else if (isLinux) {
console.log('Install with sudo dpkg -i dist/brave_' + VersionInfo.braveVersion + '_amd64.deb')
console.log('Or install with sudo dnf install dist/brave_' + VersionInfo.braveVersion + '.x86_64.rpm')
Expand Down

0 comments on commit 7389575

Please sign in to comment.