From 57639672cf516fee75aad6d030d1512061104cb7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 20 Jan 2016 10:25:44 -0800 Subject: [PATCH] repairs to path finding and naming on OS X --- cmake/macros/SetPackagingParameters.cmake | 7 +++++-- server-console/src/main.js | 6 +++--- server-console/src/modules/path-finder.js | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index b7eed6fbb7..fcc88ab71b 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -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}) diff --git a/server-console/src/main.js b/server-console/src/main.js index 10918cbb82..7b95b52c26 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -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"; diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index 8c10aefca0..ca10171ada 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -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)); }