Skip to content

Commit

Permalink
Revert "fix: windows auto-update feature when selecting install for a…
Browse files Browse the repository at this point in the history
…ll users (#1556)"

This reverts commit c26525f.

Context:
#1570 (comment)
  • Loading branch information
lidel committed Oct 7, 2020
1 parent 38eb5af commit 32aaf1b
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/auto-updater/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, shell } = require('electron')
const { shell } = require('electron')
const { autoUpdater } = require('electron-updater')
const i18n = require('i18next')
const logger = require('../common/logger')
Expand All @@ -7,26 +7,10 @@ const { showDialog } = require('../dialogs')
const quitAndInstall = require('./quit-and-install')

let feedback = false
let installOnQuit = false

function setup (ctx) {
autoUpdater.autoDownload = false
autoUpdater.autoInstallOnAppQuit = false

/**
* this replaces the autoInstallOnAppQuit feature of autoUpdater, which causes the app
* to uninstall itself if it is installed for all users on a windows system.
*
* More info: https://github.com/ipfs-shipyard/ipfs-desktop/issues/1514
* Should be removed once https://github.com/electron-userland/electron-builder/issues/4815 is resolved.
*/
app.once('before-quit', ev => {
if (installOnQuit) {
ev.preventDefault()
installOnQuit = false
autoUpdater.quitAndInstall(false, false)
}
})
autoUpdater.autoInstallOnAppQuit = true

autoUpdater.on('error', err => {
logger.error(`[updater] ${err.toString()}`)
Expand Down Expand Up @@ -98,8 +82,6 @@ function setup (ctx) {
autoUpdater.on('update-downloaded', ({ version }) => {
logger.info('[updater] update downloaded')

installOnQuit = true

const doIt = () => {
setImmediate(() => {
quitAndInstall(ctx)
Expand Down

0 comments on commit 32aaf1b

Please sign in to comment.