Граф коммитов

209 Коммитов

Автор SHA1 Сообщение Дата
Doug Thayer ef2740f793 Bug 1728653 - Allow a silent start mode r=bytesized,nalexander,application-update-reviewers,mossop
This will allow starting Firefox in the background, and on Windows will allow
closing the last browser window without killing the main process. There is no
plan for actually using this by default in Firefox proper, but it's needed for
some explorations.

There's more to this work that we'll need - this is just the first step. For
instance, we'll need a real way to actually kill firefox on Windows other than
through the task manager (we'll be putting something in the system tray to
allow this.)

The patch wasn't particularly large, so I didn't split out the rename of
MOZ_APP_SILENT_START to MOZ_APP_SILENT_RESTART - let me know if you'd like me
to do that though and I can.

Differential Revision: https://phabricator.services.mozilla.com/D124249
2021-09-09 18:09:25 +00:00
Stephen A Pohl c494ddeedd Bug 1728167: Add ability for standard users to install from a DMG through elevation. r=mstange,application-update-reviewers,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D123899
2021-09-03 20:41:31 +00:00
Alexandru Michis 0ffe70c46e Backed out changeset b55cdb5c3841 (bug 1728167) for causing xpcshell failures in bootstrapSvc.js
CLOSED TREE
2021-09-03 02:56:46 +03:00
Stephen A Pohl 38585184d4 Bug 1728167: Add ability for standard users to install from a DMG through elevation. r=mstange,application-update-reviewers,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D123899
2021-09-02 17:41:48 +00:00
Andreea Pavel fa7564ef7c Backed out 2 changesets (bug 1728167, bug 1728580) for win build bustages on a CLOSED TREE
Backed out changeset d28a7b6edac6 (bug 1728580)
Backed out changeset fc05d1c0d88a (bug 1728167)
2021-09-02 19:17:34 +03:00
Stephen A Pohl 6a03b0b2a6 Bug 1728167: Add ability for standard users to install from a DMG through elevation. r=mstange,application-update-reviewers,bytesized
Differential Revision: https://phabricator.services.mozilla.com/D123899
2021-09-02 15:41:17 +00:00
Kirk f9526638b2 Bug 1726659 - Prevent update UI on a Silent Restart r=agashlin
Additionally should prevent elevated updates from running at all on a silent restart, since this will always require UI.

Differential Revision: https://phabricator.services.mozilla.com/D123568
2021-08-31 22:49:11 +00:00
Molly Howell c8456941cf Bug 1709978 - Disable app update when running as a packaged app. r=agashlin,preferences-reviewers
This patch disables the update service as if it were disabled by policy
whenever a package identify is present. User interfaces are treated as if
the updater had not been included in the build, because that prevents any of
our usual update UI from being shown, and in particular ensures that we do not
generate messages about an administrator handling updates, as would normally
happen when disabling updates via policy.

The telemetry environment's update.enabled flag is deliberately left alone in
this patch, because the mere fact of using an app package does not really say
anything about whether the user intends to allow automatic updating or not.

Depends on D114427

Differential Revision: https://phabricator.services.mozilla.com/D114886
2021-07-15 20:58:21 +00:00
Csoregi Natalia e3638062b6 Backed out changeset cec939837018 (bug 1709978) for causing failures on app update. CLOSED TREE 2021-07-14 22:21:53 +03:00
Molly Howell c797d0b164 Bug 1709978 - Disable app update when running as a packaged app. r=agashlin,preferences-reviewers
This patch disables the update service as if it were disabled by policy
whenever a package identify is present. User interfaces are treated as if
the updater had not been included in the build, because that prevents any of
our usual update UI from being shown, and in particular ensures that we do not
generate messages about an administrator handling updates, as would normally
happen when disabling updates via policy.

The telemetry environment's update.enabled flag is deliberately left alone in
this patch, because the mere fact of using an app package does not really say
anything about whether the user intends to allow automatic updating or not.

Differential Revision: https://phabricator.services.mozilla.com/D114886
2021-07-14 18:23:41 +00:00
Kirk Steuber b1e3eb0ab5 Bug 1705726 - Create an interface to determine if the maintenance service registry entry exists r=nalexander
Creates nsIUpdateProcessor.serviceRegKeyExists(), which checks for existence the registry key written by the installer that indicates that the current installation can use the Maintenance Service.

The nsIUpdateProcessor interface was chosen because that is the one Update-related xpcom component that is implemented in C++. By implementing this in C++, we can use the existing implementation of CalculateRegistryPathFromFilePath() to do most of the work for us.

Unfortunately, we can't really test this feature without being able to write to HKEY_LOCAL_MACHINE, which we have no good way of doing during testing.

