mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:49:27 +02:00
Fixes for OSX
App Translocation makes it nearly impossible to find the interface executable from the running server-console, specifically in downloaded builds launched from the Finder. To enable OSX detection and and launch of the interface, the code has been changed to: * Assume interface is installed on OSX as we don't produce a server-only build. * Launch the interface by using 'open' with the appid. NOTE: This may launch the wrong version of the app if multiple instances of the app are installed, but this is the best we can do for now. For most users, the behavior should be as expected. Second, polling was happening even if interface couldn't be detected if it was previously enabled.
This commit is contained in:
parent
b6877bca57
commit
113ad3d917
6 changed files with 55 additions and 12 deletions
|
@ -37,6 +37,7 @@ macro(SET_PACKAGING_PARAMETERS)
|
||||||
set(BUILD_VERSION ${RELEASE_NUMBER})
|
set(BUILD_VERSION ${RELEASE_NUMBER})
|
||||||
set(BUILD_ORGANIZATION "High Fidelity")
|
set(BUILD_ORGANIZATION "High Fidelity")
|
||||||
set(HIGH_FIDELITY_PROTOCOL "hifi")
|
set(HIGH_FIDELITY_PROTOCOL "hifi")
|
||||||
|
set(HIGH_FIDELITY_APP_PROTOCOL "hifiapp")
|
||||||
set(INTERFACE_BUNDLE_NAME "Interface")
|
set(INTERFACE_BUNDLE_NAME "Interface")
|
||||||
set(INTERFACE_ICON_PREFIX "interface")
|
set(INTERFACE_ICON_PREFIX "interface")
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,14 @@
|
||||||
<string>hifi</string>
|
<string>hifi</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME} APP URL</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>hifiapp</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|
|
@ -27,6 +27,7 @@ set(DS_EXEC_NAME "@DS_EXEC_NAME@")
|
||||||
set(AC_DISPLAY_NAME "Assignment Client")
|
set(AC_DISPLAY_NAME "Assignment Client")
|
||||||
set(AC_EXEC_NAME "@AC_EXEC_NAME@")
|
set(AC_EXEC_NAME "@AC_EXEC_NAME@")
|
||||||
set(HIGH_FIDELITY_PROTOCOL "@HIGH_FIDELITY_PROTOCOL@")
|
set(HIGH_FIDELITY_PROTOCOL "@HIGH_FIDELITY_PROTOCOL@")
|
||||||
|
set(HIGH_FIDELITY_APP_PROTOCOL "@HIGH_FIDELITY_APP_PROTOCOL@")
|
||||||
set(PRODUCTION_BUILD "@PRODUCTION_BUILD@")
|
set(PRODUCTION_BUILD "@PRODUCTION_BUILD@")
|
||||||
set(PR_BUILD "@PR_BUILD@")
|
set(PR_BUILD "@PR_BUILD@")
|
||||||
set(BUILD_ORGANIZATION "@BUILD_ORGANIZATION@")
|
set(BUILD_ORGANIZATION "@BUILD_ORGANIZATION@")
|
||||||
|
|
|
@ -108,8 +108,17 @@ const ipcMain = electron.ipcMain;
|
||||||
|
|
||||||
|
|
||||||
function isInterfaceInstalled() {
|
function isInterfaceInstalled() {
|
||||||
|
if (osType == "Darwin") {
|
||||||
|
// In OSX Sierra, the app translocation process moves
|
||||||
|
// the executable to a random location before starting it
|
||||||
|
// which makes finding the interface near impossible using
|
||||||
|
// relative paths. For now, as there are no server-only
|
||||||
|
// installs, we just assume the interface is installed here
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
return interfacePath;
|
return interfacePath;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function isServerInstalled() {
|
function isServerInstalled() {
|
||||||
return dsPath && acPath;
|
return dsPath && acPath;
|
||||||
|
@ -377,7 +386,7 @@ LogWindow.prototype = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function visitSandboxClicked() {
|
function visitSandboxClicked() {
|
||||||
if (interfacePath) {
|
if (isInterfaceInstalled()) {
|
||||||
StartInterface('hifi://localhost');
|
StartInterface('hifi://localhost');
|
||||||
} else {
|
} else {
|
||||||
// show an error to say that we can't go home without an interface instance
|
// show an error to say that we can't go home without an interface instance
|
||||||
|
@ -906,6 +915,9 @@ app.on('ready', function() {
|
||||||
tray.popUpContextMenu(tray.menu);
|
tray.popUpContextMenu(tray.menu);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (isInterfaceInstalled()) {
|
||||||
|
trayNotifications.startPolling();
|
||||||
|
}
|
||||||
updateTrayMenu(ProcessGroupStates.STOPPED);
|
updateTrayMenu(ProcessGroupStates.STOPPED);
|
||||||
|
|
||||||
maybeInstallDefaultContentSet(onContentLoaded);
|
maybeInstallDefaultContentSet(onContentLoaded);
|
||||||
|
|
|
@ -7,6 +7,7 @@ const path = require('path');
|
||||||
const argv = require('yargs').argv;
|
const argv = require('yargs').argv;
|
||||||
const hfprocess = require('./hf-process');
|
const hfprocess = require('./hf-process');
|
||||||
const osHomeDir = require('os-homedir');
|
const osHomeDir = require('os-homedir');
|
||||||
|
const childProcess = require('child_process');
|
||||||
const Process = hfprocess.Process;
|
const Process = hfprocess.Process;
|
||||||
|
|
||||||
const binaryType = argv.binaryType;
|
const binaryType = argv.binaryType;
|
||||||
|
@ -53,6 +54,23 @@ const buildInfo = exports.getBuildInfo();
|
||||||
const interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType);
|
const interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType);
|
||||||
|
|
||||||
exports.startInterface = function(url) {
|
exports.startInterface = function(url) {
|
||||||
|
|
||||||
|
if (osType === 'Darwin') {
|
||||||
|
if (!url) {
|
||||||
|
log.debug("No URL given for startInterface");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// do this as a workaround for app translocation on osx, which makes
|
||||||
|
// it nearly impossible to find the interface executable
|
||||||
|
var bundle_id = 'com.highfidelity.interface-dev';
|
||||||
|
if (buildInfo.releaseType == 'PR') {
|
||||||
|
bundle_id = 'com.highfidelity.interface-pr';
|
||||||
|
} else if (buildInfo.releaseType == 'PRODUCTION') {
|
||||||
|
bundle_id = 'com.highfidelity.interface';
|
||||||
|
}
|
||||||
|
childProcess.exec('open -b ' + bundle_id + ' --args --url ' + url);
|
||||||
|
} else {
|
||||||
var argArray = [];
|
var argArray = [];
|
||||||
|
|
||||||
// check if we have a url parameter to include
|
// check if we have a url parameter to include
|
||||||
|
@ -65,6 +83,7 @@ exports.startInterface = function(url) {
|
||||||
pInterface.detached = true;
|
pInterface.detached = true;
|
||||||
pInterface.start();
|
pInterface.start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exports.isInterfaceRunning = function(done) {
|
exports.isInterfaceRunning = function(done) {
|
||||||
if (osType === 'Windows_NT') {
|
if (osType === 'Windows_NT') {
|
||||||
|
|
|
@ -143,7 +143,6 @@ function HifiNotifications(config, menuNotificationCallback) {
|
||||||
this.walletSince = new Date(this.config.get("walletNotifySince", "1970-01-01T00:00:00.000Z"));
|
this.walletSince = new Date(this.config.get("walletNotifySince", "1970-01-01T00:00:00.000Z"));
|
||||||
this.marketplaceSince = new Date(this.config.get("marketplaceNotifySince", "1970-01-01T00:00:00.000Z"));
|
this.marketplaceSince = new Date(this.config.get("marketplaceNotifySince", "1970-01-01T00:00:00.000Z"));
|
||||||
|
|
||||||
this.enable(this.enabled());
|
|
||||||
this.pendingNotifications = [];
|
this.pendingNotifications = [];
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,6 +192,9 @@ HifiNotifications.prototype = {
|
||||||
enabled: function () {
|
enabled: function () {
|
||||||
return !this.config.get("disableTrayNotifications", false);
|
return !this.config.get("disableTrayNotifications", false);
|
||||||
},
|
},
|
||||||
|
startPolling: function () {
|
||||||
|
this.enable(this.enabled());
|
||||||
|
},
|
||||||
stopPolling: function () {
|
stopPolling: function () {
|
||||||
this.config.set("storiesNotifySince", this.storiesSince.toISOString());
|
this.config.set("storiesNotifySince", this.storiesSince.toISOString());
|
||||||
this.config.set("peopleNotifySince", this.peopleSince.toISOString());
|
this.config.set("peopleNotifySince", this.peopleSince.toISOString());
|
||||||
|
|
Loading…
Reference in a new issue