Fix dependency installation on OS X

This commit is contained in:
Scott E. Graves
2019-04-06 07:43:46 -05:00
parent e410483a08
commit 4b5a0725bd
3 changed files with 15 additions and 10 deletions

View File

@@ -113,7 +113,7 @@ function createWindow() {
});
const appPath = (os.platform() === 'win32') ? path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
(os.platform() === 'darwin') ? app.getAppPath() :
(os.platform() === 'darwin') ? path.resolve(path.join(path.dirname(app.getAppPath()), '../MacOS/repertory-ui')) :
process.env.APPIMAGE;
const autoLauncher = new AutoLaunch({
@@ -277,21 +277,25 @@ 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,
data: {
Exists: exists,
},
});
} catch (e) {
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
Exists: false,
}, e);
data : {
Exists: false,
},
});
}
});
ipcMain.on(Constants.IPC_Check_Dependency_Installed + '_sync', (event, data) => {
try {
const exists = fs.lstatSync(data.File).isFile();
const ls = fs.lstatSync(data.File);
event.returnValue = {
data: {
Exists: exists
Exists: ls.isFile() || ls.isSymbolicLink(),
},
};
} catch (e) {
@@ -589,7 +593,7 @@ ipcMain.on(Constants.IPC_Grab_UI_Releases, (event) => {
ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
if (data.Source.toLowerCase().endsWith('.dmg')) {
helpers
.executeAsync('hdiutil', ['attach', data.Source])
.executeAsync('open', ['-a', 'Finder', '-W', data.Source])
.then(() => {
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
Source: data.Source,