Fix dependency installation on OS X
This commit is contained in:
18
electron.js
18
electron.js
@@ -113,7 +113,7 @@ function createWindow() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const appPath = (os.platform() === 'win32') ? path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
|
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;
|
process.env.APPIMAGE;
|
||||||
|
|
||||||
const autoLauncher = new AutoLaunch({
|
const autoLauncher = new AutoLaunch({
|
||||||
@@ -277,21 +277,25 @@ ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
|
|||||||
try {
|
try {
|
||||||
const exists = fs.lstatSync(data.File).isFile();
|
const exists = fs.lstatSync(data.File).isFile();
|
||||||
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
|
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
|
||||||
Exists: exists,
|
data: {
|
||||||
|
Exists: exists,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
|
standardIPCReply(event, Constants.IPC_Check_Dependency_Installed_Reply, {
|
||||||
Exists: false,
|
data : {
|
||||||
}, e);
|
Exists: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on(Constants.IPC_Check_Dependency_Installed + '_sync', (event, data) => {
|
ipcMain.on(Constants.IPC_Check_Dependency_Installed + '_sync', (event, data) => {
|
||||||
try {
|
try {
|
||||||
const exists = fs.lstatSync(data.File).isFile();
|
const ls = fs.lstatSync(data.File);
|
||||||
event.returnValue = {
|
event.returnValue = {
|
||||||
data: {
|
data: {
|
||||||
Exists: exists
|
Exists: ls.isFile() || ls.isSymbolicLink(),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -589,7 +593,7 @@ ipcMain.on(Constants.IPC_Grab_UI_Releases, (event) => {
|
|||||||
ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
|
ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
|
||||||
if (data.Source.toLowerCase().endsWith('.dmg')) {
|
if (data.Source.toLowerCase().endsWith('.dmg')) {
|
||||||
helpers
|
helpers
|
||||||
.executeAsync('hdiutil', ['attach', data.Source])
|
.executeAsync('open', ['-a', 'Finder', '-W', data.Source])
|
||||||
.then(() => {
|
.then(() => {
|
||||||
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
|
standardIPCReply(event, Constants.IPC_Install_Dependency_Reply, {
|
||||||
Source: data.Source,
|
Source: data.Source,
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
"fs-extra": "3.0.1",
|
"fs-extra": "3.0.1",
|
||||||
"html-webpack-plugin": "2.29.0",
|
"html-webpack-plugin": "2.29.0",
|
||||||
"jest": "20.0.4",
|
"jest": "20.0.4",
|
||||||
"mac-open": "^0.1.3",
|
|
||||||
"node-schedule": "^1.3.1",
|
"node-schedule": "^1.3.1",
|
||||||
"npm": "^6.6.0",
|
"npm": "^6.6.0",
|
||||||
"object-assign": "4.1.1",
|
"object-assign": "4.1.1",
|
||||||
|
|||||||
@@ -545,9 +545,11 @@ class App extends IPCContainer {
|
|||||||
const ret = this.sendSyncRequest(Constants.IPC_Check_Dependency_Installed, {
|
const ret = this.sendSyncRequest(Constants.IPC_Check_Dependency_Installed, {
|
||||||
File: dep.file,
|
File: dep.file,
|
||||||
});
|
});
|
||||||
if (ret.data.Exists || !ret.data.Success) {
|
if (ret.data.Exists) {
|
||||||
clearInterval(i);
|
clearInterval(i);
|
||||||
this.checkVersionInstalled();
|
setTimeout(() => {
|
||||||
|
this.checkVersionInstalled();
|
||||||
|
}, 10000);
|
||||||
}
|
}
|
||||||
}, 3000);
|
}, 3000);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user