OS X installation support
This commit is contained in:
51
electron.js
51
electron.js
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user