From 0f2273ea436262ea412269a3a0f25892694fc09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Wed, 23 Mar 2022 11:07:22 +0200 Subject: [PATCH] Link to manual word plugin installation instructions on install failure. Closes #2444 --- chrome/locale/en-US/zotero/zotero.properties | 1 + resource/word-processor-plugin-installer.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 533fdd6352..66c18073b8 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -722,6 +722,7 @@ zotero.preferences.export.quickCopy.citationInstructions = For citation styles, zotero.preferences.wordProcessors.installationSuccess = Installation was successful. zotero.preferences.wordProcessors.installationError = Installation could not be completed because an error occurred. Please ensure that %1$S is closed, and then restart %2$S. +zotero.preferences.wordProcessors.manualInstallation.button = Manual Installation zotero.preferences.wordProcessors.installed = The %S add-in is currently installed. zotero.preferences.wordProcessors.notInstalled = The %S add-in is not currently installed. zotero.preferences.wordProcessors.install = Install %S Add-in diff --git a/resource/word-processor-plugin-installer.js b/resource/word-processor-plugin-installer.js index d39b221636..c0c90a86d1 100644 --- a/resource/word-processor-plugin-installer.js +++ b/resource/word-processor-plugin-installer.js @@ -167,10 +167,18 @@ ZoteroPluginInstaller.prototype = { this._errorDisplayed = true; var addon = this._addon; setTimeout(function() { - Components.classes["@mozilla.org/embedcomp/prompt-service;1"] - .getService(Components.interfaces.nsIPromptService) - .alert(null, addon.EXTENSION_STRING, - (error ? error : Zotero.getString("zotero.preferences.wordProcessors.installationError", [addon.APP, Zotero.appName]))); + var ps = Services.prompt; + var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_OK + + (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_IS_STRING); + var result = ps.confirmEx(null, + addon.EXTENSION_STRING, + (error ? error : Zotero.getString("zotero.preferences.wordProcessors.installationError", [addon.APP, Zotero.appName])), + buttonFlags, null, + Zotero.getString('zotero.preferences.wordProcessors.manualInstallation.button'), + null, null, {}); + if (result == 1) { + Zotero.launchURL("https://www.zotero.org/support/word_processor_plugin_manual_installation"); + } }, 0); },