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

This commit is contained in:
2019-08-14 10:39:12 -05:00
parent 1c7565d863
commit 5fd3067dd7
2 changed files with 148 additions and 15 deletions

View File

@@ -88,9 +88,9 @@ const unmountAllDrives = () => {
mountedData = {};
};
function createWindow() {
function createWindow() {
loadUiSettings();
let extra = {};
if (os.platform() === 'linux') {
extra = {
@@ -726,20 +726,45 @@ ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
}, error);
});
} else {
helpers
.executeAndWait(data.Source)
.then(() => {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
Source: data.Source,
URL: data.URL,
const execInstall = () => {
helpers
.executeAndWait(data.Source)
.then(() => {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
Source: data.Source,
URL: data.URL,
});
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
Source: data.Source,
URL: data.URL,
}, error);
});
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
Source: data.Source,
URL: data.URL,
}, error);
});
};
if (data.IsWinFSP) {
helpers
.performWindowsUninstall(["WinFsp 2019.3 B1", "WinFsp 2019.3 B2"])
.then(uninstalled => {
if (uninstalled) {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
RebootRequired: true,
Source: data.Source,
URL: data.URL,
});
} else {
execInstall();
}
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
Source: data.Source,
URL: data.URL,
}, error);
});
} else {
execInstall();
}
}
});