From f0570557b24b67aba4906da02104e76ed60fcefe Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 24 May 2018 10:56:17 -0700 Subject: [PATCH 1/7] Assign a Win 'appUserModelId' and use it for toaster popups (notifications) --- INSTALL.md | 1 + cmake/templates/NSIS.template.in | 2 ++ server-console/src/main.js | 1 + 3 files changed, 4 insertions(+) diff --git a/INSTALL.md b/INSTALL.md index 90e8712b19..00be5f2f8f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -21,6 +21,7 @@ To produce an executable installer on Windows, the following are required: - [NSISpcre Plug-in for Nullsoft](http://nsis.sourceforge.net/NSISpcre_plug-in) - 1.0 - [nsisSlideshow Plug-in for Nullsoft](http://nsis.sourceforge.net/NsisSlideshow_plug-in) - 1.7 - [Nsisunz plug-in for Nullsoft](http://nsis.sourceforge.net/Nsisunz_plug-in) +- [ApplicationID plug-in for Nullsoft](http://nsis.sourceforge.net/ApplicationID_plug-in) - 1.0 Run the `package` target to create an executable installer using the Nullsoft Scriptable Install System. diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index fc9b9ab03d..ff80c21588 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1173,6 +1173,8 @@ Section "-Core installation" !insertmacro MUI_STARTMENU_WRITE_END + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface" + @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ ; see if we have a campaign that we might need to grab special content for diff --git a/server-console/src/main.js b/server-console/src/main.js index b08db6222f..ab35529b48 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -878,6 +878,7 @@ function onContentLoaded() { title: 'An update is available!', message: 'High Fidelity version ' + latestVersion + ' is available', wait: true, + appID: 'com.highfidelity.interface', url: url }); hasShownUpdateNotification = true; From 65bb4c218ebfcba766391308f36acc3b01a8d8f1 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 25 May 2018 11:02:49 -0700 Subject: [PATCH 2/7] Distinguish appIDs for production & nonproduction --- cmake/templates/NSIS.template.in | 6 +++++- server-console/src/main.js | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index ff80c21588..8c7479af48 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1173,7 +1173,11 @@ Section "-Core installation" !insertmacro MUI_STARTMENU_WRITE_END - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface" + !if @PRODUCTION_BUILD@ == 1 + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface" + !else + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface-dev" + !endif @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ diff --git a/server-console/src/main.js b/server-console/src/main.js index ab35529b48..498be966ed 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -867,6 +867,7 @@ function onContentLoaded() { } catch (e) { } + var appUserModelId = 'com.highfidelity.interface'; // For Windows jump list, etc. if (currentVersion !== null) { const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30; var hasShownUpdateNotification = false; @@ -878,7 +879,7 @@ function onContentLoaded() { title: 'An update is available!', message: 'High Fidelity version ' + latestVersion + ' is available', wait: true, - appID: 'com.highfidelity.interface', + appID: appUserModelId, url: url }); hasShownUpdateNotification = true; From ef4d09c5e2452bd1378205350052f0eb6622ea37 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 30 May 2018 10:21:07 -0700 Subject: [PATCH 3/7] Add app user-model IDs to Sandbox shortcut and use in server-console --- cmake/templates/NSIS.template.in | 6 ++++++ server-console/src/main.js | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 8c7479af48..4151a16e15 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1174,8 +1174,14 @@ Section "-Core installation" !insertmacro MUI_STARTMENU_WRITE_END !if @PRODUCTION_BUILD@ == 1 + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "com.highfidelity.sandbox" + ${EndIf} ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface" !else + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "com.highfidelity.sandbox-dev" + ${EndIf} ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface-dev" !endif diff --git a/server-console/src/main.js b/server-console/src/main.js index 498be966ed..b803c5e882 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -44,6 +44,8 @@ const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/; const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial-RC40.tar.gz"; +const APP_USER_MODEL_ID = 'com.highfidelity.sandbox'; // For Windows jump list, etc. + function getBuildInfo() { var buildInfoPath = null; @@ -867,7 +869,6 @@ function onContentLoaded() { } catch (e) { } - var appUserModelId = 'com.highfidelity.interface'; // For Windows jump list, etc. if (currentVersion !== null) { const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30; var hasShownUpdateNotification = false; @@ -879,7 +880,7 @@ function onContentLoaded() { title: 'An update is available!', message: 'High Fidelity version ' + latestVersion + ' is available', wait: true, - appID: appUserModelId, + appID: APP_USER_MODEL_ID, url: url }); hasShownUpdateNotification = true; From 5e17ef5e21de40dfdcf0f3149416a7afccda01ba Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 30 May 2018 14:25:05 -0700 Subject: [PATCH 4/7] Also call electron's setAppUserModelId() --- server-console/src/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server-console/src/main.js b/server-console/src/main.js index b803c5e882..cb58c3eedf 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -235,6 +235,8 @@ const configPath = path.join(getApplicationDataDirectory(), 'config.json'); var userConfig = new Config(); userConfig.load(configPath); +app.setAppUserModelId(APP_USER_MODEL_ID); + // print out uncaught exceptions in the console process.on('uncaughtException', function(err) { log.error(err); From 97613f1f07137af7cef8109817d8a51dee9f4933 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 1 Jun 2018 14:13:52 -0700 Subject: [PATCH 5/7] Only set app ID on sandbox link Also pass down the app ID from CMake files to installer and server-console. --- cmake/macros/SetPackagingParameters.cmake | 2 ++ cmake/templates/CPackProperties.cmake.in | 1 + cmake/templates/NSIS.template.in | 14 ++------------ cmake/templates/console-build-info.json.in | 3 ++- server-console/src/main.js | 8 +++----- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 36e5a065df..29947c793c 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -17,6 +17,7 @@ macro(SET_PACKAGING_PARAMETERS) set(DEV_BUILD 0) set(BUILD_GLOBAL_SERVICES "DEVELOPMENT") set(USE_STABLE_GLOBAL_SERVICES 0) + set(APP_USER_MODEL_ID "com.highfidelity.sandbox-dev") set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV") set_from_env(RELEASE_NUMBER RELEASE_NUMBER "") @@ -126,6 +127,7 @@ macro(SET_PACKAGING_PARAMETERS) if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") set(CONSOLE_SHORTCUT_NAME "Sandbox") + set(APP_USER_MODEL_ID "com.highfidelity.sandbox") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION}") set(CONSOLE_SHORTCUT_NAME "Sandbox - ${BUILD_VERSION}") diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 80d86ac030..68fa098508 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -49,3 +49,4 @@ set(ADD_REMOVE_ICON_PATH "@ADD_REMOVE_ICON_PATH@") set(SERVER_COMPONENT_CONDITIONAL "@SERVER_COMPONENT_CONDITIONAL@") set(CLIENT_COMPONENT_CONDITIONAL "@CLIENT_COMPONENT_CONDITIONAL@") set(INSTALLER_TYPE "@INSTALLER_TYPE@") +set(APP_USER_MODEL_ID "@APP_USER_MODEL_ID@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 4151a16e15..21043c7d73 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1162,6 +1162,8 @@ Section "-Core installation" ${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} CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@UNINSTALLER_NAME@" @@ -1173,18 +1175,6 @@ Section "-Core installation" !insertmacro MUI_STARTMENU_WRITE_END - !if @PRODUCTION_BUILD@ == 1 - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "com.highfidelity.sandbox" - ${EndIf} - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface" - !else - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "com.highfidelity.sandbox-dev" - ${EndIf} - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@INTERFACE_SHORTCUT_NAME@.lnk" "com.highfidelity.interface-dev" - !endif - @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ ; see if we have a campaign that we might need to grab special content for diff --git a/cmake/templates/console-build-info.json.in b/cmake/templates/console-build-info.json.in index c1ef010e08..49f2ea2fda 100644 --- a/cmake/templates/console-build-info.json.in +++ b/cmake/templates/console-build-info.json.in @@ -1,4 +1,5 @@ { "releaseType": "@RELEASE_TYPE@", - "buildIdentifier": "@BUILD_VERSION@" + "buildIdentifier": "@BUILD_VERSION@", + "appUserModelId": "@APP_USER_MODEL_ID@" } diff --git a/server-console/src/main.js b/server-console/src/main.js index cb58c3eedf..df517aaa5f 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -44,8 +44,6 @@ const LOG_FILE_REGEX = /(domain-server|ac-monitor|ac)-.*-std(out|err).txt/; const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial-RC40.tar.gz"; -const APP_USER_MODEL_ID = 'com.highfidelity.sandbox'; // For Windows jump list, etc. - function getBuildInfo() { var buildInfoPath = null; @@ -62,7 +60,7 @@ function getBuildInfo() { } } - const DEFAULT_BUILD_INFO = { releaseType: "", buildIdentifier: "dev" }; + const DEFAULT_BUILD_INFO = { releaseType: "", buildIdentifier: "dev", appUserModelId: "com.highfidelity.sandbox-dev"}; var buildInfo = DEFAULT_BUILD_INFO; if (buildInfoPath) { @@ -235,7 +233,7 @@ const configPath = path.join(getApplicationDataDirectory(), 'config.json'); var userConfig = new Config(); userConfig.load(configPath); -app.setAppUserModelId(APP_USER_MODEL_ID); +app.setAppUserModelId(buildInfo.appUserModelId); // print out uncaught exceptions in the console process.on('uncaughtException', function(err) { @@ -882,7 +880,7 @@ function onContentLoaded() { title: 'An update is available!', message: 'High Fidelity version ' + latestVersion + ' is available', wait: true, - appID: APP_USER_MODEL_ID, + appID: buildInfo.appUserModelId, url: url }); hasShownUpdateNotification = true; From cda0c5a121656a7b0b463edd82ab020835394c1b Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 13 Jun 2018 11:33:19 -0700 Subject: [PATCH 6/7] Fix main.js - incorrect merge by git --- server-console/src/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index a83a2f3256..7a9baab596 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -60,7 +60,14 @@ function getBuildInfo() { } } - const DEFAULT_BUILD_INFO = { releaseType: "", buildIdentifier: "dev", appUserModelId: "com.highfidelity.sandbox-dev"}; + const DEFAULT_BUILD_INFO = { + releaseType: "", + buildIdentifier: "dev", + buildNumber: "0", + stableBuild: "0", + organization: "High Fidelity - dev", + appUserModelId: "com.highfidelity.sandbox-dev" + }; var buildInfo = DEFAULT_BUILD_INFO; if (buildInfoPath) { From ce7a10c143821121b182bd6588335b7c833a209f Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 13 Jun 2018 15:30:35 -0700 Subject: [PATCH 7/7] Add AppUserModelID to desktop shortcut for Sandbox also --- cmake/templates/NSIS.template.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 21043c7d73..64e3fbe889 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -905,6 +905,8 @@ Function HandlePostInstallOptions ${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}