OS X installation support

This commit is contained in:
Scott E. Graves
2018-12-11 10:31:04 -06:00
parent 29a72f4707
commit e603894e2d
3 changed files with 148 additions and 102 deletions

View File

@@ -310,7 +310,7 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
const setImage = (locations) => {
if (os.platform() === 'win32' || os.platform() === 'linux') {
let driveInUse = false;
let driveInUse;
for (const provider of Constants.PROVIDER_LIST) {
driveInUse = locations[provider].length > 0;
if (driveInUse)
@@ -504,16 +504,45 @@ ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
});
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
helpers
.executeAsync(data.Source)
.then(()=> {
mainWindow.close();
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
Source: data.Source,
}, error);
});
if (os.platform() === 'win32') {
helpers
.executeAsync(data.Source)
.then(() => {
closeApplication();
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
Source: data.Source,
}, error);
});
} else if (data.Source.toLocaleLowerCase().endsWith('.dmg')) {
helpers
.executeAsync('hdiutil', ['attach', data.Source])
.then(() => {
closeApplication();
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
Source: data.Source,
}, error);
});
} else if (data.Source.toLocaleLowerCase().endsWith('.appimage')) {
// TODO Generate and execute script with delay
/*helpers
.executeAsync(data.Source)
.then(() => {
closeApplication();
})
.catch(error => {
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
Source: data.Source,
}, error);
});*/
} else {
standardIPCReply(event, Constants.IPC_Install_Upgrade_Reply, {
Source: data.Source,
}, Error('Unsupported upgrade: ' + data.Source));
}
});
ipcMain.on(Constants.IPC_Mount_Drive, (event, data) => {