Commit 9e8c0b0b authored by Kathleen Brade's avatar Kathleen Brade Committed by Matthew Finkel
Browse files

Bug 4234: Use the Firefox Update Process for Tor Browser.

The following files are never updated:
  TorBrowser/Data/Browser/profiles.ini
  TorBrowser/Data/Browser/profile.default/bookmarks.html
  TorBrowser/Data/Tor/torrc
Mac OS: Store update metadata under TorBrowser/UpdateInfo.
Removed the %OS_VERSION% component from the update URL (13047) and
  added support for minSupportedOSVersion, an attribute of the
  <update> element that may be used to trigger Firefox's
  "unsupported platform" behavior.
Hide the "What's new" links (set app.releaseNotesURL value to about:blank).
Windows: disable "runas" code path in updater (15201).
Windows: avoid writing to the registry (16236).
Also includes fixes for tickets 13047, 13301, 13356, 13594, 15406,
  16014, 16909, 24476, and 25909.

Also fix Bug 26049: reduce the delay before the update prompt is displayed.
Instead of Firefox's 2 days, we use 1 hour (after which time the update
doorhanger will be displayed).

Also fix bug 27221: purge the startup cache if the Tor Browser
version changed (even if the Firefox version and build ID did
not change), e.g., after a minor Tor Browser update.

Also fix 32616: Disable GetSecureOutputDirectoryPath() functionality.

Bug 26048: potentially confusing "restart to update" message

Within the update doorhanger, remove the misleading message that mentions
that windows will be restored after an update is applied, and replace the
"Restart and Restore" button label with an existing
"Restart to update Tor Browser" string.

Bug 28885: notify users that update is downloading

Add a "Downloading Tor Browser update" item which appears in the
hamburger (app) menu while the update service is downloading a MAR
file. Before this change, the browser did not indicate to the user
that an update was in progress, which is especially confusing in
Tor Browser because downloads often take some time. If the user
clicks on the new menu item, the about dialog is opened to allow
the user to see download progress.

As part of this fix, the update service was changed to always show
update-related messages in the hamburger menu, even if the update
was started in the foreground via the about dialog or via the
"Check for Tor Browser Update" toolbar menu item. This change is
consistent with the Tor Browser goal of making sure users are
informed about the update process.

