diff --git a/chrome/content/zotero/preferences/preferences_search.js b/chrome/content/zotero/preferences/preferences_search.js index 6dfe000215..51930fd72e 100644 --- a/chrome/content/zotero/preferences/preferences_search.js +++ b/chrome/content/zotero/preferences/preferences_search.js @@ -187,13 +187,17 @@ Zotero_Preferences.Search = { var converterVersionAvailable = (!converterIsRegistered || Zotero.Fulltext.pdfConverterVersion == 'UNKNOWN' || latestVersion > Zotero.Fulltext.pdfConverterVersion - || (latestVersion != '3.02' && Zotero.Fulltext.pdfConverterVersion == '3.02') - || (latestVersion != '3.02' && latestVersion != '3.04' && Zotero.Fulltext.pdfConverterVersion == '3.04')); + || (!latestVersion.startsWith('3.02') + && Zotero.Fulltext.pdfConverterVersion.startsWith('3.02')) + || (!latestVersion.startsWith('3.02') && latestVersion != '3.04' + && Zotero.Fulltext.pdfConverterVersion == '3.04')); var infoVersionAvailable = (!infoIsRegistered || Zotero.Fulltext.pdfInfoVersion == 'UNKNOWN' || latestVersion > Zotero.Fulltext.pdfInfoVersion - || (latestVersion != '3.02' && Zotero.Fulltext.pdfInfoVersion == '3.02') - || (latestVersion != '3.02' && latestVersion != '3.04' && Zotero.Fulltext.pdfInfoVersion == '3.04')); + || (!latestVersion.startsWith('3.02') + && Zotero.Fulltext.pdfInfoVersion.startsWith('3.02')) + || (!latestVersion.startsWith('3.02') && latestVersion != '3.04' + && Zotero.Fulltext.pdfInfoVersion == '3.04')); var bothAvailable = converterVersionAvailable && infoVersionAvailable; // Up to date -- disable update button diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index a58247b8ca..fc7976ecf9 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -339,7 +339,7 @@ Zotero.Fulltext = new function(){ case 'info': // Modified 3.02 version doesn't use redirection script - if (version == '3.02') break; + if (version.startsWith('3.02')) break; var script = Zotero.getZoteroDirectory(); script.append('pdfinfo.' + _getScriptExtension()) @@ -600,7 +600,7 @@ Zotero.Fulltext = new function(){ cacheFile.append(this.pdfConverterCacheFile); // Modified 3.02 version that can output a text file directly - if (_pdfInfo && _pdfInfoVersion == '3.02') { + if (_pdfInfo && _pdfInfoVersion.startsWith('3.02')) { var infoFile = cacheFile.parent; infoFile.append(this.pdfInfoCacheFile); diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index c512936e2c..a9917aea87 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -1606,18 +1606,26 @@ Zotero.Schema = new function(){ if (Zotero.Fulltext.pdfInfoIsRegistered()) { let currentVersion = Zotero.Fulltext.pdfInfoVersion; - if (currentVersion < availableVersion || currentVersion == '3.02' + if (currentVersion < availableVersion || currentVersion.startsWith('3.02') || currentVersion == 'UNKNOWN') { installInfo = true; } } + // Install missing component if one is installed + else if (Zotero.Fulltext.pdfConverterIsRegistered()) { + installInfo = true; + } if (Zotero.Fulltext.pdfConverterIsRegistered()) { let currentVersion = Zotero.Fulltext.pdfConverterVersion; - if (currentVersion < availableVersion || currentVersion == '3.02' + if (currentVersion < availableVersion || currentVersion.startsWith('3.02') || currentVersion == 'UNKNOWN') { installConverter = true; } } + // Install missing component if one is installed + else if (Zotero.Fulltext.pdfInfoIsRegistered()) { + installConverter = true; + } let prefKey = 'pdfToolsInstallError'; let lastTry = 0, delay = 43200000; // half a day, so doubles to a day initially