OS X changes
This commit is contained in:
36
electron.js
36
electron.js
@@ -155,6 +155,19 @@ const standardIPCReply = (event, channel, data, error) => {
|
||||
});
|
||||
};
|
||||
|
||||
ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
|
||||
try {
|
||||
const exists = fs.lstatSync(data.File).isFile();
|
||||
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
|
||||
Exists: exists,
|
||||
});
|
||||
} catch (e) {
|
||||
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
|
||||
Exists: false,
|
||||
}, e);
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Check_Installed, (event, data) => {
|
||||
const dataDirectory = helpers.resolvePath(data.Directory);
|
||||
const destination = path.join(dataDirectory, data.Version);
|
||||
@@ -406,18 +419,37 @@ ipcMain.on(Constants.IPC_Grab_UI_Releases, (event) => {
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
|
||||
helpers
|
||||
if (data.Source.toLowerCase().endsWith('.dmg')) {
|
||||
helpers
|
||||
.executeAsync('hdiutil', ['attach', 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);
|
||||
});
|
||||
} else {
|
||||
helpers
|
||||
.executeAndWait(data.Source)
|
||||
.then(()=> {
|
||||
.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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
||||
|
||||
Reference in New Issue
Block a user