#26: Fix macOS dependency install
This commit is contained in:
@@ -59,8 +59,35 @@ export const installDependency = (source, url, completedCallback) => {
|
||||
|
||||
const installDependencyComplete = (event, arg) => {
|
||||
ipcRenderer.removeListener(Constants.IPC_Install_Dependency_Reply, installDependencyComplete);
|
||||
dispatch(setInstallComplete(arg.data));
|
||||
completedCallback(source, url, arg.data);
|
||||
|
||||
const result = arg.data;
|
||||
const handleCompleted = ()=> {
|
||||
ipcRenderer.send(Constants.IPC_Delete_File, {
|
||||
FilePath: source,
|
||||
});
|
||||
dispatch(setInstallComplete(result));
|
||||
completedCallback(source, url, result);
|
||||
};
|
||||
|
||||
if (result.Success && source.toLowerCase().endsWith('.dmg')) {
|
||||
const dep = getState().install.MissingDependencies.find(d => {
|
||||
return d.download === url;
|
||||
});
|
||||
const i = setInterval(()=> {
|
||||
const ret = ipcRenderer.sendSync(Constants.IPC_Check_Dependency_Installed + '_sync', {
|
||||
File: dep.file,
|
||||
});
|
||||
|
||||
if (ret.data.Exists) {
|
||||
clearInterval(i);
|
||||
setTimeout(() => {
|
||||
handleCompleted();
|
||||
}, 5000);
|
||||
}
|
||||
}, 3000);
|
||||
} else {
|
||||
handleCompleted();
|
||||
}
|
||||
};
|
||||
|
||||
ipcRenderer.on(Constants.IPC_Install_Dependency_Reply, installDependencyComplete);
|
||||
|
||||
Reference in New Issue
Block a user