Differential Revision: https://phabricator.services.mozilla.com/D114803
2021-05-11 19:32:51 +00:00
Cosmin Sabou 8dfb644a92 Backed out 2 changesets (bug 1705726) for causing build bustages. CLOSED TREE
Backed out changeset 1454949d2d8b (bug 1705726)
Backed out changeset 4a2629df75a4 (bug 1705726)
2021-05-11 21:30:39 +03:00
Kirk Steuber b7b545db73 Bug 1705726 - Create an interface to determine if the maintenance service registry entry exists r=nalexander
Creates nsIUpdateProcessor.serviceRegKeyExists(), which checks for existence the registry key written by the installer that indicates that the current installation can use the Maintenance Service.

The nsIUpdateProcessor interface was chosen because that is the one Update-related xpcom component that is implemented in C++. By implementing this in C++, we can use the existing implementation of CalculateRegistryPathFromFilePath() to do most of the work for us.

Unfortunately, we can't really test this feature without being able to write to HKEY_LOCAL_MACHINE, which we have no good way of doing during testing.

Differential Revision: https://phabricator.services.mozilla.com/D114803
2021-05-11 18:12:08 +00:00
Kirk Steuber b920b21c76 Bug 1674277 - Make AUS.stopDownload asynchronous r=nalexander,preferences-reviewers
The Downloader's cleanup function really ought to be asynchronous. The observer for "quit-application" is already asynchronous, so there's no problem there. But really, we ought to be cleaning up each downloader that we use, not just the last one. Which means that the cleanup ought to happen in AUS.stopDownload. So this patch will convert AUS.stopDownload to be asynchronous so that we can properly clean up the downloader from there.

Differential Revision: https://phabricator.services.mozilla.com/D110646
2021-04-05 19:52:12 +00:00
Simon Giesecke fac74ba9be Bug 1696350 - Remove redundant nullptr checks of return value of infallible new in toolkit/xre. r=mossop,application-update-reviewers,bytesized
Depends on D107181

Differential Revision: https://phabricator.services.mozilla.com/D107182
2021-03-10 21:08:55 +00:00
Harsh Gupta 3bc9cf1d11 Bug 1674675 - nsUpdateDriver.cpp: simplify the code by removing an else r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D100482
2020-12-26 14:28:36 +00:00
Molly Howell 814e88456e Bug 1553982 Part 0 - Fix a few unified build issues that crop up when adding files in this directory. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D95623
2020-12-10 04:33:20 +00:00
Cristina Coroiu 1843375acb Backed out 6 changesets (bug 1553982) for breaking updates on Linux (bug 1680935) a=backout
Backed out changeset 78dce99516dd (bug 1553982)
Backed out changeset 40d67c6dfdf3 (bug 1553982)
Backed out changeset 71742fced1ba (bug 1553982)
Backed out changeset 9dcf78cd576f (bug 1553982)
Backed out changeset 01d41760db29 (bug 1553982)
Backed out changeset 5040354e75c2 (bug 1553982)
2020-12-07 11:35:41 +02:00
Molly Howell d11ad73be3 Bug 1553982 Part 0 - Fix a few unified build issues that crop up when adding files in this directory. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D95623
2020-12-03 21:52:07 +00:00
Razvan Maries 539965b94b Backed out 6 changesets (bug 1553982) for build bustages on stat.h. CLOSED TREE
Backed out changeset a207ff8ae135 (bug 1553982)
Backed out changeset bfea27666adf (bug 1553982)
Backed out changeset 1299e017328e (bug 1553982)
Backed out changeset e9e14538b7ff (bug 1553982)
Backed out changeset 63f834f25945 (bug 1553982)
Backed out changeset 91bc72bf7a1b (bug 1553982)
2020-12-03 22:40:42 +02:00
Molly Howell 5ad3ba4f51 Bug 1553982 Part 0 - Fix a few unified build issues that crop up when adding files in this directory. r=bytesized
Differential Revision: https://phabricator.services.mozilla.com/D95623
2020-12-03 20:11:33 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Mark Smith 7b93c9ae97 Bug 1588549 - --disable-maintenance-service should exclude all maintenance service-related code r=bytesized,mhowell
Exclude Windows Maintenance Service-related C++ code and avoid linking
with unnecessary libraries when building with --disable-maintenance-service.

Differential Revision: https://phabricator.services.mozilla.com/D76349
2020-05-27 21:22:15 +00:00
Simon Giesecke 8ad76c7e47 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in toolkit. r=mossop
Depends on D66008

Differential Revision: https://phabricator.services.mozilla.com/D66010

