#36: Add ability to select Linux distribution type if OS is unsupported - partial

This commit is contained in:
2019-08-28 18:58:43 -05:00
parent 0671a39809
commit 0105602a44
11 changed files with 194 additions and 38 deletions

View File

@@ -7,13 +7,16 @@ import {
import {notifyError} from './error_actions';
import {setAllowDownload} from './download_actions';
import {
loadReleases,
setActiveRelease,
setInstalledVersion,
setReleaseUpgradeAvailable
} from './release_version_actions';
import {
displaySelectAppPlatform,
setAllowMount,
setApplicationReady,
setLinuxAppPlatform,
setRebootRequired,
showWindow,
shutdownApplication
@@ -134,6 +137,42 @@ export const installDependency = (source, url, isWinFSP) => {
};
};
export const installAndTestRelease = (source, version, appPlatform) => {
return (dispatch, getState) => {
if (ipcRenderer && !getState().install.InstallTestActive) {
const extractReleaseComplete = (event, arg) => {
ipcRenderer.send(Constants.IPC_Delete_File, {
FilePath: source,
});
ipcRenderer.once(Constants.IPC_Test_Release_Reply, (event, arg) => {
if (arg.data.Success) {
ipcRenderer.sendSync(Constants.IPC_Set_Linux_AppPlatform, {
AppPlatform: appPlatform,
});
dispatch(setLinuxAppPlatform(appPlatform));
dispatch(setInstallTestActive(false));
dispatch(displaySelectAppPlatform(false));
dispatch(loadReleases());
} else {
dispatch(notifyError(arg.data.Error));
dispatch(setInstallTestActive(false));
}
});
ipcRenderer.send(Constants.IPC_Test_Release, {
Version: version,
})
};
ipcRenderer.once(Constants.IPC_Extract_Release_Complete, extractReleaseComplete);
ipcRenderer.send(Constants.IPC_Extract_Release, {
Source: source,
Version: version,
});
}
};
};
export const installRelease = source => {
return (dispatch, getState) => {
if (ipcRenderer && !getState().install.InstallActive) {
@@ -193,5 +232,6 @@ export const installUpgrade = (source, sha256, signature, skipVerification) => {
export const setDismissDependencies = createAction('install/setDismissDependencies');
export const setInstallActive = createAction('install/setInstallActive');
export const setInstallTestActive = createAction('install/setInstallTestActive');
export const setInstallComplete = createAction('install/setInstallComplete');
export const setMissingDependencies = createAction('install/setMissingDependencies');