From ae4c6c4a7f144b593b758709eafae6580ab2d9f9 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Tue, 7 Nov 2017 21:22:47 -0800 Subject: [PATCH] Correct relaunch logic fix #11821, #11824 Auditors: @bsclifton Test Plan: a. CHANNEL=beta npm start shouldn't relaunch b. CHANNEL=beta npm build-package b-1. ./BraveBeta-win32-x64/BraveBeta.exe should relaunch and use `brave-beta` as user dir b-2 CHANNEL=beta npm build-installer b-3 Install Brave by dist/x64/BraveBeta-Setup-x64.exe b-4 After installation, the first time launch should relaunch and use `brave-beta` as user dir --- app/windowsInit.js | 8 +++++--- tools/buildInstaller.js | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/windowsInit.js b/app/windowsInit.js index 1a0a9efc029..798c89ec7e1 100644 --- a/app/windowsInit.js +++ b/app/windowsInit.js @@ -76,13 +76,15 @@ if (process.platform === 'win32') { } const userDataDirSwitch = '--user-data-dir-name=brave-' + channel - if (channel && channel !== 'dev' && !process.argv.includes(userDataDirSwitch)) { + if (channel !== 'dev' && !process.argv.includes(userDataDirSwitch) && + !process.argv.includes('--relaunch') && + !process.argv.includes('--user-data-dir-name=brave-development')) { if (cmd === '--squirrel-firstrun') { app.relaunch({args: [userDataDirSwitch, '--relaunch']}) } else { - app.relaunch({args: process.argv.slice(1) + [userDataDirSwitch, '--relaunch']}) + app.relaunch({args: process.argv.slice(1).concat([userDataDirSwitch, '--relaunch'])}) } - app.quit() + app.exit() } } diff --git a/tools/buildInstaller.js b/tools/buildInstaller.js index 084d095eabc..d5e92c017ee 100644 --- a/tools/buildInstaller.js +++ b/tools/buildInstaller.js @@ -178,9 +178,7 @@ if (isDarwin) { setupExe: `${appName}-Setup-${arch}.exe` }) resultPromise.then(() => { - cmds = [ - ] - execute(cmds, {}, console.log.bind(null, 'done')) + console.log('done') }, (e) => console.log(`No dice: ${e.message}`)) }) } else if (isLinux) {