Removed #28885 parts of this patch which have been uplifted to Firefox.
parent 583fa055
...@@ -97,10 +97,12 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS- ...@@ -97,10 +97,12 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS-
rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS' rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS'
cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns' cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns'
cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns' cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns'
ifndef TOR_BROWSER_UPDATE
$(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices' $(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices'
ifdef MOZ_UPDATER ifdef MOZ_UPDATER
mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices' mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
endif
endif endif
printf APPLTORB > '$(dist_dest)/Contents/PkgInfo' printf APPLTORB > '$(dist_dest)/Contents/PkgInfo'
endif endif
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
// Disable initial homepage notifications // Disable initial homepage notifications
pref("browser.search.update", false); pref("browser.search.update", false);
pref("browser.rights.3.shown", true); pref("browser.rights.3.shown", true);
pref("browser.startup.homepage_override.mstone", "ignore");
pref("startup.homepage_welcome_url", ""); pref("startup.homepage_welcome_url", "");
pref("startup.homepage_welcome_url.additional", ""); pref("startup.homepage_welcome_url.additional", "");
...@@ -20,9 +19,17 @@ pref("startup.homepage_override_url", "https://blog.torproject.org/category/tags ...@@ -20,9 +19,17 @@ pref("startup.homepage_override_url", "https://blog.torproject.org/category/tags
// Try to nag a bit more about updates: Pop up a restart dialog an hour after the initial dialog // Try to nag a bit more about updates: Pop up a restart dialog an hour after the initial dialog
pref("app.update.promptWaitTime", 3600); pref("app.update.promptWaitTime", 3600);
pref("app.update.notifyDuringDownload", true);
#ifdef XP_WIN pref("app.update.url.manual", "https://www.torproject.org/download/languages/");
// For now, disable staged updates on Windows (see #18292). pref("app.update.url.details", "https://www.torproject.org/download/");
pref("app.update.badgeWaitTime", 0);
pref("app.releaseNotesURL", "about:blank");
#ifndef XP_MACOSX
// Disable staged updates on platforms other than macOS.
// Staged updates do not work on Windows due to #18292.
// Also, on Windows and Linux any changes that are made to the browser profile
// or Tor data after an update is staged will be lost.
pref("app.update.staging.enabled", false); pref("app.update.staging.enabled", false);
#endif #endif
...@@ -82,6 +89,7 @@ pref("datareporting.policy.dataSubmissionEnabled", false); ...@@ -82,6 +89,7 @@ pref("datareporting.policy.dataSubmissionEnabled", false);
// Make sure Unified Telemetry is really disabled, see: #18738. // Make sure Unified Telemetry is really disabled, see: #18738.
pref("toolkit.telemetry.unified", false); pref("toolkit.telemetry.unified", false);
pref("toolkit.telemetry.enabled", false); pref("toolkit.telemetry.enabled", false);
pref("toolkit.telemetry.updatePing.enabled", false); // Make sure updater telemetry is disabled; see #25909.
#ifdef XP_WIN #ifdef XP_WIN
// Defense-in-depth: ensure that the Windows default browser agent will // Defense-in-depth: ensure that the Windows default browser agent will
// not ping Mozilla if it is somehow present (we omit it at build time). // not ping Mozilla if it is somehow present (we omit it at build time).
......
...@@ -138,14 +138,8 @@ pref("app.update.elevation.promptMaxAttempts", 2); ...@@ -138,14 +138,8 @@ pref("app.update.elevation.promptMaxAttempts", 2);
pref("app.update.notifyDuringDownload", false); pref("app.update.notifyDuringDownload", false);
// If set to true, the Update Service will automatically download updates if the // If set to true, the Update Service will automatically download updates if the
// user can apply updates. This pref is no longer used on Windows, except as the // user can apply updates.
// default value to migrate to the new location that this data is now stored pref("app.update.auto", true);
// (which is in a file in the update directory). Because of this, this pref
// should no longer be used directly. Instead, getAppUpdateAutoEnabled and
// getAppUpdateAutoEnabled from UpdateUtils.jsm should be used.
#ifndef XP_WIN
pref("app.update.auto", true);
#endif
// If set to true, the Update Service will apply updates in the background // If set to true, the Update Service will apply updates in the background
// when it finishes downloading them. // when it finishes downloading them.
......
...@@ -128,7 +128,7 @@ appUpdater.prototype = { ...@@ -128,7 +128,7 @@ appUpdater.prototype = {
if (aChildID == "downloadAndInstall") { if (aChildID == "downloadAndInstall") {
let updateVersion = gAppUpdater.update.displayVersion; let updateVersion = gAppUpdater.update.displayVersion;
// Include the build ID if this is an "a#" (nightly or aurora) build // Include the build ID if this is an "a#" (nightly or aurora) build
if (/a\d+$/.test(updateVersion)) { if (!AppConstants.TOR_BROWSER_UPDATE && /a\d+$/.test(updateVersion)) {
let buildID = gAppUpdater.update.buildID; let buildID = gAppUpdater.update.buildID;
let year = buildID.slice(0, 4); let year = buildID.slice(0, 4);
let month = buildID.slice(4, 6); let month = buildID.slice(4, 6);
......
...@@ -50,15 +50,13 @@ async function init(aEvent) { ...@@ -50,15 +50,13 @@ async function init(aEvent) {
bits: Services.appinfo.is64Bit ? 64 : 32, bits: Services.appinfo.is64Bit ? 64 : 32,
}; };
// Adjust version text to show the Tor Browser version
versionAttributes.version = AppConstants.TOR_BROWSER_VERSION +
" (based on Mozilla Firefox " +
AppConstants.MOZ_APP_VERSION_DISPLAY + ")";
let version = Services.appinfo.version; let version = Services.appinfo.version;
if (/a\d+$/.test(version)) { if (/a\d+$/.test(version)) {
versionId = "aboutDialog-version-nightly";
let buildID = Services.appinfo.appBuildID;
let year = buildID.slice(0, 4);
let month = buildID.slice(4, 6);
let day = buildID.slice(6, 8);
versionAttributes.isodate = `${year}-${month}-${day}`;
document.getElementById("experimental").hidden = false; document.getElementById("experimental").hidden = false;
document.getElementById("communityDesc").hidden = true; document.getElementById("communityDesc").hidden = true;
} }
......
...@@ -46,6 +46,8 @@ XPCOMUtils.defineLazyGlobalGetters(this, [URL]); ...@@ -46,6 +46,8 @@ XPCOMUtils.defineLazyGlobalGetters(this, [URL]);
const NEWINSTALL_PAGE = "about:newinstall"; const NEWINSTALL_PAGE = "about:newinstall";
const kTBSavedVersionPref = "browser.startup.homepage_override.torbrowser.version";
// One-time startup homepage override configurations // One-time startup homepage override configurations
const ONCE_DOMAINS = ["mozilla.org", "firefox.com"]; const ONCE_DOMAINS = ["mozilla.org", "firefox.com"];
const ONCE_PREF = "browser.startup.homepage_override.once"; const ONCE_PREF = "browser.startup.homepage_override.once";
...@@ -105,7 +107,8 @@ const OVERRIDE_ALTERNATE_PROFILE = 4; ...@@ -105,7 +107,8 @@ const OVERRIDE_ALTERNATE_PROFILE = 4;
* Returns: * Returns:
* OVERRIDE_NEW_PROFILE if this is the first run with a new profile. * OVERRIDE_NEW_PROFILE if this is the first run with a new profile.
* OVERRIDE_NEW_MSTONE if this is the first run with a build with a different * OVERRIDE_NEW_MSTONE if this is the first run with a build with a different
* Gecko milestone (i.e. right after an upgrade). * Gecko milestone or Tor Browser version (i.e. right
* after an upgrade).
* OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the * OVERRIDE_NEW_BUILD_ID if this is the first run with a new build ID of the
* same Gecko milestone (i.e. after a nightly upgrade). * same Gecko milestone (i.e. after a nightly upgrade).
* OVERRIDE_NONE otherwise. * OVERRIDE_NONE otherwise.
...@@ -128,6 +131,11 @@ function needHomepageOverride(prefb) { ...@@ -128,6 +131,11 @@ function needHomepageOverride(prefb) {
var mstone = Services.appinfo.platformVersion; var mstone = Services.appinfo.platformVersion;
var savedTBVersion = null;
try {
savedTBVersion = prefb.getCharPref(kTBSavedVersionPref);
} catch (e) {}
var savedBuildID = prefb.getCharPref( var savedBuildID = prefb.getCharPref(
"browser.startup.homepage_override.buildID", "browser.startup.homepage_override.buildID",
"" ""
...@@ -146,7 +154,22 @@ function needHomepageOverride(prefb) { ...@@ -146,7 +154,22 @@ function needHomepageOverride(prefb) {
prefb.setCharPref("browser.startup.homepage_override.mstone", mstone); prefb.setCharPref("browser.startup.homepage_override.mstone", mstone);
prefb.setCharPref("browser.startup.homepage_override.buildID", buildID); prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
return savedmstone ? OVERRIDE_NEW_MSTONE : OVERRIDE_NEW_PROFILE; prefb.setCharPref(kTBSavedVersionPref, AppConstants.TOR_BROWSER_VERSION);
// After an upgrade from an older release of Tor Browser (<= 5.5a1), the
// savedmstone will be undefined because those releases included the
// value "ignore" for the browser.startup.homepage_override.mstone pref.
// To correctly detect an upgrade vs. a new profile, we check for the
// presence of the "app.update.postupdate" pref.
let updated = prefb.prefHasUserValue("app.update.postupdate");
return (savedmstone || updated) ? OVERRIDE_NEW_MSTONE
: OVERRIDE_NEW_PROFILE;
}
if (AppConstants.TOR_BROWSER_VERSION != savedTBVersion) {
prefb.setCharPref("browser.startup.homepage_override.buildID", buildID);
prefb.setCharPref(kTBSavedVersionPref, AppConstants.TOR_BROWSER_VERSION);
return OVERRIDE_NEW_MSTONE;
} }
if (buildID != savedBuildID) { if (buildID != savedBuildID) {
...@@ -647,6 +670,13 @@ nsBrowserContentHandler.prototype = { ...@@ -647,6 +670,13 @@ nsBrowserContentHandler.prototype = {
"browser.startup.homepage_override.buildID", "browser.startup.homepage_override.buildID",
"unknown" "unknown"
); );
// We do the same for the Tor Browser version.
let old_tbversion = null;
try {
old_tbversion = prefb.getCharPref(kTBSavedVersionPref);
} catch (e) {}
override = needHomepageOverride(prefb); override = needHomepageOverride(prefb);
if (override != OVERRIDE_NONE) { if (override != OVERRIDE_NONE) {
switch (override) { switch (override) {
...@@ -679,9 +709,10 @@ nsBrowserContentHandler.prototype = { ...@@ -679,9 +709,10 @@ nsBrowserContentHandler.prototype = {
"startup.homepage_override_url" "startup.homepage_override_url"
); );
let update = UpdateManager.readyUpdate; let update = UpdateManager.readyUpdate;
let old_version = old_tbversion ? old_tbversion: old_mstone;
if ( if (
update && update &&
Services.vc.compare(update.appVersion, old_mstone) > 0 Services.vc.compare(update.appVersion, old_version) > 0
) { ) {
overridePage = getPostUpdateOverridePage(update, overridePage); overridePage = getPostUpdateOverridePage(update, overridePage);
// Send the update ping to signal that the update was successful. // Send the update ping to signal that the update was successful.
...@@ -689,6 +720,8 @@ nsBrowserContentHandler.prototype = { ...@@ -689,6 +720,8 @@ nsBrowserContentHandler.prototype = {
} }
overridePage = overridePage.replace("%OLD_VERSION%", old_mstone); overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
overridePage = overridePage.replace("%OLD_TOR_BROWSER_VERSION%",
old_tbversion);
break; break;
case OVERRIDE_NEW_BUILD_ID: case OVERRIDE_NEW_BUILD_ID:
if (UpdateManager.readyUpdate) { if (UpdateManager.readyUpdate) {
......
...@@ -143,14 +143,15 @@ ...@@ -143,14 +143,15 @@
<popupnotification id="appMenu-update-restart-notification" <popupnotification id="appMenu-update-restart-notification"
popupid="update-restart" popupid="update-restart"
data-lazy-l10n-id="appmenu-update-restart" data-lazy-l10n-id="appmenu-update-restart"
data-l10n-attrs="buttonlabel, buttonaccesskey, secondarybuttonlabel, secondarybuttonaccesskey" data-l10n-attrs="buttonaccesskey, secondarybuttonlabel, secondarybuttonaccesskey"
buttonlabel="&updateRestart.panelUI.label2;"
closebuttonhidden="true" closebuttonhidden="true"
dropmarkerhidden="true" dropmarkerhidden="true"
checkboxhidden="true" checkboxhidden="true"
buttonhighlight="true" buttonhighlight="true"
hidden="true"> hidden="true">
<popupnotificationcontent id="update-restart-notification-content" orient="vertical"> <popupnotificationcontent id="update-restart-notification-content" orient="vertical">
<description id="update-restart-description" data-lazy-l10n-id="appmenu-update-restart-message"></description> <description id="update-restart-description">&#160;</description>
</popupnotificationcontent> </popupnotificationcontent>
</popupnotification> </popupnotification>
......
...@@ -6,26 +6,6 @@ ...@@ -6,26 +6,6 @@
MOZ_APP_VENDOR=Mozilla MOZ_APP_VENDOR=Mozilla
MOZ_UPDATER=1 MOZ_UPDATER=1
if test "$OS_ARCH" = "WINNT"; then
if ! test "$HAVE_64BIT_BUILD"; then
if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
"$MOZ_UPDATE_CHANNEL" = "nightly-try" -o \
"$MOZ_UPDATE_CHANNEL" = "aurora" -o \
"$MOZ_UPDATE_CHANNEL" = "beta" -o \
"$MOZ_UPDATE_CHANNEL" = "release"; then
if ! test "$MOZ_DEBUG"; then
if ! test "$USE_STUB_INSTALLER"; then
# Expect USE_STUB_INSTALLER from taskcluster for downstream task consistency
echo "ERROR: STUB installer expected to be enabled but"
echo "ERROR: USE_STUB_INSTALLER is not specified in the environment"
exit 1
fi
MOZ_STUB_INSTALLER=1
fi
fi
fi
fi
BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
...@@ -38,6 +18,21 @@ MOZ_BRANDING_DIRECTORY=browser/branding/unofficial ...@@ -38,6 +18,21 @@ MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384} MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
# ACCEPTED_MAR_CHANNEL_IDS should usually be the same as the value MAR_CHANNEL_ID.
# If more than one ID is needed, then you should use a comma separated list
# of values.
# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
if test "$MOZ_UPDATE_CHANNEL" = "alpha"; then
ACCEPTED_MAR_CHANNEL_IDS=torbrowser-torproject-alpha
MAR_CHANNEL_ID=torbrowser-torproject-alpha
elif test "$MOZ_UPDATE_CHANNEL" = "nightly"; then
ACCEPTED_MAR_CHANNEL_IDS=torbrowser-torproject-nightly
MAR_CHANNEL_ID=torbrowser-torproject-nightly
else
ACCEPTED_MAR_CHANNEL_IDS=torbrowser-torproject-release
MAR_CHANNEL_ID=torbrowser-torproject-release
fi
MOZ_PROFILE_MIGRATOR=1 MOZ_PROFILE_MIGRATOR=1
# Include the DevTools client, not just the server (which is the default) # Include the DevTools client, not just the server (which is the default)
......
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
; Mac bundle stuff ; Mac bundle stuff
@APPNAME@/Contents/Info.plist @APPNAME@/Contents/Info.plist
#ifdef MOZ_UPDATER #ifdef MOZ_UPDATER
#ifndef TOR_BROWSER_UPDATE
@APPNAME@/Contents/Library/LaunchServices @APPNAME@/Contents/Library/LaunchServices
#endif #endif
#endif
@APPNAME@/Contents/PkgInfo @APPNAME@/Contents/PkgInfo
@RESPATH@/firefox.icns @RESPATH@/firefox.icns
@RESPATH@/document.icns @RESPATH@/document.icns
......
...@@ -52,5 +52,5 @@ ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_ ...@@ -52,5 +52,5 @@ ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_
#if MOZ_UPDATER #if MOZ_UPDATER
[AppUpdate] [AppUpdate]
URL=https://@MOZ_APPUPDATE_HOST@/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml URL=https://aus1.torproject.org/torbrowser/update_3/%CHANNEL%/%BUILD_TARGET%/%VERSION%/%LOCALE%
#endif #endif
...@@ -1181,7 +1181,6 @@ def version_path(path): ...@@ -1181,7 +1181,6 @@ def version_path(path):
# set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in # set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
# The logic works like this: # The logic works like this:
# - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD) # - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
# - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
# - otherwise, we're building Release/Beta (define RELEASE_OR_BETA) # - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
@depends(check_build_environment, build_project, version_path, "--help") @depends(check_build_environment, build_project, version_path, "--help")
@imports(_from="__builtin__", _import="open") @imports(_from="__builtin__", _import="open")
...@@ -1228,7 +1227,7 @@ def milestone(build_env, build_project, version_path, _): ...@@ -1228,7 +1227,7 @@ def milestone(build_env, build_project, version_path, _):
if "a1" in milestone: if "a1" in milestone:
is_nightly = True is_nightly = True
elif "a" not in milestone: else:
is_release_or_beta = True is_release_or_beta = True
major_version = milestone.split(".")[0] major_version = milestone.split(".")[0]
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# update instructions which is used to remove files and directories that are no # update instructions which is used to remove files and directories that are no
# longer present in a complete update. The current working directory is used for # longer present in a complete update. The current working directory is used for
# the location to enumerate and to create the precomplete file. # the location to enumerate and to create the precomplete file.
# For symlinks, remove instructions are always generated.
from __future__ import absolute_import from __future__ import absolute_import
from __future__ import unicode_literals from __future__ import unicode_literals
...@@ -13,9 +14,18 @@ import os ...@@ -13,9 +14,18 @@ import os
import io import io
# TODO When TOR_BROWSER_DATA_OUTSIDE_APP_DIR is used on all platforms,
# we should remove all lines in this file that contain:
# TorBrowser/Data
def get_build_entries(root_path): def get_build_entries(root_path):
"""Iterates through the root_path, creating a list for each file and """Iterates through the root_path, creating a list for each file and
directory. Excludes any file paths ending with channel-prefs.js. directory. Excludes any file paths ending with channel-prefs.js.
To support Tor Browser updates, excludes:
TorBrowser/Data/Browser/profiles.ini
TorBrowser/Data/Browser/profile.default/bookmarks.html
TorBrowser/Data/Tor/torrc
""" """
rel_file_path_set = set() rel_file_path_set = set()
rel_dir_path_set = set() rel_dir_path_set = set()
...@@ -27,6 +37,10 @@ def get_build_entries(root_path): ...@@ -27,6 +37,10 @@ def get_build_entries(root_path):
if not ( if not (
rel_path_file.endswith("channel-prefs.js") rel_path_file.endswith("channel-prefs.js")
or rel_path_file.endswith("update-settings.ini") or rel_path_file.endswith("update-settings.ini")
or rel_path_file == "TorBrowser/Data/Browser/profiles.ini"
or rel_path_file
== "TorBrowser/Data/Browser/profile.default/bookmarks.html"
or rel_path_file == "TorBrowser/Data/Tor/torrc"
or rel_path_file.find("distribution/") != -1 or rel_path_file.find("distribution/") != -1
): ):
rel_file_path_set.add(rel_path_file) rel_file_path_set.add(rel_path_file)
...@@ -36,6 +50,9 @@ def get_build_entries(root_path): ...@@ -36,6 +50,9 @@ def get_build_entries(root_path):
rel_path_dir = os.path.join(parent_dir_rel_path, dir_name) rel_path_dir = os.path.join(parent_dir_rel_path, dir_name)
rel_path_dir = rel_path_dir.replace("\\", "/") + "/" rel_path_dir = rel_path_dir.replace("\\", "/") + "/"
if rel_path_dir.find("distribution/") == -1: if rel_path_dir.find("distribution/") == -1:
if os.path.islink(rel_path_dir[:-1]):
rel_file_path_set.add(rel_path_dir[:-1])
else:
rel_dir_path_set.add(rel_path_dir) rel_dir_path_set.add(rel_path_dir)
rel_file_path_list = list(rel_file_path_set) rel_file_path_list = list(rel_file_path_set)
......
...@@ -71,6 +71,11 @@ async function getRuntimeIcon(runtime, channel) { ...@@ -71,6 +71,11 @@ async function getRuntimeIcon(runtime, channel) {
} }
} }
// Use the release build skin for devtools within Tor Browser alpha releases.
if (channel === "alpha") {
return "chrome://devtools/skin/images/aboutdebugging-firefox-release.svg";
}
return channel === "release" || channel === "beta" || channel === "aurora" return channel === "release" || channel === "beta" || channel === "aurora"
? `chrome://devtools/skin/images/aboutdebugging-firefox-${channel}.svg` ? `chrome://devtools/skin/images/aboutdebugging-firefox-${channel}.svg`
: "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg"; : "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg";
......
...@@ -103,7 +103,7 @@ var UpdateUtils = { ...@@ -103,7 +103,7 @@ var UpdateUtils = {
case "PRODUCT": case "PRODUCT":
return Services.appinfo.name; return Services.appinfo.name;
case "VERSION": case "VERSION":
return Services.appinfo.version; return AppConstants.TOR_BROWSER_VERSION;
case "BUILD_ID": case "BUILD_ID":
return Services.appinfo.appBuildID; return Services.appinfo.appBuildID;
case "BUILD_TARGET": case "BUILD_TARGET":
...@@ -167,25 +167,17 @@ var UpdateUtils = { ...@@ -167,25 +167,17 @@ var UpdateUtils = {
* downloads and installs updates. This corresponds to whether or not the user * downloads and installs updates. This corresponds to whether or not the user
* has selected "Automatically install updates" in about:preferences. * has selected "Automatically install updates" in about:preferences.
* *
* On Windows, this setting is shared across all profiles for the installation * On Windows (except in Tor Browser), this setting is shared across all profiles
* for the installation
* and is read asynchronously from the file. On other operating systems, this * and is read asynchronously from the file. On other operating systems, this
* setting is stored in a pref and is thus a per-profile setting. * setting is stored in a pref and is thus a per-profile setting.
* *
* @return A Promise that resolves with a boolean. * @return A Promise that resolves with a boolean.
*/ */
getAppUpdateAutoEnabled() { getAppUpdateAutoEnabled() {
if (Services.policies) { if (AppConstants.TOR_BROWSER_UPDATE || (AppConstants.platform != "win")) {
if (!Services.policies.isAllowed("app-auto-updates-off")) { // On platforms other than Windows and always in Tor Browser the setting
// We aren't allowed to turn off auto-update - it is forced on. // is stored in a preference.
return Promise.resolve(true);
}
if (!Services.policies.isAllowed("app-auto-updates-on")) {
// We aren't allowed to turn on auto-update - it is forced off.
return Promise.resolve(false);
}
}
if (AppConstants.platform != "win") {
// On platforms other than Windows the setting is stored in a preference.
let prefValue = Services.prefs.getBoolPref( let prefValue = Services.prefs.getBoolPref(
PREF_APP_UPDATE_AUTO, PREF_APP_UPDATE_AUTO,
DEFAULT_APP_UPDATE_AUTO DEFAULT_APP_UPDATE_AUTO
...@@ -256,7 +248,8 @@ var UpdateUtils = { ...@@ -256,7 +248,8 @@ var UpdateUtils = {
* updates" and "Check for updates but let you choose to install them" options * updates" and "Check for updates but let you choose to install them" options
* in about:preferences. * in about:preferences.
* *
* On Windows, this setting is shared across all profiles for the installation * On Windows (except in Tor Browser), this setting is shared across all profiles
* for the installation
* and is written asynchronously to the file. On other operating systems, this * and is written asynchronously to the file. On other operating systems, this
* setting is stored in a pref and is thus a per-profile setting. * setting is stored in a pref and is thus a per-profile setting.
* *
...@@ -276,14 +269,9 @@ var UpdateUtils = { ...@@ -276,14 +269,9 @@ var UpdateUtils = {
* this operation simply sets a pref. * this operation simply sets a pref.
*/ */
setAppUpdateAutoEnabled(enabledValue) { setAppUpdateAutoEnabled(enabledValue) {
if (this.appUpdateAutoSettingIsLocked()) { if (AppConstants.TOR_BROWSER_UPDATE || (AppConstants.platform != "win")) {
return Promise.reject( // Only in Windows (but never for Tor Browser) do we store the update config
"setAppUpdateAutoEnabled: Unable to change value of setting because " + // in the update directory
"it is locked by policy"
);
}
if (AppConstants.platform != "win") {
// Only in Windows do we store the update config in the update directory
let prefValue = !!enabledValue; let prefValue = !!enabledValue;
Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, prefValue); Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, prefValue);
// Rather than call maybeUpdateAutoConfigChanged, a pref observer has // Rather than call maybeUpdateAutoConfigChanged, a pref observer has
......
...@@ -23,6 +23,7 @@ const { AppConstants } = ChromeUtils.import( ...@@ -23,6 +23,7 @@ const { AppConstants } = ChromeUtils.import(
const MOZ_COMPATIBILITY_NIGHTLY = ![ const MOZ_COMPATIBILITY_NIGHTLY = ![
"aurora", "aurora",
"alpha",
"beta", "beta",
"release", "release",
"esr", "esr",
...@@ -37,6 +38,7 @@ const PREF_EM_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault"; ...@@ -37,6 +38,7 @@ const PREF_EM_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault";
const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility"; const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity"; const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
const PREF_SYS_ADDON_UPDATE_ENABLED = "extensions.systemAddon.update.enabled"; const PREF_SYS_ADDON_UPDATE_ENABLED = "extensions.systemAddon.update.enabled";
const PREF_EM_LAST_TORBROWSER_VERSION = "extensions.lastTorBrowserVersion";