Skip to content

Commit

Permalink
Applied fix for AppImageLauncher updates
Browse files Browse the repository at this point in the history
  • Loading branch information
megastary committed Dec 13, 2019
1 parent 5ace0da commit b9f0df7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"email": "[email protected]",
"url": "https://houby-studio.eu/"
},
"version": "0.0.5",
"version": "0.0.6",
"license": "MIT",
"copyright": "Copyright © 2020 Houby Studio",
"build": {
Expand Down
18 changes: 17 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { format as formatUrl } from 'url'
import { autoUpdater } from 'electron-updater'
const log = require('electron-log')

process.env.APPIMAGE = __dirname
const isDevelopment = process.env.NODE_ENV !== 'production'

// global reference to mainWindow (necessary to prevent window from being garbage collected)
Expand Down Expand Up @@ -61,9 +62,24 @@ app.on('activate', () => {

// create main BrowserWindow when electron is ready
app.on('ready', () => {
mainWindow = createMainWindow()
log.transports.file.level = 'info'
autoUpdater.logger = log
autoUpdater.logger.transports.file.level = 'info'
autoUpdater.checkForUpdatesAndNotify()
mainWindow = createMainWindow()
log.log('readyyy')
})

// Fix for AppImageLauncher as it executes AppImage in read-only file system by default
app.on('before-quit', () => {
if (process.env.DESKTOPINTEGRATION === 'AppImageLauncher') {
// remap temporary running AppImage to actual source
autoUpdater.logger.info('rewriting $APPIMAGE', {
oldValue: process.env.APPIMAGE,
newValue: process.env.ARGV0
})
process.env.APPIMAGE = process.env.ARGV0
} else {
autoUpdater.logger.info('Not running in AppImageLauncher')
}
})
3 changes: 3 additions & 0 deletions src/renderer/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b9f0df7

Please sign in to comment.