diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 1e835c12cee1..914321bd9074 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -102,7 +102,7 @@ pref("app.update.mode", 1); pref("app.update.silent", false); // Update service URL: -pref("app.update.url", "https://aus2.mozilla.org/update/2/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/update.xml"); +pref("app.update.url", "https://aus2.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml"); // app.update.url.manual is in branding section // app.update.url.details is in branding section diff --git a/toolkit/mozapps/update/src/nsUpdateService.js.in b/toolkit/mozapps/update/src/nsUpdateService.js.in index 2532252578fa..1107999b5adb 100644 --- a/toolkit/mozapps/update/src/nsUpdateService.js.in +++ b/toolkit/mozapps/update/src/nsUpdateService.js.in @@ -58,6 +58,8 @@ const PREF_GENERAL_USERAGENT_LOCALE = "general.useragent.locale"; const PREF_APP_UPDATE_INCOMPATIBLE_MODE = "app.update.incompatible.mode"; const PREF_UPDATE_NEVER_BRANCH = "app.update.never."; const PREF_PARTNER_BRANCH = "app.partner."; +const PREF_APP_DISTRIBUTION = "distribution.id"; +const PREF_APP_DISTRIBUTION_VERSION = "distribution.version"; const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul"; const URI_UPDATE_HISTORY_DIALOG = "chrome://mozapps/content/update/history.xul"; @@ -539,6 +541,22 @@ function getUpdateChannel() { return channel; } +/* Get the distribution pref values, from defaults only */ +function getDistributionPrefValue(aPrefName) { + var prefValue = "default"; + + var defaults = + gPref.QueryInterface(Components.interfaces.nsIPrefService). + getDefaultBranch(null); + try { + prefValue = defaults.getCharPref(aPrefName); + } catch (e) { + // use default when pref not found + } + + return prefValue; +} + /** * An enumeration of items in a JS array. * @constructor @@ -1940,6 +1958,10 @@ Checker.prototype = { url = url.replace(/%LOCALE%/g, getLocale()); url = url.replace(/%CHANNEL%/g, getUpdateChannel()); url = url.replace(/%PLATFORM_VERSION%/g, gApp.platformVersion); + url = url.replace(/%DISTRIBUTION%/g, + getDistributionPrefValue(PREF_APP_DISTRIBUTION)); + url = url.replace(/%DISTRIBUTION_VERSION%/g, + getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION)); url = url.replace(/\+/g, "%2B"); if (force)