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

Commit

Permalink
Part 3 of fix for brave/brave-browser#1782
Browse files Browse the repository at this point in the history
(Work in progress - needs testing; doesn't use real muon-winstaller repo)
  • Loading branch information
bsclifton committed Oct 26, 2018
1 parent 4cf04e0 commit 8924a47
Show file tree
Hide file tree
Showing 5 changed files with 3,639 additions and 3,666 deletions.
19 changes: 10 additions & 9 deletions app/windowsInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ const getBraveCoreInstallerPath = () => {
}

function InstallBraveCore () {
const cmd = getBraveCoreInstallerPath() + " /silent /install"
// TODO(bsclifton): get a proper version of the omaha installer
// (built using https://github.com/brave/devops/pull/335)
//const cmd = getBraveCoreInstallerPath() + " /silent /install"
const cmd = getBraveCoreInstallerPath() + " /install"
execSync(cmd)
}

Expand All @@ -73,7 +74,8 @@ if (process.platform === 'win32') {
const shouldQuit = require('electron-squirrel-startup')
const channel = Channel.channel()
const isSquirrelInstall = process.argv.includes('--squirrel-install')
const isSquirrelUpdate = process.argv.includes('--squirrel-updated')
// TODO(bsclifton): remove after testing
const isSquirrelUpdate = true //process.argv.includes('--squirrel-updated')
const isSquirrelUninstall = process.argv.includes('--squirrel-uninstall')
const isSquirrelFirstRun = process.argv.includes('--squirrel-firstrun')
// handle running as part of install process
Expand All @@ -87,14 +89,13 @@ if (process.platform === 'win32') {
}
// first-run after install / update
if (isSquirrelInstall || isSquirrelUpdate) {
// The manifest file is used to customize the look of the Start menu tile.
// This function copies it from the versioned folder to the parent folder
// (where the auto-update executable lives)
CopyManifestFile()
// Specific for Brave Ads trial
InstallBraveCore()
// Launch defaults helper to add defaults on install
spawn(getBraveDefaultsBinPath(), [], { detached: true })
// relaunch and append argument expected in:
// https://github.com/brave/brave-browser/issues/1545
app.relaunch({args: ['--relaunch', '--upgrade-from-muon']})
app.exit()
return

} else if (isSquirrelUninstall) {
// Launch defaults helper to remove defaults on uninstall
// Sync to avoid file path in use on uninstall
Expand Down
Loading

0 comments on commit 8924a47

Please sign in to comment.