office-gobmx/external/onlineupdate
Stephan Bergmann c00014019e tdf#161292: Fix create-partial-info for newly added files
084c64982e "Create MAR updates from msi rather
than from archive" had patched make_add_instruction (in
workdir/UnpackedTarball/onlineupdate/tools/update-packagin/common.sh) to
unconditionally use add-if (with the file itself as test file) rather than plain
add (because we can't reuse Mozilla's extension logic there to determine
optional installation parts), and it noted in its commit message that "addition
of files will cause a MAR update to miss them".

Which turned out to be a problem with
<https://update-mar.libreoffice.org/24.2.2.2/LibreOffice_24.2.2.2_Windows_X86_64_d56cc158d8a96260b836f100ef4b4ef25d6f1a01_from_bf759d854b5ab45b6ef0bfd22e51c6dc4fb8b882_partial.mar>,
updating from 24.2.2.1 with instdir/program/python-core-3.8.18/ to 24.2.2.2 with
instdir/program/python-core-3.8.19/:  All the files in python-core-3.8.19 were
recorded as add-if testing on themselves, so were never added.

So a better approach is, for newly added files to make them add (so they get
added unconditionally, even if they are part of some optional component that
happens to not be installed; this hopefully won't cause further issues) instead
of add-if.  (Existing files that are added instead of patched still use add-if,
though.)  This does not address the create-update-info target for full mar
updates (which is not used currently?), just the create-partial-info target.

(The existing calls to make_add_instruction in the upstream Mozilla code already
have a seemingly rotten mix of two-argument calls and calls with three arguments
where the third argument is ignored, and would check for a fourth "forced"
argument but which is never passed in.  So avoid extending that mess further,
and just replace this never-use-add-if call to make_add_instruction directly
with that function's (accordingly tweaked) body.)

Change-Id: Ib596f3aa72c3ab9f896b20f7d623bc574eb15fd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168285
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
2024-05-31 15:05:20 +02:00
..
qa
workben
CustomTarget_generated.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
cygpath.patch Further adapting of create-partial-info 2024-01-12 15:46:11 +01:00
Executable_mar.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
Executable_mbsdiff.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
Executable_test_updater_dialog.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
Executable_update_service.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
Executable_updater.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
generate-sources.sh Introduce external/onlineupdate/monitor-sources.sh 2024-01-05 16:11:14 +01:00
generate.py Re-enable MOZ_VERIFY_MAR_SIGNATURE feature 2024-01-02 21:23:48 +01:00
gtk3deprecated.patch Turn onlineupdate into external/onlineupdate 2023-12-15 11:27:49 +01:00
install_updateservice.cxx Fix Windows MSI custom action for --enable-online-update-mar 2023-12-22 18:47:14 +01:00
install_updateservice.def Fix Windows MSI custom action for --enable-online-update-mar 2023-12-22 18:47:14 +01:00
Library_install_updateservice.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
lo.patch tdf#161292: Fix create-partial-info for newly added files 2024-05-31 15:05:20 +02:00
Makefile Turn onlineupdate into external/onlineupdate 2023-12-15 11:27:49 +01:00
Module_onlineupdate.mk Re-enable MOZ_VERIFY_MAR_SIGNATURE feature 2024-01-02 21:23:48 +01:00
monitor-sources.sh Introduce external/onlineupdate/monitor-sources.sh 2024-01-05 16:11:14 +01:00
Package_update-settings_ini.mk Re-enable MOZ_VERIFY_MAR_SIGNATURE feature 2024-01-02 21:23:48 +01:00
Package_updater_ini.mk Improve --enable-online-update-mar Windows MOZ_MAINTENANCE_SERVICE feature 2023-12-19 20:24:32 +01:00
README.md Improve --enable-online-update-mar Windows MOZ_MAINTENANCE_SERVICE feature 2023-12-19 20:24:32 +01:00
StaticLibrary_libmar.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
StaticLibrary_libmarverify.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
StaticLibrary_updatehelper.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00
UnpackedTarball_onlineupdate.mk Create MAR updates from msi rather than from archive 2024-01-22 16:06:42 +01:00
unsigned-hack.patch Workaround for --disable-windows-build-signing --enable-dbgutil test builds 2024-01-05 15:33:32 +01:00
update-settings.ini Re-enable MOZ_VERIFY_MAR_SIGNATURE feature 2024-01-02 21:23:48 +01:00
updater.ini
WinResTarget_updater.mk makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo) 2024-05-06 11:40:45 +02:00

Online Update

Online update implementation based on Mozilla's MAR format + update mechanism

The source code has been extracted from https://github.com/mozilla/gecko-dev with external/onlineupdate/generate-sources.sh.

The source/service directory contains the code for the silent windows updater that avoids the repeated administrator check for an update.

Note

The updater executable should not depend on any other dynamic library in the LibreOffice installation as we would need to copy that one also to a temporary directory during update. We can't update any library or executable that is currently in use. For the updater executable we solve this problem by copying the updater before using it to a temporary directory.

On Windows we use the system to provide us with a crypto library whereas on Linux we use NSS.

Update Procedure

The updater executable is run two times. In a first run, the current installation is copied to an update directory and the update is applied in this update directory. During the next run, a replacement request is executed. The replacement request removes the old installation directory and replaces it with the content of the update directory.

User Profile in the Installation Directory

The archive based installations have the user profile by default inside of the installation directory. During the update process this causes some problems that need special handling in the updater.

  • The update directory is inside of the user profile resulting in recursive copying.
  • During the replacement request the updater log is in the user profile, which changes location from the actual location to a backup location.

Executable_test_updater_dialog

To run that manual test, do

$ cp instdir/program/updater.ini workdir/LinkTarget/Executable/test_updater_dialog.ini
$ workdir/LinkTarget/Executable/test_updater_dialog
$ rm workdir/LinkTarget/Executable/test_updater_dialog.ini