From be87773b2c9d5e0bcd6cad9cb895217502381219 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 10:46:19 -0700 Subject: [PATCH 01/33] Checkpoint sysTray Installer --- cmake/macros/SetPackagingParameters.cmake | 10 +- cmake/templates/CPackProperties.cmake.in | 2 +- cmake/templates/NSIS.template.in | 173 +++++++++++----------- server-console/CMakeLists.txt | 4 +- server-console/src/main.js | 76 +++++----- server-console/src/modules/hf-app.js | 2 +- 6 files changed, 127 insertions(+), 140 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 0f8975e9b5..164d326b20 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -18,7 +18,7 @@ macro(SET_PACKAGING_PARAMETERS) set(BUILD_GLOBAL_SERVICES "DEVELOPMENT") set(USE_STABLE_GLOBAL_SERVICES 0) set(BUILD_NUMBER 0) - set(APP_USER_MODEL_ID "com.highfidelity.sandbox-dev") + set(APP_USER_MODEL_ID "com.highfidelity.console") set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV") set_from_env(RELEASE_NUMBER RELEASE_NUMBER "") @@ -176,15 +176,15 @@ macro(SET_PACKAGING_PARAMETERS) # shortcut names if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") - set(CONSOLE_SHORTCUT_NAME "Sandbox") - set(APP_USER_MODEL_ID "com.highfidelity.sandbox") + set(CONSOLE_SHORTCUT_NAME "High Fidelity Console") + set(APP_USER_MODEL_ID "com.highfidelity.console") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION_NO_SHA}") - set(CONSOLE_SHORTCUT_NAME "Sandbox - ${BUILD_VERSION_NO_SHA}") + set(CONSOLE_SHORTCUT_NAME "High Fidelity Console - ${BUILD_VERSION_NO_SHA}") endif () set(INTERFACE_HF_SHORTCUT_NAME "${INTERFACE_SHORTCUT_NAME}") - set(CONSOLE_HF_SHORTCUT_NAME "High Fidelity ${CONSOLE_SHORTCUT_NAME}") + set(CONSOLE_HF_SHORTCUT_NAME "${CONSOLE_SHORTCUT_NAME}") set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "High Fidelity") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "Server Console") diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 1d7effd18f..0a56181138 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -13,7 +13,7 @@ set(INTERFACE_DISPLAY_NAME "Interface") set(INTERFACE_SHORTCUT_NAME "@INTERFACE_SHORTCUT_NAME@") set(INTERFACE_HF_SHORTCUT_NAME "@INTERFACE_HF_SHORTCUT_NAME@") set(INTERFACE_WIN_EXEC_NAME "@INTERFACE_EXEC_PREFIX@.exe") -set(CONSOLE_DISPLAY_NAME "Sandbox") +set(CONSOLE_DISPLAY_NAME "Console") set(CONSOLE_INSTALL_SUBDIR "@CONSOLE_INSTALL_DIR@") set(CONSOLE_SHORTCUT_NAME "@CONSOLE_SHORTCUT_NAME@") set(CONSOLE_HF_SHORTCUT_NAME "@CONSOLE_HF_SHORTCUT_NAME@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 7f6884f478..b7564f45e5 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -405,6 +405,14 @@ Var GAClientID Section "-Previous Install Cleanup" ; Remove the resources folder so we don't end up including removed QML files RMDir /r "$INSTDIR\resources" + + ; delete old assignment-client and domain-server so they're no longer present + ; in client only installs. + Delete "$INSTDIR\@DS_EXEC_NAME@" + Delete "$INSTDIR\@AC_EXEC_NAME@" + + ; delete interface so it's not there for server-only installs + Delete "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" SectionEnd @CPACK_NSIS_INSTALLATION_TYPES@ @@ -532,9 +540,9 @@ SectionEnd Var PostInstallDialog Var DesktopClientCheckbox -Var DesktopServerCheckbox -Var ServerStartupCheckbox -Var LaunchServerNowCheckbox +Var DesktopConsoleCheckbox +Var ConsoleStartupCheckbox +Var LaunchConsoleNowCheckbox Var LaunchClientNowCheckbox Var CleanInstallCheckbox Var CurrentOffset @@ -746,28 +754,8 @@ Function PostInstallOptionsPage !insertmacro SetInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED} ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" - Pop $DesktopServerCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $DesktopServerCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} - ${EndIf} - - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - Pop $LaunchServerNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchServerNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchServerNowCheckbox ${BST_UNCHECKED} - ${EndIf} - - IntOp $CurrentOffset $CurrentOffset + 15 - ${EndIf} + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install" @@ -782,28 +770,42 @@ Function PostInstallOptionsPage ${EndIf} ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - Pop $ServerStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ServerStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} ${EndIf} + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox IntOp $CurrentOffset $CurrentOffset + 15 ${If} @PR_BUILD@ == 1 - ; a PR build defaults all install options expect LaunchServerNowCheckbox, LaunchClientNowCheckbox and the settings copy to unchecked + ; a PR build defaults all install options expect LaunchConsoleNowCheckbox, LaunchClientNowCheckbox and the settings copy to unchecked ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_SetState} $DesktopClientCheckbox ${BST_UNCHECKED} ${EndIf} ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_SetState} $DesktopServerCheckbox ${BST_UNCHECKED} - ${NSD_SetState} $ServerStartupCheckbox ${BST_UNCHECKED} + ${NSD_SetState} $DesktopConsoleCheckbox ${BST_UNCHECKED} + ${NSD_SetState} $ConsoleStartupCheckbox ${BST_UNCHECKED} ${EndIf} ; push the offset @@ -824,9 +826,9 @@ FunctionEnd !macroend Var DesktopClientState -Var DesktopServerState -Var ServerStartupState -Var LaunchServerNowState +Var DesktopConsoleState +Var ConsoleStartupState +Var LaunchConsoleNowState Var LaunchClientNowState Var CopyFromProductionState Var CleanInstallState @@ -842,11 +844,11 @@ Function ReadInstallTypes StrCpy $Express "1" StrCpy $DesktopClientState ${BST_CHECKED} - StrCpy $ServerStartupState ${BST_CHECKED} - StrCpy $LaunchServerNowState ${BST_CHECKED} + StrCpy $ConsoleStartupState ${BST_CHECKED} + StrCpy $LaunchConsoleNowState ${BST_CHECKED} StrCpy $LaunchClientNowState ${BST_CHECKED} StrCpy $CleanInstallState ${BST_UNCHECKED} - StrCpy $DesktopServerState ${BST_UNCHECKED} + StrCpy $DesktopConsoleState ${BST_UNCHECKED} ${If} @PR_BUILD@ == 1 StrCpy $CopyFromProductionState ${BST_UNCHECKED} @@ -860,28 +862,25 @@ Function ReadInstallTypes FunctionEnd Function ReadPostInstallOptions + + ; check if the user asked for a desktop shortcut to console + ${NSD_GetState} $DesktopConsoleCheckbox $DesktopConsoleState + + ; check if the user asked to have console launched every startup + ${NSD_GetState} $ConsoleStartupCheckbox $ConsoleStartupState + ${If} @CLIENT_COMPONENT_CONDITIONAL@ ; check if the user asked for a desktop shortcut to High Fidelity ${NSD_GetState} $DesktopClientCheckbox $DesktopClientState ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ; check if the user asked for a desktop shortcut to Sandbox - ${NSD_GetState} $DesktopServerCheckbox $DesktopServerState - - ; check if the user asked to have Sandbox launched every startup - ${NSD_GetState} $ServerStartupCheckbox $ServerStartupState - ${EndIf} - ${If} @PR_BUILD@ == 1 ; check if we need to copy settings/content from production for this PR build ${NSD_GetState} $CopyFromProductionCheckbox $CopyFromProductionState ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ; check if we need to launch the server post-install - ${NSD_GetState} $LaunchServerNowCheckbox $LaunchServerNowState - ${EndIf} + ; check if we need to launch the console post-install + ${NSD_GetState} $LaunchConsoleNowCheckbox $LaunchConsoleNowState ${If} @CLIENT_COMPONENT_CONDITIONAL@ ; check if we need to launch the client post-install @@ -893,6 +892,17 @@ Function ReadPostInstallOptions FunctionEnd Function HandlePostInstallOptions + + ; check if the user asked for a desktop shortcut to the console + ${If} $DesktopConsoleState == ${BST_CHECKED} + CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES + ; Set appUserModelId + ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ${EndIf} + ${If} @CLIENT_COMPONENT_CONDITIONAL@ ; check if the user asked for a desktop shortcut to High Fidelity ${If} $DesktopClientState == ${BST_CHECKED} @@ -901,38 +911,24 @@ Function HandlePostInstallOptions ${Else} !insertmacro WriteInstallOption @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ NO ${EndIf} - ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ; check if the user asked for a desktop shortcut to Sandbox - ${If} $DesktopServerState == ${BST_CHECKED} - CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES - ; Set appUserModelId - ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" - ${Else} - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO - ${EndIf} + ; check if the user asked to have Console launched every startup + ${If} $ConsoleStartupState == ${BST_CHECKED} + ; in case we added a shortcut in the global context, pull that now + SetShellVarContext all + Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" + ; make a startup shortcut in this user's current context + SetShellVarContext current + CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; check if the user asked to have Sandbox launched every startup - ${If} $ServerStartupState == ${BST_CHECKED} - ; in case we added a shortcut in the global context, pull that now - SetShellVarContext all - Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" + ; reset the shell var context back + SetShellVarContext all - ; make a startup shortcut in this user's current context - SetShellVarContext current - CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - - ; reset the shell var context back - SetShellVarContext all - - !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ YES - ${Else} - !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ NO - ${EndIf} + !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ YES + ${Else} + !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ NO ${EndIf} ; check if the user asked for a clean install @@ -982,16 +978,15 @@ Function HandlePostInstallOptions ${EndIf} ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${AndIf} $LaunchServerNowState == ${BST_CHECKED} + ${If} $LaunchConsoleNowState == ${BST_CHECKED} !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES ; both launches use the explorer trick in case the user has elevated permissions for the installer ${If} $LaunchClientNowState == ${BST_CHECKED} !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ YES ; create shortcut with ARGUMENTS - CreateShortCut "$TEMP\SandboxShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface" - Exec '"$WINDIR\explorer.exe" "$TEMP\SandboxShortcut.lnk"' + CreateShortCut "$TEMP\ConsoleShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface" + Exec '"$WINDIR\explorer.exe" "$TEMP\ConsoleShortcut.lnk"' ${Else} !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO Exec '"$WINDIR\explorer.exe" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@"' @@ -1164,13 +1159,11 @@ Section "-Core installation" ${EndIf} - ; Conditional handling for server console shortcut - ${If} @SERVER_COMPONENT_CONDITIONAL@ - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ - "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; Set appUserModelId - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" - ${EndIf} + ; handling for server console shortcut + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ + "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ; Set appUserModelId + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@UNINSTALLER_NAME@" diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 1c6e40c582..bdcefda5d8 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -19,7 +19,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Server Console") set_target_properties(${TARGET_NAME}-npm-install PROPERTIES FOLDER "hidden/Server Console") # add a dependency from the package target to the server components -add_dependencies(${TARGET_NAME} assignment-client domain-server) +add_dependencies(${TARGET_NAME} assignment-client domain-server interface) # set the packaged console folder depending on platform, so we can copy it if (APPLE) @@ -36,6 +36,7 @@ if (APPLE) PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} + COMPONENT ${CLIENT_COMPONENT} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") @@ -44,6 +45,7 @@ elseif (WIN32) DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} + COMPONENT ${CLIENT_COMPONENT} ) # sign the copied server console executable after install diff --git a/server-console/src/main.js b/server-console/src/main.js index 95b5935255..08692fbd50 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -104,12 +104,12 @@ userConfig.load(configPath); const ipcMain = electron.ipcMain; -function isServerInstalled() { - return interfacePath && userConfig.get("serverInstalled", true); +function isInterfaceInstalled() { + return interfacePath; } -function isInterfaceInstalled() { - return dsPath && acPath && userConfig.get("interfaceInstalled", true); +function isServerInstalled() { + return dsPath && acPath; } var isShuttingDown = false; @@ -263,6 +263,10 @@ interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.rel dsPath = pathFinder.discoveredPath("domain-server", binaryType, buildInfo.releaseType); acPath = pathFinder.discoveredPath("assignment-client", binaryType, buildInfo.releaseType); +console.log("Domain Server Path: " + dsPath); +console.log("Assignment Client Path: " + acPath); +console.log("Interface Path: " + interfacePath); + function binaryMissingMessage(displayName, executableName, required) { var message = "The " + displayName + " executable was not found.\n"; @@ -286,18 +290,6 @@ function binaryMissingMessage(displayName, executableName, required) { return message; } -// if at this point any of the paths are null, we're missing something we wanted to find - -if (!dsPath) { - dialog.showErrorBox("Domain Server Not Found", binaryMissingMessage("domain-server", "domain-server", true)); - app.exit(0); -} - -if (!acPath) { - dialog.showErrorBox("Assignment Client Not Found", binaryMissingMessage("assignment-client", "assignment-client", true)); - app.exit(0); -} - function openFileBrowser(path) { // Add quotes around path path = '"' + path + '"'; @@ -815,33 +807,33 @@ function onContentLoaded() { // Disable splash window for now. // maybeShowSplash(); - if (buildInfo.releaseType == 'PRODUCTION' && !argv.noUpdater) { - - const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30; - var hasShownUpdateNotification = false; - const updateChecker = new updater.UpdateChecker(buildInfo, CHECK_FOR_UPDATES_INTERVAL_SECONDS); - updateChecker.on('update-available', function(latestVersion, url) { - if (!hasShownUpdateNotification) { - notifier.notify({ - icon: notificationIcon, - title: 'An update is available!', - message: 'High Fidelity version ' + latestVersion + ' is available', - wait: true, - appID: buildInfo.appUserModelId, - url: url - }); - hasShownUpdateNotification = true; - } - }); - notifier.on('click', function(notifierObject, options) { - log.debug("Got click", options.url); - shell.openExternal(options.url); - }); - } - - deleteOldFiles(logPath, DELETE_LOG_FILES_OLDER_THAN_X_SECONDS, LOG_FILE_REGEX); - if (isServerInstalled()) { + if (buildInfo.releaseType == 'PRODUCTION' && !argv.noUpdater) { + + const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30; + var hasShownUpdateNotification = false; + const updateChecker = new updater.UpdateChecker(buildInfo, CHECK_FOR_UPDATES_INTERVAL_SECONDS); + updateChecker.on('update-available', function(latestVersion, url) { + if (!hasShownUpdateNotification) { + notifier.notify({ + icon: notificationIcon, + title: 'An update is available!', + message: 'High Fidelity version ' + latestVersion + ' is available', + wait: true, + appID: buildInfo.appUserModelId, + url: url + }); + hasShownUpdateNotification = true; + } + }); + notifier.on('click', function(notifierObject, options) { + log.debug("Got click", options.url); + shell.openExternal(options.url); + }); + } + + deleteOldFiles(logPath, DELETE_LOG_FILES_OLDER_THAN_X_SECONDS, LOG_FILE_REGEX); + var dsArguments = ['--get-temp-name', '--parent-pid', process.pid]; domainServer = new Process('domain-server', dsPath, dsArguments, logPath); diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 625715b392..1b1171baef 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -34,7 +34,7 @@ exports.getBuildInfo = function() { buildNumber: "0", stableBuild: "0", organization: "High Fidelity - dev", - appUserModelId: "com.highfidelity.sandbox-dev" + appUserModelId: "com.highfidelity.console" }; var buildInfo = DEFAULT_BUILD_INFO; From 2c6e9349ebd87c775fd58e63582015ab3bbbe595 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 12:59:15 -0700 Subject: [PATCH 02/33] SysTray Setup. server-console.exe should be included in client-only installs. By default, on new install, tray notifier should be enabled. --- server-console/CMakeLists.txt | 12 ++++++++++-- server-console/src/main.js | 16 +++++++--------- server-console/src/modules/hf-notifications.js | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index bdcefda5d8..16189dff9d 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -36,7 +36,11 @@ if (APPLE) PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} + ) + install( + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DESTINATION ${CONSOLE_INSTALL_DIR} + COMPONENT ${CLIENT_COMPONENT} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") @@ -45,7 +49,11 @@ elseif (WIN32) DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} + ) + install( + DIRECTORY "${CONSOLE_DESTINATION}/" + DESTINATION ${CONSOLE_INSTALL_DIR} + COMPONENT ${CLIENT_COMPONENT} ) # sign the copied server console executable after install diff --git a/server-console/src/main.js b/server-console/src/main.js index 08692fbd50..cfde72e3bc 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -509,11 +509,13 @@ function buildMenuArray(serverState) { menuArray.push(labels.share); menuArray.push(separator); if (isInterfaceInstalled()) { - menuArray.push(labels.goto); - menuArray.push(labels.people); - menuArray.push(labels.wallet); - menuArray.push(labels.marketplace); - menuArray.push(separator); + if(trayNotifications.enabled()) { + menuArray.push(labels.goto); + menuArray.push(labels.people); + menuArray.push(labels.wallet); + menuArray.push(labels.marketplace); + menuArray.push(separator); + } menuArray.push(labels.showNotifications); menuArray.push(separator); } @@ -545,10 +547,6 @@ function updateLabels(serverState) { } labels.showNotifications.checked = trayNotifications.enabled(); - labels.people.visible = trayNotifications.enabled(); - labels.goto.visible = trayNotifications.enabled(); - labels.wallet.visible = trayNotifications.enabled(); - labels.marketplace.visible = trayNotifications.enabled(); labels.goto.icon = pendingNotifications[HifiNotificationType.GOTO] ? menuNotificationIcon : null; labels.people.icon = pendingNotifications[HifiNotificationType.PEOPLE] ? menuNotificationIcon : null; labels.wallet.icon = pendingNotifications[HifiNotificationType.WALLET] ? menuNotificationIcon : null; diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index a9ee2489a9..a95a553631 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -139,7 +139,7 @@ function HifiNotifications(config, menuNotificationCallback) { HifiNotifications.prototype = { enable: function (enabled) { - this.config.set("enableTrayNotifications", enabled); + this.config.set("disableTrayNotifications", !enabled); if (enabled) { var _this = this; this.storiesPollTimer = setInterval(function () { @@ -185,7 +185,7 @@ HifiNotifications.prototype = { } }, enabled: function () { - return this.config.get("enableTrayNotifications", true); + return !this.config.get("disableTrayNotifications", false); }, stopPolling: function () { this.config.set("storiesNotifySince", this.storiesSince.toISOString()); From 5949679c0a25769267e70bc01bf5b58b5e77514b Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 13:00:37 -0700 Subject: [PATCH 03/33] Add mac interface-run detection to server-console --- server-console/src/modules/hf-process.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server-console/src/modules/hf-process.js b/server-console/src/modules/hf-process.js index cf94ec6b29..35da07af9c 100644 --- a/server-console/src/modules/hf-process.js +++ b/server-console/src/modules/hf-process.js @@ -275,6 +275,9 @@ Process.prototype = extend(Process.prototype, { }); } else if (os.type == 'Darwin') { console.log("TODO IsRunning Darwin"); + childProcess.exec('ps cax | grep interface', function (err, stdout, stderr) { + done(stdout.length > 0); + }); } }, From db772fc3fecd2b0c6df65a1a84c0546bb1dbd503 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 15:39:45 -0700 Subject: [PATCH 04/33] Update console name for osx build --- cmake/macros/GenerateInstallers.cmake | 6 +++--- cmake/macros/InstallBesideConsole.cmake | 4 ++-- cmake/macros/SetPackagingParameters.cmake | 2 +- server-console/CMakeLists.txt | 2 +- server-console/package.json | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index acafd9b6c7..64919172f7 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -20,9 +20,9 @@ macro(GENERATE_INSTALLERS) set(INSTALLER_TYPE "client_only") string(REGEX REPLACE "High Fidelity" "High Fidelity Interface" _DISPLAY_NAME ${BUILD_ORGANIZATION}) elseif (SERVER_ONLY) - set(_PACKAGE_NAME_EXTRA "-Sandbox") + set(_PACKAGE_NAME_EXTRA "-Console") set(INSTALLER_TYPE "server_only") - string(REGEX REPLACE "High Fidelity" "High Fidelity Sandbox" _DISPLAY_NAME ${BUILD_ORGANIZATION}) + string(REGEX REPLACE "High Fidelity" "High Fidelity Console" _DISPLAY_NAME ${BUILD_ORGANIZATION}) else () set(_DISPLAY_NAME ${BUILD_ORGANIZATION}) set(INSTALLER_TYPE "full") @@ -122,7 +122,7 @@ macro(GENERATE_INSTALLERS) endif () if (BUILD_SERVER) - cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Sandbox") + cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Console") endif () include(CPack) diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 3c991acf86..e3186501f4 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -66,8 +66,8 @@ macro(install_beside_console) install(CODE " set(MACOSX_BUNDLE_EXECUTABLE_NAME domain-server) set(MACOSX_BUNDLE_GUI_IDENTIFIER com.highfidelity.server-components) - set(MACOSX_BUNDLE_BUNDLE_NAME Sandbox\\ Components) - configure_file(${HF_CMAKE_DIR}/templates/MacOSXBundleSandboxComponentsInfo.plist.in ${ESCAPED_BUNDLE_NAME}/Contents/Info.plist) + set(MACOSX_BUNDLE_BUNDLE_NAME Console\\ Components) + configure_file(${HF_CMAKE_DIR}/templates/MacOSXBundleConsoleComponentsInfo.plist.in ${ESCAPED_BUNDLE_NAME}/Contents/Info.plist) execute_process(COMMAND ${MACDEPLOYQT_COMMAND} ${ESCAPED_BUNDLE_NAME} -verbose=2 -executable=${ESCAPED_EXECUTABLE_NAME})" COMPONENT ${SERVER_COMPONENT} ) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 164d326b20..aaba3bc201 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -142,7 +142,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(CONSOLE_EXEC_NAME "Sandbox.app") + set(CONSOLE_EXEC_NAME "Console.app") set(CONSOLE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME}") set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 16189dff9d..df51409151 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -23,7 +23,7 @@ add_dependencies(${TARGET_NAME} assignment-client domain-server interface) # set the packaged console folder depending on platform, so we can copy it if (APPLE) - set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") + set(PACKAGED_CONSOLE_FOLDER "Console-darwin-x64/${CONSOLE_EXEC_NAME}") elseif (WIN32) set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64") elseif (UNIX) diff --git a/server-console/package.json b/server-console/package.json index 565658702b..b0d181c65a 100644 --- a/server-console/package.json +++ b/server-console/package.json @@ -1,6 +1,6 @@ { - "name": "HighFidelitySandbox", - "description": "High Fidelity Sandbox", + "name": "HighFidelityConsole", + "description": "High Fidelity Console", "author": "High Fidelity", "license": "Apache-2.0", "version": "1.0.0", From ba1bae6408b82a5b8d230f442249b9e4467e5d58 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 17:43:04 -0700 Subject: [PATCH 05/33] OSX Build fix --- ...fo.plist.in => MacOSXBundleConsoleComponentsInfo.plist.in} | 0 server-console/packager.js | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename cmake/templates/{MacOSXBundleSandboxComponentsInfo.plist.in => MacOSXBundleConsoleComponentsInfo.plist.in} (100%) diff --git a/cmake/templates/MacOSXBundleSandboxComponentsInfo.plist.in b/cmake/templates/MacOSXBundleConsoleComponentsInfo.plist.in similarity index 100% rename from cmake/templates/MacOSXBundleSandboxComponentsInfo.plist.in rename to cmake/templates/MacOSXBundleConsoleComponentsInfo.plist.in diff --git a/server-console/packager.js b/server-console/packager.js index 89bcd7cb71..5e4fbfe568 100644 --- a/server-console/packager.js +++ b/server-console/packager.js @@ -27,8 +27,8 @@ var options = { } const EXEC_NAME = "server-console"; -const SHORT_NAME = "Sandbox"; -const FULL_NAME = "High Fidelity Sandbox"; +const SHORT_NAME = "Console"; +const FULL_NAME = "High Fidelity Console"; // setup per OS options if (osType == "Darwin") { From b6fd302a837f7de0fe58bba1b62f974f6ee4efc2 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 18:40:54 -0700 Subject: [PATCH 06/33] OSX Interface-running detection fixes --- server-console/src/modules/hf-app.js | 6 +++++- server-console/src/modules/hf-process.js | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 1b1171baef..d7c54d3e4d 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -67,7 +67,11 @@ exports.startInterface = function(url) { } exports.isInterfaceRunning = function(done) { - var pInterface = new Process('interface', 'interface.exe'); + if (osType == 'Windows_NT') { + var pInterface = new Process('interface', 'interface.exe'); + } else if (osType == 'Darwin') { + var pInterface = new Process('interface', 'Interface'); + } return pInterface.isRunning(done); } diff --git a/server-console/src/modules/hf-process.js b/server-console/src/modules/hf-process.js index 35da07af9c..7736de0e55 100644 --- a/server-console/src/modules/hf-process.js +++ b/server-console/src/modules/hf-process.js @@ -274,8 +274,7 @@ Process.prototype = extend(Process.prototype, { done(running); }); } else if (os.type == 'Darwin') { - console.log("TODO IsRunning Darwin"); - childProcess.exec('ps cax | grep interface', function (err, stdout, stderr) { + childProcess.exec('ps cax | grep ' + _command, function (err, stdout, stderr) { done(stdout.length > 0); }); } From 61aef14c64cfb2cf40858ff2df03c6a36991c2b3 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 10:16:21 -0700 Subject: [PATCH 07/33] OSX notifications dismiss the previous notifications immediately when sent, preventing 'click' behavior --- .../src/modules/hf-notifications.js | 63 +++++++++++++++---- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index a95a553631..c7f4e24a17 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -7,12 +7,14 @@ const path = require('path'); const AccountInfo = require('./hf-acctinfo').AccountInfo; const GetBuildInfo = hfApp.getBuildInfo; const buildInfo = GetBuildInfo(); +const osType = os.type(); const notificationIcon = path.join(__dirname, '../../resources/console-notification.png'); const STORIES_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; const PEOPLE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; const WALLET_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; +const OSX_CLICK_DELAY_TIMEOUT = 500; const METAVERSE_SERVER_URL= process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : 'https://metaverse.highfidelity.com' const STORIES_URL= '/api/v1/user_stories'; @@ -33,13 +35,15 @@ const NotificationType = { MARKETPLACE: 'marketplace' }; + function HifiNotification(notificationType, notificationData, menuNotificationCallback) { this.type = notificationType; this.data = notificationData; } HifiNotification.prototype = { - show: function () { + show: function (finished) { + var _finished = finished; var text = ""; var message = ""; var url = null; @@ -114,8 +118,16 @@ HifiNotification.prototype = { message: message, wait: true, appID: buildInfo.appUserModelId, - url: url - }); + url: url, + timeout: 5 + }, + function (error, reason, metadata) { + if (osType == 'Darwin') { + setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); + } else { + _finished(); + } + }); } } @@ -129,9 +141,12 @@ function HifiNotifications(config, menuNotificationCallback) { this.marketplaceSince = new Date(this.config.get("marketplaceNotifySince", "1970-01-01T00:00:00.000Z")); this.enable(this.enabled()); + this.pendingNotifications = []; + var _menuNotificationCallback = menuNotificationCallback; notifier.on('click', function (notifierObject, options) { + console.log("click."); StartInterface(options.url); _menuNotificationCallback(options.notificationType, false); }); @@ -195,6 +210,36 @@ HifiNotifications.prototype = { this.enable(false); }, + _showNotification: function () { + var _this = this; + + if (osType == 'Darwin') { + this.pendingNotifications[0].show(function () { + // For OSX + // don't attempt to show the next notification + // until the current is clicked or times out + // as the OSX Notifier stuff will dismiss + // the previous notification immediately + // when a new one is submitted + _this.pendingNotifications.shift(); + if(_this.pendingNotifications.length > 0) { + _this._showNotification(); + } + }); + } else { + // For Windows + // All notifications are sent immediately as they are queued + // by windows in Tray Notifications and can be bulk seen and + // dismissed + _this._showNotification(_this.pendingNotifications.shift()); + } + }, + _addNotification: function (notification) { + this.pendingNotifications.push(notification); + if(this.pendingNotifications.length == 1) { + this._showNotification(); + } + }, _pollToDisableHighlight: function (notifyType, error, data) { if (error || !data.body) { console.log("Error: unable to get " + url); @@ -248,8 +293,7 @@ HifiNotifications.prototype = { } _this.menuNotificationCallback(notifyType, true); if (content.total_entries >= maxNotificationItemCount) { - var notification = new HifiNotification(notifyType, content.total_entries); - notification.show(); + _this._addNotification(new HifiNotification(notifyType, content.total_entries)); } else { var notifyData = [] switch (notifyType) { @@ -268,8 +312,7 @@ HifiNotifications.prototype = { } notifyData.forEach(function (notifyDataEntry) { - var notification = new HifiNotification(notifyType, notifyDataEntry); - notification.show(); + _this._addNotification(new HifiNotification(notifyType, notifyDataEntry)); }); } finished(true, token); @@ -376,13 +419,11 @@ HifiNotifications.prototype = { } if (newUsers.size >= maxNotificationItemCount) { - var notification = new HifiNotification(NotificationType.PEOPLE, newUsers.size); - notification.show(); + _this._addNotification(new HifiNotification(NotificationType.PEOPLE, newUsers.size)); return; } newUsers.forEach(function (user) { - var notification = new HifiNotification(NotificationType.PEOPLE, user); - notification.show(); + _this._addNotification(new HifiNotification(NotificationType.PEOPLE, user)); }); }); }); From d851e3994e78df3492a3740124c92bd908e89d8a Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 11:10:51 -0700 Subject: [PATCH 08/33] Search for interface should check peer package Also, retain enabled/disabled state for notifications across restarts --- .../src/modules/hf-notifications.js | 27 +++++++++---------- server-console/src/modules/path-finder.js | 3 +++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index c7f4e24a17..d487462ba5 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -146,7 +146,6 @@ function HifiNotifications(config, menuNotificationCallback) { var _menuNotificationCallback = menuNotificationCallback; notifier.on('click', function (notifierObject, options) { - console.log("click."); StartInterface(options.url); _menuNotificationCallback(options.notificationType, false); }); @@ -185,18 +184,7 @@ HifiNotifications.prototype = { }, MARKETPLACE_NOTIFICATION_POLL_TIME_MS); } else { - if (this.storiesPollTimer) { - clearInterval(this.storiesPollTimer); - } - if (this.peoplePollTimer) { - clearInterval(this.peoplePollTimer); - } - if (this.walletPollTimer) { - clearInterval(this.walletPollTimer); - } - if (this.marketplacePollTimer) { - clearInterval(this.marketplacePollTimer); - } + this.stopPolling(); } }, enabled: function () { @@ -208,7 +196,18 @@ HifiNotifications.prototype = { this.config.set("walletNotifySince", this.walletSince.toISOString()); this.config.set("marketplaceNotifySince", this.marketplaceSince.toISOString()); - this.enable(false); + if (this.storiesPollTimer) { + clearInterval(this.storiesPollTimer); + } + if (this.peoplePollTimer) { + clearInterval(this.peoplePollTimer); + } + if (this.walletPollTimer) { + clearInterval(this.walletPollTimer); + } + if (this.marketplacePollTimer) { + clearInterval(this.marketplacePollTimer); + } }, _showNotification: function () { var _this = this; diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index 5ecd2c74ff..e9e7e48a5f 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -55,6 +55,9 @@ exports.searchPaths = function(name, binaryType, releaseType) { // check beside the app bundle for the binaries paths.push(path.join(path.dirname(appPath), name + extension)); + + // check in the peer bundle for the binaries + paths.push(path.join("..", name + extension)); } } } From 6a3b286a074ec28693a684200eb4e0771b39aea3 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 11:44:00 -0700 Subject: [PATCH 09/33] Fix windows notification popups:w --- .../src/modules/hf-notifications.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index c7f4e24a17..b089e16983 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -10,10 +10,10 @@ const buildInfo = GetBuildInfo(); const osType = os.type(); const notificationIcon = path.join(__dirname, '../../resources/console-notification.png'); -const STORIES_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; -const PEOPLE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; -const WALLET_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; -const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; +const STORIES_NOTIFICATION_POLL_TIME_MS = 120 * 1000; +const PEOPLE_NOTIFICATION_POLL_TIME_MS = 120 * 1000; +const WALLET_NOTIFICATION_POLL_TIME_MS = 600 * 1000; +const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 600 * 1000; const OSX_CLICK_DELAY_TIMEOUT = 500; const METAVERSE_SERVER_URL= process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : 'https://metaverse.highfidelity.com' @@ -122,10 +122,12 @@ HifiNotification.prototype = { timeout: 5 }, function (error, reason, metadata) { - if (osType == 'Darwin') { - setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); - } else { - _finished(); + if(_finished) { + if (osType == 'Darwin') { + setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); + } else { + _finished(); + } } }); } @@ -231,7 +233,7 @@ HifiNotifications.prototype = { // All notifications are sent immediately as they are queued // by windows in Tray Notifications and can be bulk seen and // dismissed - _this._showNotification(_this.pendingNotifications.shift()); + _this.pendingNotifications.shift().show(); } }, _addNotification: function (notification) { From b0b2c6f3ee88372883fc9d80c470b28f8c53ba2b Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 13:31:28 -0700 Subject: [PATCH 10/33] Fixup path finding for interface --- server-console/src/modules/path-finder.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index e9e7e48a5f..3fab8b2808 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -1,5 +1,6 @@ var fs = require('fs'); var path = require('path'); +const { app } = require('electron'); function platformExtension(name) { if (name == "Interface") { @@ -53,12 +54,9 @@ exports.searchPaths = function(name, binaryType, releaseType) { var componentsPath = appPath + "/Contents/MacOS/Components.app/Contents/MacOS/"; paths.push(componentsPath + name + extension); - // check beside the app bundle for the binaries - paths.push(path.join(path.dirname(appPath), name + extension)); - - // check in the peer bundle for the binaries - paths.push(path.join("..", name + extension)); } + // check beside the app bundle for the binaries + paths.push(path.join(path.dirname(app.getAppPath()), "../../..", name + extension)); } } From c3e956932bc652acb0081694a4ad0d2bcf2ca4b9 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 15:22:04 -0700 Subject: [PATCH 11/33] Fix OSX Build --- server-console/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index df51409151..b47a46e596 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -33,12 +33,12 @@ endif () # install the packaged Server Console in our install directory if (APPLE) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} ) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${CLIENT_COMPONENT} ) From 6d0996c254298c78809299cbdc0e9c6c03568729 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 16:52:03 -0700 Subject: [PATCH 12/33] Show "Sandbox" as the server component for server installs, show "Console" for client-only installs --- cmake/macros/GenerateInstallers.cmake | 6 +- cmake/macros/SetPackagingParameters.cmake | 5 +- cmake/templates/NSIS.template.in | 91 ++++++++++++++++------- 3 files changed, 72 insertions(+), 30 deletions(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index 64919172f7..acafd9b6c7 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -20,9 +20,9 @@ macro(GENERATE_INSTALLERS) set(INSTALLER_TYPE "client_only") string(REGEX REPLACE "High Fidelity" "High Fidelity Interface" _DISPLAY_NAME ${BUILD_ORGANIZATION}) elseif (SERVER_ONLY) - set(_PACKAGE_NAME_EXTRA "-Console") + set(_PACKAGE_NAME_EXTRA "-Sandbox") set(INSTALLER_TYPE "server_only") - string(REGEX REPLACE "High Fidelity" "High Fidelity Console" _DISPLAY_NAME ${BUILD_ORGANIZATION}) + string(REGEX REPLACE "High Fidelity" "High Fidelity Sandbox" _DISPLAY_NAME ${BUILD_ORGANIZATION}) else () set(_DISPLAY_NAME ${BUILD_ORGANIZATION}) set(INSTALLER_TYPE "full") @@ -122,7 +122,7 @@ macro(GENERATE_INSTALLERS) endif () if (BUILD_SERVER) - cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Console") + cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Sandbox") endif () include(CPack) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index aaba3bc201..f67f6526cf 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -177,15 +177,18 @@ macro(SET_PACKAGING_PARAMETERS) if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") set(CONSOLE_SHORTCUT_NAME "High Fidelity Console") + set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox") set(APP_USER_MODEL_ID "com.highfidelity.console") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION_NO_SHA}") set(CONSOLE_SHORTCUT_NAME "High Fidelity Console - ${BUILD_VERSION_NO_SHA}") + set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox - ${BUILD_VERSION_NO_SHA}") endif () set(INTERFACE_HF_SHORTCUT_NAME "${INTERFACE_SHORTCUT_NAME}") set(CONSOLE_HF_SHORTCUT_NAME "${CONSOLE_SHORTCUT_NAME}") - + set(SANDBOX_HF_SHORTCUT_NAME "${SANDBOX_SHORTCUT_NAME}") + set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "High Fidelity") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "Server Console") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b7564f45e5..d1a32245bb 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -770,29 +770,54 @@ Function PostInstallOptionsPage ${EndIf} ${EndIf} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - Pop $LaunchConsoleNowCheckbox + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ after install" + Pop $LaunchConsoleNowCheckbox - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} + ${Else} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${EndIf} - IntOp $CurrentOffset $CurrentOffset + 15 - - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - Pop $ConsoleStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox IntOp $CurrentOffset $CurrentOffset + 15 @@ -893,14 +918,26 @@ FunctionEnd Function HandlePostInstallOptions - ; check if the user asked for a desktop shortcut to the console - ${If} $DesktopConsoleState == ${BST_CHECKED} - CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES - ; Set appUserModelId - ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ; check if the user asked for a desktop shortcut to the console + ${If} $DesktopConsoleState == ${BST_CHECKED} + CreateShortCut "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES + ; Set appUserModelId + ApplicationID::Set "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ${EndIf} ${Else} - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ; check if the user asked for a desktop shortcut to the console + ${If} $DesktopConsoleState == ${BST_CHECKED} + CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES + ; Set appUserModelId + ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ${EndIf} ${EndIf} ${If} @CLIENT_COMPONENT_CONDITIONAL@ @@ -1371,10 +1408,12 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\@CONSOLE_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@INTERFACE_HF_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" + Delete "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" ; if it exists, delete the startup shortcut for the current user SetShellVarContext current Delete "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" + Delete "$SMSTARTUP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" SetShellVarContext all @CPACK_NSIS_DELETE_ICONS@ From 308deeaa8d976cbe8c50a3660fa68154c4e60358 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 19:54:42 -0700 Subject: [PATCH 13/33] Refactoring of NSIS setup files with respect to Sandbox vs Console --- cmake/macros/SetPackagingParameters.cmake | 12 +-- cmake/templates/CPackProperties.cmake.in | 2 + cmake/templates/NSIS.template.in | 97 ++++++++++++----------- server-console/CMakeLists.txt | 5 +- 4 files changed, 59 insertions(+), 57 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index f67f6526cf..30fa37ea14 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -176,18 +176,18 @@ macro(SET_PACKAGING_PARAMETERS) # shortcut names if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") - set(CONSOLE_SHORTCUT_NAME "High Fidelity Console") - set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox") + set(CONSOLE_SHORTCUT_NAME "Console") + set(SANDBOX_SHORTCUT_NAME "Sandbox") set(APP_USER_MODEL_ID "com.highfidelity.console") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION_NO_SHA}") - set(CONSOLE_SHORTCUT_NAME "High Fidelity Console - ${BUILD_VERSION_NO_SHA}") - set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox - ${BUILD_VERSION_NO_SHA}") + set(CONSOLE_SHORTCUT_NAME "Console - ${BUILD_VERSION_NO_SHA}") + set(SANDBOX_SHORTCUT_NAME "Sandbox - ${BUILD_VERSION_NO_SHA}") endif () set(INTERFACE_HF_SHORTCUT_NAME "${INTERFACE_SHORTCUT_NAME}") - set(CONSOLE_HF_SHORTCUT_NAME "${CONSOLE_SHORTCUT_NAME}") - set(SANDBOX_HF_SHORTCUT_NAME "${SANDBOX_SHORTCUT_NAME}") + set(CONSOLE_HF_SHORTCUT_NAME "High Fidelity ${CONSOLE_SHORTCUT_NAME}") + set(SANDBOX_HF_SHORTCUT_NAME "High Fidelity ${SANDBOX_SHORTCUT_NAME}") set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "High Fidelity") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "Server Console") diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 0a56181138..a38c3d5361 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -17,6 +17,8 @@ set(CONSOLE_DISPLAY_NAME "Console") set(CONSOLE_INSTALL_SUBDIR "@CONSOLE_INSTALL_DIR@") set(CONSOLE_SHORTCUT_NAME "@CONSOLE_SHORTCUT_NAME@") set(CONSOLE_HF_SHORTCUT_NAME "@CONSOLE_HF_SHORTCUT_NAME@") +set(SANDBOX_SHORTCUT_NAME "@SANDBOX_SHORTCUT_NAME@") +set(SANDBOX_HF_SHORTCUT_NAME "@SANDBOX_HF_SHORTCUT_NAME@") set(CONSOLE_WIN_EXEC_NAME "@CONSOLE_EXEC_NAME@") set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "@PRE_SANDBOX_INTERFACE_SHORTCUT_NAME@") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index d1a32245bb..b67cdf3eea 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -754,13 +754,21 @@ Function PostInstallOptionsPage !insertmacro SetInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED} ${EndIf} + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" + ${Else} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + ${EndIf} + + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 ; set the checkbox state depending on what is present in the registry !insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install" Pop $LaunchClientNowCheckbox - IntOp $CurrentOffset $CurrentOffset + 30 + IntOp $CurrentOffset $CurrentOffset + 15 ; set the checkbox state depending on what is present in the registry !insertmacro SetInstallOption $LaunchClientNowCheckbox @CLIENT_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} @@ -771,52 +779,30 @@ Function PostInstallOptionsPage ${EndIf} ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ after install" - Pop $LaunchConsoleNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} - ${EndIf} - - IntOp $CurrentOffset $CurrentOffset + 15 - - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" - Pop $ConsoleStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${Else} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - Pop $LaunchConsoleNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} - ${EndIf} - - IntOp $CurrentOffset $CurrentOffset + 15 - - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - Pop $ConsoleStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${EndIf} + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + IntOp $CurrentOffset $CurrentOffset + 30 + + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" + ${Else} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + ${EndIf} + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox @@ -921,6 +907,7 @@ Function HandlePostInstallOptions ${If} @SERVER_COMPONENT_CONDITIONAL@ ; check if the user asked for a desktop shortcut to the console ${If} $DesktopConsoleState == ${BST_CHECKED} + Delete "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" CreateShortCut "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES ; Set appUserModelId @@ -931,6 +918,7 @@ Function HandlePostInstallOptions ${Else} ; check if the user asked for a desktop shortcut to the console ${If} $DesktopConsoleState == ${BST_CHECKED} + Delete "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES ; Set appUserModelId @@ -957,6 +945,7 @@ Function HandlePostInstallOptions Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" ; make a startup shortcut in this user's current context + ; use the console shortcut name regardless of server/interface install SetShellVarContext current CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" @@ -1196,11 +1185,21 @@ Section "-Core installation" ${EndIf} - ; handling for server console shortcut - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ - "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; Set appUserModelId - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ; handling for server console shortcut + Delete "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_SHORTCUT_NAME@.lnk" \ + "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ; Set appUserModelId + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + ; handling for interface only console shortcut + Delete "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_SHORTCUT_NAME@.lnk" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ + "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ; Set appUserModelId + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${EndIf} CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@UNINSTALLER_NAME@" @@ -1406,6 +1405,7 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@INTERFACE_SHORTCUT_NAME@.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@CONSOLE_SHORTCUT_NAME@.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\@SANDBOX_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@INTERFACE_HF_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" @@ -1446,6 +1446,7 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@INTERFACE_SHORTCUT_NAME@.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@CONSOLE_SHORTCUT_NAME@.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\@SANDBOX_SHORTCUT_NAME@.lnk" @CPACK_NSIS_DELETE_ICONS_EXTRA@ ;Delete empty start menu parent diretories diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 982f142e64..e8d61e77f7 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -33,13 +33,12 @@ endif () # install the packaged Server Console in our install directory if (APPLE) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} ) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${CLIENT_COMPONENT} ) From 4257a4dfdd6b9f132be8b988926f36e1176f7b44 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 23:12:24 -0700 Subject: [PATCH 14/33] Try fixing binary name for 'running process' detection of interface --- server-console/src/modules/hf-app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index d7c54d3e4d..3c9505abdd 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -50,7 +50,7 @@ exports.getBuildInfo = function() { } const buildInfo = exports.getBuildInfo(); -const interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.releaseType); +const interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType); exports.startInterface = function(url) { var argArray = []; @@ -70,7 +70,7 @@ exports.isInterfaceRunning = function(done) { if (osType == 'Windows_NT') { var pInterface = new Process('interface', 'interface.exe'); } else if (osType == 'Darwin') { - var pInterface = new Process('interface', 'Interface'); + var pInterface = new Process('interface', 'interface'); } return pInterface.isRunning(done); } From dde106e42ef6cf358c59e8e715d51cd3b1fc58cf Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 09:24:00 -0700 Subject: [PATCH 15/33] Make tray icon light map to notification status of various menus --- server-console/src/main.js | 41 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index cfde72e3bc..771c2736dd 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -60,7 +60,10 @@ const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial const buildInfo = GetBuildInfo(); - +const NotificationState = { + UNNOTIFIED: 'unnotified', + NOTIFIED: 'notified' +}; // Update lock filepath const UPDATER_LOCK_FILENAME = ".updating"; @@ -324,12 +327,21 @@ const HifiNotifications = hfNotifications.HifiNotifications; const HifiNotificationType = hfNotifications.NotificationType; var pendingNotifications = {} -function notificationCallback(notificationType, pending = true) { +var notificationState = NotificationState.UNNOTIFIED; + +function setNotificationState(notificationType, pending = true) { pendingNotifications[notificationType] = pending; + notificationState = NotificationState.UNNOTIFIED; + for (var key in pendingNotifications) { + if (pendingNotifications[key]) { + notificationState = NotificationState.NOTIFIED; + break; + } + } updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); } -var trayNotifications = new HifiNotifications(userConfig, notificationCallback); +var trayNotifications = new HifiNotifications(userConfig, setNotificationState); var LogWindow = function(ac, ds) { this.ac = ac; @@ -389,7 +401,7 @@ var labels = { type: 'checkbox', checked: true, click: function () { - trayNotifications.enable(!trayNotifications.enabled(), notificationCallback); + trayNotifications.enable(!trayNotifications.enabled(), setNotificationState); userConfig.save(configPath); updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); } @@ -398,32 +410,28 @@ var labels = { label: 'GoTo', click: function () { StartInterface("hifiapp:GOTO"); - pendingNotifications[HifiNotificationType.GOTO] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.GOTO, false); } }, people: { label: 'People', click: function () { StartInterface("hifiapp:PEOPLE"); - pendingNotifications[HifiNotificationType.PEOPLE] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.PEOPLE, false); } }, wallet: { label: 'Wallet', click: function () { StartInterface("hifiapp:WALLET"); - pendingNotifications[HifiNotificationType.WALLET] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.WALLET, false); } }, marketplace: { label: 'Market', click: function () { StartInterface("hifiapp:MARKET"); - pendingNotifications[HifiNotificationType.MARKETPLACE] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.MARKETPLACE, false); } }, restart: { @@ -557,7 +565,7 @@ function updateLabels(serverState) { function updateTrayMenu(serverState) { if (tray) { var menuArray = buildMenuArray(isShuttingDown ? null : serverState); - tray.setImage(trayIcons[serverState]); + tray.setImage(trayIcons[notificationState]); tray.setContextMenu(Menu.buildFromTemplate(menuArray)); if (isShuttingDown) { tray.setToolTip('High Fidelity - Shutting Down'); @@ -777,9 +785,8 @@ function maybeShowSplash() { const trayIconOS = (osType == "Darwin") ? "osx" : "win"; var trayIcons = {}; -trayIcons[ProcessGroupStates.STARTED] = "console-tray-" + trayIconOS + ".png"; -trayIcons[ProcessGroupStates.STOPPED] = "console-tray-" + trayIconOS + "-stopped.png"; -trayIcons[ProcessGroupStates.STOPPING] = "console-tray-" + trayIconOS + "-stopping.png"; +trayIcons[NotificationState.UNNOTIFIED] = "console-tray-" + trayIconOS + ".png"; +trayIcons[NotificationState.NOTIFIED] = "console-tray-" + trayIconOS + "-stopped.png"; for (var key in trayIcons) { var fullPath = path.join(__dirname, '../resources/' + trayIcons[key]); var img = nativeImage.createFromPath(fullPath); @@ -892,7 +899,7 @@ app.on('ready', function() { } // Create tray icon - tray = new Tray(trayIcons[ProcessGroupStates.STOPPED]); + tray = new Tray(trayIcons[NotificationState.UNNOTIFIED]); tray.setToolTip('High Fidelity'); tray.on('click', function() { From fb3205a847755811bc2b77faa3091c78e35fab0f Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 10:02:03 -0700 Subject: [PATCH 16/33] More OSX Path fixes --- server-console/src/main.js | 2 +- server-console/src/modules/path-finder.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index cfde72e3bc..6abac30344 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -259,7 +259,7 @@ var debug = argv.debug; var binaryType = argv.binaryType; -interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.releaseType); +interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType); dsPath = pathFinder.discoveredPath("domain-server", binaryType, buildInfo.releaseType); acPath = pathFinder.discoveredPath("assignment-client", binaryType, buildInfo.releaseType); diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index 3fab8b2808..a7ccee2631 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -3,7 +3,7 @@ var path = require('path'); const { app } = require('electron'); function platformExtension(name) { - if (name == "Interface") { + if (name == "interface") { if (process.platform == "darwin") { return ".app/Contents/MacOS/" + name } else if (process.platform == "win32") { From 1aaaca4e6c97a6403709327511c0a363d7815fd6 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 10:48:20 -0700 Subject: [PATCH 17/33] Code review changes --- cmake/templates/NSIS.template.in | 2 +- server-console/src/modules/hf-acctinfo.js | 6 ++--- server-console/src/modules/hf-app.js | 12 +++++----- .../src/modules/hf-notifications.js | 22 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b67cdf3eea..3226712519 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -945,7 +945,7 @@ Function HandlePostInstallOptions Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" ; make a startup shortcut in this user's current context - ; use the console shortcut name regardless of server/interface install + ; use the console shortcut name regardless of server/interface install SetShellVarContext current CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" diff --git a/server-console/src/modules/hf-acctinfo.js b/server-console/src/modules/hf-acctinfo.js index 828bc781b8..d20748544f 100644 --- a/server-console/src/modules/hf-acctinfo.js +++ b/server-console/src/modules/hf-acctinfo.js @@ -66,7 +66,7 @@ AccountInfo.prototype = { case VariantTypes.USER_TYPE: //user type var userTypeName = this._parseByteArray().toString('ascii').slice(0,-1); - if (userTypeName == "DataServerAccountInfo") { + if (userTypeName === "DataServerAccountInfo") { return this._parseDataServerAccountInfo(); } else { @@ -77,7 +77,7 @@ AccountInfo.prototype = { }, _parseByteArray: function () { var length = this._parseUInt32(); - if (length == 0xffffffff) { + if (length === 0xffffffff) { return null; } var result = this.rawData.slice(this.parseOffset, this.parseOffset+length); @@ -91,7 +91,7 @@ AccountInfo.prototype = { } // length in bytes; var length = this._parseUInt32(); - if (length == 0xFFFFFFFF) { + if (length === 0xFFFFFFFF) { return null; } diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 3c9505abdd..3db48bd9c4 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -15,9 +15,9 @@ const osType = os.type(); exports.getBuildInfo = function() { var buildInfoPath = null; - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { buildInfoPath = path.join(path.dirname(process.execPath), 'build-info.json'); - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { var contentPath = ".app/Contents/"; var contentEndIndex = __dirname.indexOf(contentPath); @@ -67,9 +67,9 @@ exports.startInterface = function(url) { } exports.isInterfaceRunning = function(done) { - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { var pInterface = new Process('interface', 'interface.exe'); - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { var pInterface = new Process('interface', 'interface'); } return pInterface.isRunning(done); @@ -78,13 +78,13 @@ exports.isInterfaceRunning = function(done) { exports.getRootHifiDataDirectory = function(local) { var organization = buildInfo.organization; - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { if (local) { return path.resolve(osHomeDir(), 'AppData/Local', organization); } else { return path.resolve(osHomeDir(), 'AppData/Roaming', organization); } - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { return path.resolve(osHomeDir(), 'Library/Application Support', organization); } else { return path.resolve(osHomeDir(), '.local/share/', organization); diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 2953075523..0cc4da02c0 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -51,8 +51,8 @@ HifiNotification.prototype = { var app = null; switch (this.type) { case NotificationType.GOTO: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = "You have " + this.data + " event invitation pending." } else { text = "You have " + this.data + " event invitations pending." @@ -67,8 +67,8 @@ HifiNotification.prototype = { break; case NotificationType.PEOPLE: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = this.data + " of your connections is online." } else { text = this.data + " of your connections are online." @@ -83,8 +83,8 @@ HifiNotification.prototype = { break; case NotificationType.WALLET: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = "You have " + this.data + " unread Wallet transaction."; } else { text = "You have " + this.data + " unread Wallet transactions."; @@ -99,8 +99,8 @@ HifiNotification.prototype = { break; case NotificationType.MARKETPLACE: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = this.data + " of your purchased items has an update available."; } else { text = this.data + " of your purchased items have updates available."; @@ -124,7 +124,7 @@ HifiNotification.prototype = { }, function (error, reason, metadata) { if(_finished) { - if (osType == 'Darwin') { + if (osType === 'Darwin') { setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); } else { _finished(); @@ -215,7 +215,7 @@ HifiNotifications.prototype = { _showNotification: function () { var _this = this; - if (osType == 'Darwin') { + if (osType === 'Darwin') { this.pendingNotifications[0].show(function () { // For OSX // don't attempt to show the next notification @@ -238,7 +238,7 @@ HifiNotifications.prototype = { }, _addNotification: function (notification) { this.pendingNotifications.push(notification); - if(this.pendingNotifications.length == 1) { + if(this.pendingNotifications.length === 1) { this._showNotification(); } }, From ee8290f71cd62a34f2ccbb5a713283595fd685c5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 11:10:42 -0700 Subject: [PATCH 18/33] Fix comment --- server-console/src/modules/hf-notifications.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 0cc4da02c0..c69c81aff2 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -218,11 +218,11 @@ HifiNotifications.prototype = { if (osType === 'Darwin') { this.pendingNotifications[0].show(function () { // For OSX - // don't attempt to show the next notification + // Don't attempt to show the next notification // until the current is clicked or times out - // as the OSX Notifier stuff will dismiss - // the previous notification immediately - // when a new one is submitted + // as the OSX Notifier stuff will dismiss the + // previous notification immediately when a + // new one is submitted _this.pendingNotifications.shift(); if(_this.pendingNotifications.length > 0) { _this._showNotification(); From 6393f907b87afadaec07c42b3c7d00cfb19e526b Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 12:33:38 -0700 Subject: [PATCH 19/33] Add temporary code to test for interface paths --- server-console/src/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-console/src/main.js b/server-console/src/main.js index 6abac30344..e92749908c 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -885,6 +885,9 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { + var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); + dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); + if (app.dock) { // hide the dock icon on OS X @@ -902,4 +905,5 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); + }); From 537c0aaf2590f18331a2f3aa84cde34289a3d520 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 13:15:04 -0700 Subject: [PATCH 20/33] Revert "Add temporary code to test for interface paths" This reverts commit 6393f907b87afadaec07c42b3c7d00cfb19e526b. --- server-console/src/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index e92749908c..6abac30344 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -885,9 +885,6 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { - var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); - dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); - if (app.dock) { // hide the dock icon on OS X @@ -905,5 +902,4 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); - }); From 42cdf24f5bbd2dcb0037bed184c3ae6405988df8 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 14:52:21 -0700 Subject: [PATCH 21/33] Move OSX Back to Sandbox.app --- cmake/macros/SetPackagingParameters.cmake | 2 +- server-console/CMakeLists.txt | 2 +- server-console/packager.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 30fa37ea14..dce419a0e4 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -142,7 +142,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(CONSOLE_EXEC_NAME "Console.app") + set(CONSOLE_EXEC_NAME "Sandbox.app") set(CONSOLE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME}") set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index e8d61e77f7..420230c33c 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -23,7 +23,7 @@ add_dependencies(${TARGET_NAME} assignment-client domain-server interface) # set the packaged console folder depending on platform, so we can copy it if (APPLE) - set(PACKAGED_CONSOLE_FOLDER "Console-darwin-x64/${CONSOLE_EXEC_NAME}") + set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") elseif (WIN32) set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64") elseif (UNIX) diff --git a/server-console/packager.js b/server-console/packager.js index 5e4fbfe568..31655fe565 100644 --- a/server-console/packager.js +++ b/server-console/packager.js @@ -28,12 +28,13 @@ var options = { const EXEC_NAME = "server-console"; const SHORT_NAME = "Console"; +const OSX_SHORT_NAME = "Sandbox"; const FULL_NAME = "High Fidelity Console"; // setup per OS options if (osType == "Darwin") { options["app-bundle-id"] = "com.highfidelity.server-console" + (argv.production ? "" : "-dev") - options["name"] = SHORT_NAME + options["name"] = OSX_SHORT_NAME } else if (osType == "Windows_NT") { options["version-string"] = { CompanyName: "High Fidelity, Inc.", From edd354d109551b84e3aef190b6bd75ec8e8e4762 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 14:52:50 -0700 Subject: [PATCH 22/33] "Add temporary code to test for interface paths"" --- server-console/src/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-console/src/main.js b/server-console/src/main.js index d1b3dd2dd3..f0d6ae13ae 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -892,6 +892,9 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { + var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); + dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); + if (app.dock) { // hide the dock icon on OS X @@ -909,4 +912,5 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); + }); From b6877bca5787efc79bc21d29095e42dbdd86592a Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 16:26:44 -0700 Subject: [PATCH 23/33] Revert ""Add temporary code to test for interface paths""" This reverts commit edd354d109551b84e3aef190b6bd75ec8e8e4762. --- server-console/src/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index f0d6ae13ae..d1b3dd2dd3 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -892,9 +892,6 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { - var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); - dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); - if (app.dock) { // hide the dock icon on OS X @@ -912,5 +909,4 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); - }); From 113ad3d9170d2e1f1b7c9a6b8c5e03a04cd9ccbc Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Sun, 30 Sep 2018 13:11:15 -0700 Subject: [PATCH 24/33] 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. --- cmake/macros/SetPackagingParameters.cmake | 1 + cmake/modules/MacOSXBundleInfo.plist.in | 8 ++++ cmake/templates/CPackProperties.cmake.in | 1 + server-console/src/main.js | 16 +++++++- server-console/src/modules/hf-app.js | 37 ++++++++++++++----- .../src/modules/hf-notifications.js | 4 +- 6 files changed, 55 insertions(+), 12 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index dce419a0e4..297382b4e5 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -37,6 +37,7 @@ macro(SET_PACKAGING_PARAMETERS) set(BUILD_VERSION ${RELEASE_NUMBER}) set(BUILD_ORGANIZATION "High Fidelity") set(HIGH_FIDELITY_PROTOCOL "hifi") + set(HIGH_FIDELITY_APP_PROTOCOL "hifiapp") set(INTERFACE_BUNDLE_NAME "Interface") set(INTERFACE_ICON_PREFIX "interface") diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in index a06fac092f..b9558cf361 100644 --- a/cmake/modules/MacOSXBundleInfo.plist.in +++ b/cmake/modules/MacOSXBundleInfo.plist.in @@ -42,6 +42,14 @@ hifi + + CFBundleURLName + ${MACOSX_BUNDLE_BUNDLE_NAME} APP URL + CFBundleURLSchemes + + hifiapp + + NSHighResolutionCapable diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index a38c3d5361..cb6474b010 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -27,6 +27,7 @@ set(DS_EXEC_NAME "@DS_EXEC_NAME@") set(AC_DISPLAY_NAME "Assignment Client") set(AC_EXEC_NAME "@AC_EXEC_NAME@") set(HIGH_FIDELITY_PROTOCOL "@HIGH_FIDELITY_PROTOCOL@") +set(HIGH_FIDELITY_APP_PROTOCOL "@HIGH_FIDELITY_APP_PROTOCOL@") set(PRODUCTION_BUILD "@PRODUCTION_BUILD@") set(PR_BUILD "@PR_BUILD@") set(BUILD_ORGANIZATION "@BUILD_ORGANIZATION@") diff --git a/server-console/src/main.js b/server-console/src/main.js index d1b3dd2dd3..04e77315bc 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -108,7 +108,16 @@ const ipcMain = electron.ipcMain; function isInterfaceInstalled() { - return interfacePath; + 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; + } } function isServerInstalled() { @@ -377,7 +386,7 @@ LogWindow.prototype = { }; function visitSandboxClicked() { - if (interfacePath) { + if (isInterfaceInstalled()) { StartInterface('hifi://localhost'); } else { // 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); }); + if (isInterfaceInstalled()) { + trayNotifications.startPolling(); + } updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 3db48bd9c4..af6c38cdb3 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -7,6 +7,7 @@ const path = require('path'); const argv = require('yargs').argv; const hfprocess = require('./hf-process'); const osHomeDir = require('os-homedir'); +const childProcess = require('child_process'); const Process = hfprocess.Process; const binaryType = argv.binaryType; @@ -53,17 +54,35 @@ const buildInfo = exports.getBuildInfo(); const interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType); exports.startInterface = function(url) { - var argArray = []; - // check if we have a url parameter to include - if (url) { - argArray = ["--url", 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 = []; + + // check if we have a url parameter to include + if (url) { + argArray = ["--url", url]; + } + console.log("Starting with " + url); + // create a new Interface instance - Interface makes sure only one is running at a time + var pInterface = new Process('Interface', interfacePath, argArray); + pInterface.detached = true; + pInterface.start(); } - console.log("Starting with " + url); - // create a new Interface instance - Interface makes sure only one is running at a time - var pInterface = new Process('Interface', interfacePath, argArray); - pInterface.detached = true; - pInterface.start(); } exports.isInterfaceRunning = function(done) { diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index c69c81aff2..13c5a6d8fa 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -143,7 +143,6 @@ function HifiNotifications(config, menuNotificationCallback) { 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.enable(this.enabled()); this.pendingNotifications = []; @@ -193,6 +192,9 @@ HifiNotifications.prototype = { enabled: function () { return !this.config.get("disableTrayNotifications", false); }, + startPolling: function () { + this.enable(this.enabled()); + }, stopPolling: function () { this.config.set("storiesNotifySince", this.storiesSince.toISOString()); this.config.set("peopleNotifySince", this.peopleSince.toISOString()); From f8409b39770a496fff348684eead2cff29db18b5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 11:29:55 -0700 Subject: [PATCH 25/33] dd server-console to client build --- CMakeLists.txt | 3 ++- server-console/CMakeLists.txt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a01b18a57..a887a35fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,7 @@ if (USE_GLES AND (NOT ANDROID)) set(DISABLE_QML_OPTION ON) endif() + option(BUILD_CLIENT "Build client components" ${BUILD_CLIENT_OPTION}) option(BUILD_SERVER "Build server components" ${BUILD_SERVER_OPTION}) option(BUILD_TESTS "Build tests" ${BUILD_TESTS_OPTION}) @@ -162,7 +163,6 @@ if (BUILD_SERVER) set_target_properties(domain-server PROPERTIES FOLDER "Apps") add_subdirectory(ice-server) set_target_properties(ice-server PROPERTIES FOLDER "Apps") - add_subdirectory(server-console) endif() if (BUILD_CLIENT) @@ -174,6 +174,7 @@ endif() if (BUILD_CLIENT OR BUILD_SERVER) add_subdirectory(plugins) + add_subdirectory(server-console) endif() # BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index e8d61e77f7..df51409151 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -49,7 +49,6 @@ elseif (WIN32) DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} ) install( DIRECTORY "${CONSOLE_DESTINATION}/" From fbaac4254e9002d5233ae3428a800612bc6a02c1 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 12:45:56 -0700 Subject: [PATCH 26/33] Set build targets properly for client-only install of console --- server-console/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index df51409151..fc6238bd9a 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -19,7 +19,13 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Server Console") set_target_properties(${TARGET_NAME}-npm-install PROPERTIES FOLDER "hidden/Server Console") # add a dependency from the package target to the server components -add_dependencies(${TARGET_NAME} assignment-client domain-server interface) +if (BUILD_CLIENT) + add_dependencies(${TARGET_NAME} interface) +endif() + +if (BUILD_SERVER) + add_dependencies(${TARGET_NAME} assignment-client domain-server interface) +endif() # set the packaged console folder depending on platform, so we can copy it if (APPLE) From 010e2091fad99a9a547b917231247e63924b3ad5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 14:35:47 -0700 Subject: [PATCH 27/33] Fixup CPack install items for OSX to hopefully properly handle OSX .app directories --- server-console/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 1b6a644e7c..a30027989e 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -39,12 +39,14 @@ endif () # install the packaged Server Console in our install directory if (APPLE) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + USE_SOURCE_PERMISSIONS DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} ) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + USE_SOURCE_PERMISSIONS DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${CLIENT_COMPONENT} ) From 34a7aff2efc33d78d3647341574f70b5779092c8 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 20:12:00 -0700 Subject: [PATCH 28/33] Differentiate name of Console.app/Sandbox.app depending on client_only build --- cmake/macros/SetPackagingParameters.cmake | 7 ++++++- server-console/CMakeLists.txt | 16 ++++++++++++---- server-console/packager.js | 7 +++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 297382b4e5..3bf984534b 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -143,7 +143,12 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(CONSOLE_EXEC_NAME "Sandbox.app") + if (CLIENT_ONLY) + set(CONSOLE_EXEC_NAME "Console.app") + else () + set(CONSOLE_EXEC_NAME "Sandbox.app") + endif() + set(CONSOLE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME}") set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index a30027989e..150561ffbb 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -4,13 +4,17 @@ if (PRODUCTION_BUILD) set(PRODUCTION_OPTION "--production") endif() +if (CLIENT_ONLY) + set(CLIENT_ONLY_OPTION "--client_only") +endif() + # add a target that will package the console add_custom_target(${TARGET_NAME}-npm-install COMMAND npm install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(${TARGET_NAME} - COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${PRODUCTION_OPTION} + COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${PRODUCTION_OPTION} ${CLIENT_ONLY_OPTION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TARGET_NAME}-npm-install ) @@ -29,7 +33,11 @@ endif() # set the packaged console folder depending on platform, so we can copy it if (APPLE) - set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") + if (CLIENT_ONLY) + set(PACKAGED_CONSOLE_FOLDER "Console-darwin-x64/${CONSOLE_EXEC_NAME}") + else () + set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") + endif() elseif (WIN32) set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64") elseif (UNIX) @@ -45,9 +53,9 @@ if (APPLE) COMPONENT ${SERVER_COMPONENT} ) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}/" USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR} + DESTINATION ${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME} COMPONENT ${CLIENT_COMPONENT} ) elseif (WIN32) diff --git a/server-console/packager.js b/server-console/packager.js index 31655fe565..00866ee1be 100644 --- a/server-console/packager.js +++ b/server-console/packager.js @@ -27,14 +27,13 @@ var options = { } const EXEC_NAME = "server-console"; -const SHORT_NAME = "Console"; -const OSX_SHORT_NAME = "Sandbox"; -const FULL_NAME = "High Fidelity Console"; +var SHORT_NAME = argv.client_only ? "Console" : "Sandbox"; +var FULL_NAME = argv.client_only ? "High Fidelity Console" : "High Fidelity Sandbox"; // setup per OS options if (osType == "Darwin") { options["app-bundle-id"] = "com.highfidelity.server-console" + (argv.production ? "" : "-dev") - options["name"] = OSX_SHORT_NAME + options["name"] = SHORT_NAME } else if (osType == "Windows_NT") { options["version-string"] = { CompanyName: "High Fidelity, Inc.", From 95ef46d77c35e606a7bd952633e16313833b95d1 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Tue, 2 Oct 2018 10:00:42 -0700 Subject: [PATCH 29/33] fix some coding standards issues --- server-console/src/main.js | 8 ++++---- server-console/src/modules/hf-notifications.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 04e77315bc..c26938745b 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -107,7 +107,7 @@ userConfig.load(configPath); 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 @@ -120,7 +120,7 @@ function isInterfaceInstalled() { } } -function isServerInstalled() { +function isServerInstalled () { return dsPath && acPath; } @@ -338,7 +338,7 @@ const HifiNotificationType = hfNotifications.NotificationType; var pendingNotifications = {} var notificationState = NotificationState.UNNOTIFIED; -function setNotificationState(notificationType, pending = true) { +function setNotificationState (notificationType, pending = true) { pendingNotifications[notificationType] = pending; notificationState = NotificationState.UNNOTIFIED; for (var key in pendingNotifications) { @@ -526,7 +526,7 @@ function buildMenuArray(serverState) { menuArray.push(labels.share); menuArray.push(separator); if (isInterfaceInstalled()) { - if(trayNotifications.enabled()) { + if (trayNotifications.enabled()) { menuArray.push(labels.goto); menuArray.push(labels.people); menuArray.push(labels.wallet); diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 13c5a6d8fa..f3b6912c08 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -123,7 +123,7 @@ HifiNotification.prototype = { timeout: 5 }, function (error, reason, metadata) { - if(_finished) { + if (_finished) { if (osType === 'Darwin') { setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); } else { From 397fe2a5344460f9de8c82866a05d89d008b1dbf Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 3 Oct 2018 13:53:46 -0700 Subject: [PATCH 30/33] Code Review Fixes --- server-console/src/modules/hf-notifications.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index f3b6912c08..464d268c5e 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -44,7 +44,6 @@ function HifiNotification(notificationType, notificationData, menuNotificationCa HifiNotification.prototype = { show: function (finished) { - var _finished = finished; var text = ""; var message = ""; var url = null; @@ -123,11 +122,11 @@ HifiNotification.prototype = { timeout: 5 }, function (error, reason, metadata) { - if (_finished) { + if (finished) { if (osType === 'Darwin') { - setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); + setTimeout(finished, OSX_CLICK_DELAY_TIMEOUT); } else { - _finished(); + finished(); } } }); @@ -240,7 +239,7 @@ HifiNotifications.prototype = { }, _addNotification: function (notification) { this.pendingNotifications.push(notification); - if(this.pendingNotifications.length === 1) { + if (this.pendingNotifications.length === 1) { this._showNotification(); } }, From ee3fd8107050088598512f98f2217578d01e79e7 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 4 Oct 2018 11:33:01 -0700 Subject: [PATCH 31/33] Code review fixes from birarda --- cmake/macros/SetPackagingParameters.cmake | 2 +- cmake/templates/NSIS.template.in | 3 ++- server-console/CMakeLists.txt | 8 +------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 3bf984534b..1b7243d4f2 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -18,7 +18,7 @@ macro(SET_PACKAGING_PARAMETERS) set(BUILD_GLOBAL_SERVICES "DEVELOPMENT") set(USE_STABLE_GLOBAL_SERVICES 0) set(BUILD_NUMBER 0) - set(APP_USER_MODEL_ID "com.highfidelity.console") + set(APP_USER_MODEL_ID "com.highfidelity.console-dev") set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV") set_from_env(RELEASE_NUMBER RELEASE_NUMBER "") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 3226712519..b3c3145672 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -412,7 +412,7 @@ Section "-Previous Install Cleanup" Delete "$INSTDIR\@AC_EXEC_NAME@" ; delete interface so it's not there for server-only installs - Delete "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" + Delete "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" SectionEnd @CPACK_NSIS_INSTALLATION_TYPES@ @@ -1005,6 +1005,7 @@ Function HandlePostInstallOptions ${EndIf} ${If} $LaunchConsoleNowState == ${BST_CHECKED} + ${AndIf} @SERVER_COMPONENT_CONDITIONAL@ !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES ; both launches use the explorer trick in case the user has elevated permissions for the installer diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 150561ffbb..6e02c2df00 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -28,7 +28,7 @@ if (BUILD_CLIENT) endif() if (BUILD_SERVER) - add_dependencies(${TARGET_NAME} assignment-client domain-server interface) + add_dependencies(${TARGET_NAME} assignment-client domain-server) endif() # set the packaged console folder depending on platform, so we can copy it @@ -64,12 +64,6 @@ elseif (WIN32) install( DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} - COMPONENT ${SERVER_COMPONENT} - ) - install( - DIRECTORY "${CONSOLE_DESTINATION}/" - DESTINATION ${CONSOLE_INSTALL_DIR} - COMPONENT ${CLIENT_COMPONENT} ) # sign the copied server console executable after install From f74d9ada209205fb15def68874be2197c97fabad Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 4 Oct 2018 12:38:34 -0700 Subject: [PATCH 32/33] Code review fix --- server-console/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 6e02c2df00..0c35567d28 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -49,14 +49,7 @@ if (APPLE) install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR} - COMPONENT ${SERVER_COMPONENT} - ) - install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}/" - USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME} - COMPONENT ${CLIENT_COMPONENT} + DESTINATION ${CONSOLE_INSTALL_DIR} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") From 265bafecba22f5d5959b2f636b779a2af37e5911 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 4 Oct 2018 15:36:31 -0700 Subject: [PATCH 33/33] More CR Fixes --- cmake/templates/NSIS.template.in | 38 ++++++++++++++++++-------------- server-console/CMakeLists.txt | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b3c3145672..fd48a792dc 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1004,32 +1004,38 @@ Function HandlePostInstallOptions ${EndIf} ${EndIf} - ${If} $LaunchConsoleNowState == ${BST_CHECKED} - ${AndIf} @SERVER_COMPONENT_CONDITIONAL@ - !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES - - ; both launches use the explorer trick in case the user has elevated permissions for the installer - ${If} $LaunchClientNowState == ${BST_CHECKED} + ${If} $LaunchClientNowState == ${BST_CHECKED} !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ YES + ${Else} + !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO + ${EndIf} + + ${If} $LaunchConsoleNowState == ${BST_CHECKED} + !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES + ${Else} + !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ NO + ${EndIf} + + ${If} $LaunchConsoleNowState == ${BST_CHECKED} + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${AndIf} $LaunchClientNowState == ${BST_CHECKED} + ${AndIf} @CLIENT_COMPONENT_CONDITIONAL@ + ; both launches use the explorer trick in case the user has elevated permissions for the installer ; create shortcut with ARGUMENTS CreateShortCut "$TEMP\ConsoleShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface" Exec '"$WINDIR\explorer.exe" "$TEMP\ConsoleShortcut.lnk"' ${Else} - !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO Exec '"$WINDIR\explorer.exe" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@"' ${EndIf} + ${EndIf} - ${ElseIf} @CLIENT_COMPONENT_CONDITIONAL@ - !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ NO - - ; launch uses the explorer trick in case the user has elevated permissions for the installer - ${If} $LaunchClientNowState == ${BST_CHECKED} - !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ YES + ${If} $LaunchClientNowState == ${BST_CHECKED} + ${AndIf} @CLIENT_COMPONENT_CONDITIONAL@ + ${Unless} $LaunchConsoleNowState == ${BST_CHECKED} + ${OrUnless} @SERVER_COMPONENT_CONDITIONAL@ + ; launch uses the explorer trick in case the user has elevated permissions for the installer Exec '"$WINDIR\explorer.exe" "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@"' - ${Else} - !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO ${EndIf} - ${EndIf} FunctionEnd diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 0c35567d28..49742cacf0 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -49,7 +49,7 @@ if (APPLE) install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR} + DESTINATION ${CONSOLE_INSTALL_DIR} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}")