--HG--
extra : moz-landing-system : lando
2020-03-10 08:48:24 +00:00
Gabriele Svelto 5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Aaron Klotz 7d3e1ba397 Bug 1577061: Modify nsUpdateDriver's GetCurrentWorkingDir to accept a nsACString& argument; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D43711

--HG--
extra : moz-landing-system : lando
2019-08-28 17:29:06 +00:00
Robert Strong 613550c9a5 Bug 1567077 - don't try to update when the update.status file is read only. r=bytesized
When checking for an update during startup, open the update.status file with read and write access so repeated update attempts are prevented when there is only read access to the update.status file.
When loading the active-update.xml file after startup, open it with both read and write access so the active-update.xml isn't loaded when there is only read access and the client will still receive manual update notifications.
On Windows, when opening the active-update.xml file with both read and write access fails attempt to fix the update directory permissions.
When checking if it is possible to apply updates, first check for write access to the update directory so OS X no longer always returns true and Windows no longer always returns true when the maintenance service can be used.
Sets security.turn_off_all_security_so_that_viruses_can_take_over_this_computer to true in the app update xpcshell tests so Cu.isInAutomation is true when running the tests.

Differential Revision: https://phabricator.services.mozilla.com/D39601

--HG--
rename : toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js => toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSkippedWriteAccess_win.js
extra : moz-landing-system : lando
2019-07-31 16:15:27 +00:00
Kirk Steuber 3a5e7c7c50 Bug 1567630 - Rename shouldUseService to useServiceOnFailure r=rstrong
This better describes the parameter's effect.

Differential Revision: https://phabricator.services.mozilla.com/D38764

--HG--
extra : moz-landing-system : lando
2019-07-22 17:47:44 +00:00
Robert Strong 71a9c7de23 Bug 1561504 - Launch the updater in place instead of copying to the update directory on Mac OS X. r=bytesized
This makes it so Mac OS X launches the updater inside of the bundle instead of copying to the update directory.
Cleans up some of the returns in nsUpdateDriver.cpp
Fixes the eslint no-useless-concat exceptions in the update tests

Differential Revision: https://phabricator.services.mozilla.com/D37374

--HG--
extra : moz-landing-system : lando
2019-07-09 18:42:39 +00:00
Haik Aftandilian 4313688d01 Bug 1556733 - [10.15] Multiple "Firefox Nightly Software Update" Mac OS X quarantine dialogs when performing a software update r=rstrong,spohl
On Mac, remove the "com.apple.quarantine" extended attribute from the updater after it is copied to the staging area. Required on macOS 10.15 which has new restrictions on launching quarantined applications.

Differential Revision: https://phabricator.services.mozilla.com/D35972

--HG--
extra : moz-landing-system : lando
2019-06-27 02:51:45 +00:00
Robert Strong e91a47c0f3 Bug 1555077 - Remove broken call to ShowUpdateElevationRequired in nsUpdateDriver.cpp. r=spohl
At some point the do_GetService call for nsIUpdatePrompt stopped working.
Since this code is being reworked in a different bug just remove the code.

Differential Revision: https://phabricator.services.mozilla.com/D32905

--HG--
extra : moz-landing-system : lando
2019-05-29 15:21:37 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Stephen A Pohl 4287947c1a Bug 1523613: Fix memory leaks during updates. r=rstrong 2019-02-25 10:16:15 -05:00
Robert Strong b71ad23d06 Bug 1434033 - Use ORIGIN to search for NSS on Linux. r=mhowell,glandium
Set the updater LDFLAGS to -Wl,-rpath=$ORIGIN so NSS can be found in the binary's directory
Stop changing the LD_LIBRARY_PATH in nsUpdaterDriver.cpp
Load the updater support files before the update begins in progressui_gtk.cpp
Launch the updater from the install directory instead of copying it to the update directory
Remove the skip-if = (os == linux && verify) for the staging tests since this also fixes the ETXTBSY error when calling execv on the copied updater

Differential Revision: https://phabricator.services.mozilla.com/D20098

--HG--
extra : moz-landing-system : lando
2019-02-21 00:31:11 +00:00
Sylvestre Ledru 14486004b6 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D18488

