Skip to content

Commit 3c69d4c

Browse files
authored
fix: autoupdate only on supported platforms (#1698)
Closes #1671
1 parent 90b1ad1 commit 3c69d4c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/auto-updater/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ const logger = require('../common/logger')
55
const { notify } = require('../common/notify')
66
const { showDialog } = require('../dialogs')
77
const macQuitAndInstall = require('./macos-quit-and-install')
8-
const { IS_MAC } = require('../common/consts')
8+
const { IS_MAC, IS_WIN, IS_APPIMAGE } = require('../common/consts')
9+
10+
function isAutoUpdateSupported () {
11+
// atm only macOS, windows and AppImage builds support autoupdate mechanism,
12+
// everything else needs to be updated manually or via a third-party package manager
13+
return IS_MAC || IS_WIN || IS_APPIMAGE
14+
}
915

1016
let feedback = false
1117

@@ -137,13 +143,20 @@ module.exports = async function (ctx) {
137143
}
138144
return
139145
}
146+
if (!isAutoUpdateSupported()) {
147+
ctx.manualCheckForUpdates = () => {
148+
shell.openExternal('https://github.com/ipfs-shipyard/ipfs-desktop/releases/latest')
149+
}
150+
return
151+
}
140152

141153
setup(ctx)
142154

143155
checkForUpdates() // background check
144156

145157
setInterval(checkForUpdates, 43200000) // every 12 hours
146158

159+
// enable on-demand check via About submenu
147160
ctx.manualCheckForUpdates = () => {
148161
feedback = true
149162
checkForUpdates()

src/common/consts.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const packageJson = require('../../package.json')
44
module.exports = Object.freeze({
55
IS_MAC: os.platform() === 'darwin',
66
IS_WIN: os.platform() === 'win32',
7+
IS_APPIMAGE: typeof process.env.APPIMAGE !== 'undefined',
78
VERSION: packageJson.version,
89
ELECTRON_VERSION: packageJson.dependencies.electron,
910
GO_IPFS_VERSION: packageJson.dependencies['go-ipfs'],

0 commit comments

Comments
 (0)