File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,13 @@ const logger = require('../common/logger')
5
5
const { notify } = require ( '../common/notify' )
6
6
const { showDialog } = require ( '../dialogs' )
7
7
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
+ }
9
15
10
16
let feedback = false
11
17
@@ -137,13 +143,20 @@ module.exports = async function (ctx) {
137
143
}
138
144
return
139
145
}
146
+ if ( ! isAutoUpdateSupported ( ) ) {
147
+ ctx . manualCheckForUpdates = ( ) => {
148
+ shell . openExternal ( 'https://github.com/ipfs-shipyard/ipfs-desktop/releases/latest' )
149
+ }
150
+ return
151
+ }
140
152
141
153
setup ( ctx )
142
154
143
155
checkForUpdates ( ) // background check
144
156
145
157
setInterval ( checkForUpdates , 43200000 ) // every 12 hours
146
158
159
+ // enable on-demand check via About submenu
147
160
ctx . manualCheckForUpdates = ( ) => {
148
161
feedback = true
149
162
checkForUpdates ( )
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const packageJson = require('../../package.json')
4
4
module . exports = Object . freeze ( {
5
5
IS_MAC : os . platform ( ) === 'darwin' ,
6
6
IS_WIN : os . platform ( ) === 'win32' ,
7
+ IS_APPIMAGE : typeof process . env . APPIMAGE !== 'undefined' ,
7
8
VERSION : packageJson . version ,
8
9
ELECTRON_VERSION : packageJson . dependencies . electron ,
9
10
GO_IPFS_VERSION : packageJson . dependencies [ 'go-ipfs' ] ,
You can’t perform that action at this time.
0 commit comments