#22: Display error if daemon version is too low
This commit is contained in:
@@ -278,6 +278,44 @@ ipcMain.on(Constants.IPC_Browse_Directory + '_sync', (event, data) => {
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Check_Daemon_Version, (event, data) => {
|
||||
const dataDirectory = helpers.resolvePath(data.Directory);
|
||||
helpers
|
||||
.checkDaemonVersion(dataDirectory, data.Version, data.StorageType)
|
||||
.then(code => {
|
||||
standardIPCReply(event, Constants.IPC_Check_Daemon_Version_Reply, {
|
||||
Valid: (code === 0),
|
||||
});
|
||||
})
|
||||
.catch(e=> {
|
||||
standardIPCReply(event, Constants.IPC_Check_Daemon_Version_Reply, {
|
||||
Valid: false,
|
||||
}, e);
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Check_Daemon_Version + '_sync', (event, data) => {
|
||||
const dataDirectory = helpers.resolvePath(data.Directory);
|
||||
helpers
|
||||
.checkDaemonVersion(dataDirectory, data.Version, data.StorageType)
|
||||
.then(code => {
|
||||
event.returnValue = {
|
||||
data: {
|
||||
Valid: (code === 0),
|
||||
},
|
||||
};
|
||||
})
|
||||
.catch(e => {
|
||||
event.returnValue = {
|
||||
data: {
|
||||
Error: e.toString(),
|
||||
Success: false,
|
||||
Valid: false
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
|
||||
try {
|
||||
const exists = fs.lstatSync(data.File).isFile();
|
||||
|
||||
Reference in New Issue
Block a user