revert to detecting the OS client side for update url
This commit is contained in:
parent
27b85e2301
commit
b65910f441
1 changed files with 14 additions and 2 deletions
16
js/app.js
16
js/app.js
|
@ -25,7 +25,6 @@ import {Link} from './component/link.js';
|
|||
const {remote, ipcRenderer} = require('electron');
|
||||
const {download} = remote.require('electron-dl');
|
||||
|
||||
const UPDATE_URL = 'https://lbry.io/get/latest';
|
||||
|
||||
var App = React.createClass({
|
||||
_error_key_labels: {
|
||||
|
@ -51,6 +50,7 @@ var App = React.createClass({
|
|||
pageArgs: typeof val !== 'undefined' ? val : null,
|
||||
errorInfo: null,
|
||||
modal: null,
|
||||
updateUrl: null,
|
||||
isOldOSX: null,
|
||||
downloadProgress: null,
|
||||
};
|
||||
|
@ -68,12 +68,24 @@ var App = React.createClass({
|
|||
lbry.getVersionInfo((versionInfo) => {
|
||||
var isOldOSX = false;
|
||||
if (versionInfo.os_system == 'Darwin') {
|
||||
var updateUrl = 'https://lbry.io/get/lbry.dmg';
|
||||
|
||||
var maj, min, patch;
|
||||
[maj, min, patch] = versionInfo.lbrynet_version.split('.');
|
||||
if (maj == 0 && min <= 2 && patch <= 2) {
|
||||
isOldOSX = true;
|
||||
}
|
||||
} else if (versionInfo.os_system == 'Linux') {
|
||||
var updateUrl = 'https://lbry.io/get/lbry.deb';
|
||||
} else if (versionInfo.os_system == 'Windows') {
|
||||
// A little weird, but for electron, the installer is
|
||||
// actually an exe. Maybe a better url would
|
||||
// be something like /get/windows ?
|
||||
var updateUrl = 'https://lbry.io/get/lbry.msi';
|
||||
} else {
|
||||
var updateUrl = 'https://lbry.io/get';
|
||||
}
|
||||
|
||||
this.setState({
|
||||
modal: 'upgrade',
|
||||
isOldOSX: isOldOSX,
|
||||
|
@ -105,7 +117,7 @@ var App = React.createClass({
|
|||
let options = {
|
||||
onProgress: (p) => this.setState({downloadProgress: Math.round(p * 100)}),
|
||||
}
|
||||
download(remote.getCurrentWindow(), UPDATE_URL, options)
|
||||
download(remote.getCurrentWindow(), this.state.updateUrl, options)
|
||||
.then(dl => ipcRenderer.send('shutdown'));
|
||||
this.setState({modal: 'downloading'});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue