repairs to path finding and naming on OS X

This commit is contained in:
Stephen Birarda 2016-01-20 10:25:44 -08:00
parent d1421137e5
commit 57639672cf
3 changed files with 18 additions and 15 deletions

View file

@ -43,8 +43,11 @@ macro(SET_PACKAGING_PARAMETERS)
endif ()
if (APPLE)
set(DMG_SUBFOLDER_NAME "High Fidelity")
set(ESCAPED_DMG_SUBFOLDER_NAME "High\\ Fidelity")
set(DMG_SUBFOLDER_NAME "${BUILD_ORGANIZATION}")
set(ESCAPED_DMG_SUBFOLDER_NAME "")
string(REPLACE " " "\\ " ESCAPED_DMG_SUBFOLDER_NAME ${DMG_SUBFOLDER_NAME})
set(DMG_SUBFOLDER_ICON "${HF_CMAKE_DIR}/installer/install-folder.rsrc")
set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME})

View file

@ -184,9 +184,9 @@ var debug = argv.debug;
var binaryType = argv.binaryType;
interfacePath = pathFinder.discoveredPath("Interface", binaryType);
dsPath = pathFinder.discoveredPath("domain-server", binaryType);
acPath = pathFinder.discoveredPath("assignment-client", binaryType);
interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.releaseType);
dsPath = pathFinder.discoveredPath("domain-server", binaryType, buildInfo.releaseType);
acPath = pathFinder.discoveredPath("assignment-client", binaryType, buildInfo.releaseType);
function binaryMissingMessage(displayName, executableName, required) {
var message = "The " + displayName + " executable was not found.\n";

View file

@ -1,9 +1,9 @@
var fs = require('fs');
var path = require('path');
exports.searchPaths = function(name, binaryType) {
exports.searchPaths = function(name, binaryType, releaseType) {
function platformExtension(name) {
if (name == "Interface") {
if (name == "Interface" || name == "High Fidelity") {
if (process.platform == "darwin") {
return ".app/Contents/MacOS/" + name
} else if (process.platform == "win32") {
@ -21,7 +21,7 @@ exports.searchPaths = function(name, binaryType) {
var paths = [];
if (binaryType == "local-release" || binaryType == "local-debug") {
if (!releaseType) {
// check in the developer build tree for binaries
paths = [
devBasePath + name + extension,
@ -35,11 +35,6 @@ exports.searchPaths = function(name, binaryType) {
// assume we're inside an app bundle on OS X
if (process.platform == "darwin") {
// this is a production build - on OS X Interface will be called High Fidelity
if (name == "Interface") {
name = "High Fidelity";
}
var contentPath = ".app/Contents/";
var contentEndIndex = __dirname.indexOf(contentPath);
@ -60,7 +55,7 @@ exports.searchPaths = function(name, binaryType) {
return paths;
}
exports.discoveredPath = function (name, binaryType) {
exports.discoveredPath = function (name, binaryType, releaseType) {
function binaryFromPaths(name, paths) {
for (var i = 0; i < paths.length; i++) {
var testPath = paths[i];
@ -80,6 +75,11 @@ exports.discoveredPath = function (name, binaryType) {
return null;
}
// for a released server console on OS X, assume the name of the interface executable is "High Fidelity"
if (releaseType && name == "Interface") {
name = "High Fidelity";
}
// attempt to find a binary at the usual paths, return null if it doesn't exist
return binaryFromPaths(name, this.searchPaths(name, binaryType));
return binaryFromPaths(name, this.searchPaths(name, binaryType, releaseType));
}