--HG--
extra : moz-landing-system : lando
2019-02-04 19:10:18 +00:00
Robert Strong 5710e8d965 Backed out changeset 2fc5715105a2 due to bug 1524496. r=me 2019-02-02 23:01:23 -08:00
Robert Strong a13e0d21bd Bug 1524407 - Cleanup of unused and unnecessary code in nsUpdateDriver.cpp. r=mhowell 2019-01-31 22:28:50 -08:00
Robert Strong ee3e46ee12 Bug 1524366 - Revert the Linux staging code changed in bug 1524366 to fix crash [@ mozilla::ipc::MessageChannel::Close()]. r=mhowell 2019-01-31 14:42:38 -08:00
Robert Strong 12805e6a76 Bug 1168010 - Fix leaks in updater.cpp and nsUpdateDriver.cpp. r=spohl
Fixes leak where the return value of GetManifestContents in updater.cpp is not freed
Fixes leak where the return value of get_quoted_path in updater.cpp is not freed
Fixes leak in nsUpdateDriver.cpp ApplyUpdate
With these leaks fixed the UI tests that stage updates can run on Linux asan

Differential Revision: https://phabricator.services.mozilla.com/D17910

--HG--
extra : moz-landing-system : lando
2019-01-30 22:39:35 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Dave Townsend e1283ad6c2 Bug 1518846: Fix missing includes in nsUpdateDriver.cpp. r=rstrong
Adds some includes that are needed for functions used in nsUpdateDriver.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D16063

--HG--
extra : moz-landing-system : lando
2019-01-09 17:27:21 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Robert Strong 6c7cf8b65e Bug 1502681 - Always use ProgramData\Mozilla\updates for the updates directory. r=bytesized
Changes GetCommonUpdateDirectory to always return a directory under ProgramData\Mozilla\updates on Windows
Changes getMockUpdRootDWin to always return ProgramData\Mozilla\updates for the new updates dir location
Removed code that is no longer used in getMockUpdRootDWin
Fixes a build time warning that get_relative_path is not used in updater.cpp
2018-10-29 11:21:49 -07:00
Kirk Steuber 19c8368ea5 Bug 1458314 - Move the update directory to an installation specific location r=rstrong
This change applies to Windows only.
Firefox will need to migrate the directory from the old location to the new location. This will be done only once by setting the pref `app.update.migrated.updateDir2.<install path hash>` to `true` once migration has completed.

Note: The pref name app.update.migrated.updateDir has already been used, thus the '2' suffix. It can be found in ESR24.

This also removes the old handling fallback for generating the update directory path. Since xulrunner is no longer supported, this should no longer be needed. If neither the vendor nor app name are defined, it falls back to the literal string "Mozilla".

The code to generate the update directory path and the installation hash have been moved to the updatecommon library. This will allow those functions to be used in Firefox, the Mozilla Maintenance Service, the Mozilla Maintenance Service Installer, and TestAUSHelper.

Additionally, the function that generates the update directory path now has extra functionality. It creates the update directory, sets the permissions on it and, optionally, recursively sets the permissions on everything within.

This patch adds functionality that allows Firefox to set permissions on the new update directory on write failure. It attempts to set the permissions itself and, if that fails and the maintenance service is enabled, it calls into the maintenance service to try from there. If a write fails and the permissions cannot be fixed, the user is prompted to reinstall.

Differential Revision: https://phabricator.services.mozilla.com/D4249

--HG--
rename : toolkit/mozapps/update/updater/win_dirent.cpp => toolkit/mozapps/update/common/win_dirent.cpp
rename : toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js => toolkit/mozapps/update/tests/unit_aus_update/updateDirectoryMigrate.js
extra : moz-landing-system : lando
2018-10-23 21:41:04 +00:00
Andrew McCreight ea6021b769 Bug 1494127 - Fix trivial calls to do_QueryInterface that return an nsresult r=smaug
Calls to do_QueryInterface to a base class can be replaced by a static
cast, which is faster.

Differential Revision: https://phabricator.services.mozilla.com/D7224

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:43 +00:00
Masatoshi Kimura 209fbc21cd Bug 1493414 - Re-enable warnings as errors on clang-cl in toolkit/xre/. r=froydnj
_CrtSetReportXxxx stuff is dead decause we do not use debug CRT even in debug
builds for a long time. So I removed it to fix -Wunused-function.

--HG--
extra : source : ba00278fc1deee805e7ed13d0dc0658dee13465c
extra : intermediate-source : 5ffdd1f9f2562f9915f3c8805218fa33a908be20
2018-09-18 22:04:28 +09:00
Mike Hommey 117e48720c Bug 1489363 - Replace some string.Assign* with AssignLiteral. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5224

--HG--
extra : moz-landing-system : lando
2018-09-07 22:12:01 +00:00
Adam Gashlin 325281069c Bug 1463560: Part 1: Re-add the -os-restarted arg when launching after an update. r=mhowell
MozReview-Commit-ID: 509GetTCBCF

--HG--
extra : rebase_source : 7efb75b292d59b35913b4b118594e193f2ceb76f
2018-05-27 12:22:05 -07:00