#36: Add ability to select Linux distribution type if OS is unsupported
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import React from 'react';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import './SelectAppPlatform.css';
|
||||
import * as Constants from '../../constants';
|
||||
import axios from 'axios';
|
||||
import {connect} from 'react-redux';
|
||||
import * as Constants from '../../constants';
|
||||
import Box from '../../components/UI/Box/Box';
|
||||
import Button from '../../components/UI/Button/Button';
|
||||
import {downloadItem} from '../../redux/actions/download_actions';
|
||||
import {
|
||||
downloadItem,
|
||||
setAllowDownload
|
||||
} from '../../redux/actions/download_actions';
|
||||
import DropDown from '../../components/UI/DropDown/DropDown';
|
||||
import axios from 'axios';
|
||||
import IPCContainer from '../IPCContainer/IPCContainer';
|
||||
import {notifyError} from '../../redux/actions/error_actions';
|
||||
import {setInstallTestActive} from '../../redux/actions/install_actions';
|
||||
|
||||
@@ -20,6 +23,7 @@ class SelectAppPlatform extends IPCContainer {
|
||||
const errorHandler = error => {
|
||||
this.props.notifyError(error);
|
||||
this.props.setInstallTestActive(false);
|
||||
this.props.setAllowDownload(false);
|
||||
};
|
||||
axios
|
||||
.get(Constants.RELEASES_URL)
|
||||
@@ -40,6 +44,7 @@ class SelectAppPlatform extends IPCContainer {
|
||||
|
||||
handleTestClicked = () => {
|
||||
this.props.setInstallTestActive(true);
|
||||
this.props.setAllowDownload(true);
|
||||
this.grabLatestRelease(Constants.LINUX_SELECTABLE_PLATFORMS[this.state.Selected])
|
||||
};
|
||||
|
||||
@@ -76,6 +81,7 @@ const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
downloadItem: (name, type, urls, isWinFSP, testVersion, appPlatform) => dispatch(downloadItem(name, type, urls, isWinFSP, testVersion, appPlatform)),
|
||||
notifyError: msg => dispatch(notifyError(msg)),
|
||||
setAllowDownload: allow => dispatch(setAllowDownload(allow)),
|
||||
setInstallTestActive: active => dispatch(setInstallTestActive(active)),
|
||||
};
|
||||
};
|
||||
|
||||
@@ -705,6 +705,23 @@ module.exports.stopMountProcessSync = (version, provider) => {
|
||||
process.unref();
|
||||
};
|
||||
|
||||
module.exports.testRepertoryBinary = version => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const command = path.join(_getDataDirectory(), version, (os.platform() === 'win32') ? 'repertory.exe' : 'repertory');
|
||||
_executeProcess(command, ['-dc'])
|
||||
.then(code => {
|
||||
if (code === 0) {
|
||||
resolve();
|
||||
} else {
|
||||
reject(Error('Invalid exit code: ' + code));
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.verifyHash = (file, hash) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const platform = os.platform();
|
||||
|
||||
@@ -55,6 +55,9 @@ export const downloadItem = (name, type, urls, isWinFSP, testVersion, appPlatfor
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (type === Constants.INSTALL_TYPES.TestRelease) {
|
||||
this.props.setAllowDownload(false);
|
||||
}
|
||||
dispatch(notifyError(result.Error));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ export const installDependency = (source, url, isWinFSP) => {
|
||||
|
||||
export const installAndTestRelease = (source, version, appPlatform) => {
|
||||
return (dispatch, getState) => {
|
||||
if (ipcRenderer && !getState().install.InstallTestActive) {
|
||||
if (ipcRenderer && getState().install.InstallTestActive) {
|
||||
const extractReleaseComplete = (event, arg) => {
|
||||
ipcRenderer.send(Constants.IPC_Delete_File, {
|
||||
FilePath: source,
|
||||
@@ -153,6 +153,7 @@ export const installAndTestRelease = (source, version, appPlatform) => {
|
||||
dispatch(setLinuxAppPlatform(appPlatform));
|
||||
dispatch(setInstallTestActive(false));
|
||||
dispatch(displaySelectAppPlatform(false));
|
||||
dispatch(setAllowDownload(false));
|
||||
dispatch(loadReleases());
|
||||
} else {
|
||||
dispatch(notifyError(arg.data.Error));
|
||||
|
||||
Reference in New Issue
Block a user