[partial] #30: Add uninstall feature with reboot to handle WinFSP upgrades/downgrades

This commit is contained in:
2019-08-13 14:06:50 -05:00
parent 9f45b0f03f
commit fa130c7dd1
10 changed files with 98 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ import {
} from './release_version_actions';
import {
setApplicationReady,
setRebootRequired,
showWindow,
shutdownApplication
} from './common_actions';
@@ -81,7 +82,7 @@ export const checkVersionInstalled = () => {
};
};
export const installDependency = (source, url) => {
export const installDependency = (source, url, isWinFSP) => {
return (dispatch, getState) => {
if (ipcRenderer && !getState().install.InstallActive) {
dispatch(setInstallActive(Constants.INSTALL_TYPES.Dependency));
@@ -89,11 +90,15 @@ export const installDependency = (source, url) => {
const installDependencyComplete = (event, arg) => {
const result = arg.data;
const handleCompleted = ()=> {
ipcRenderer.send(Constants.IPC_Delete_File, {
FilePath: source,
});
dispatch(setInstallComplete(result));
dispatch(checkVersionInstalled());
if (result.RebootRequired) {
dispatch(setRebootRequired());
} else {
ipcRenderer.send(Constants.IPC_Delete_File, {
FilePath: source,
});
dispatch(setInstallComplete(result));
dispatch(checkVersionInstalled());
}
};
if (result.Success && source.toLowerCase().endsWith('.dmg')) {
@@ -121,6 +126,7 @@ export const installDependency = (source, url) => {
ipcRenderer.send(Constants.IPC_Install_Dependency, {
Source: source,
URL: url,
IsWinFSP: isWinFSP,
});
}
};