Bug 164757 - Improve method for user, or admin, to block MAR updater (comment 6 for an env variable) workarounds otherwise
Summary: Improve method for user, or admin, to block MAR updater (comment 6 for an env...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: All Windows (All)
: high enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 166307 167236 (view as bug list)
Depends on:
Blocks: Automatic-Updater
  Show dependency treegraph
 
Reported: 2025-01-18 16:12 UTC by V Stuart Foote
Modified: 2025-06-29 11:38 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description V Stuart Foote 2025-01-18 16:12:23 UTC
In a bit of a twist, the now enabled by default [1] MAR based auto-update can not be prevented. Working too well ;-)

I needed to check on a feature (for bug 164745) in a 24.8.2.1 build, so performed /a admin install of the MSI package. Adjusted the bootstrap.ini to run from $ORIGIN as normal for /a admin installs, on first run the MAR update based updater process runs and patches the 24.8.2.1 up to current 24.8.4.2 builds.

Cleaned it off and set the LIBO_UPDATER_TEST_ENABLE to "0", and reinstalled. Same result.  Set value to "false", same result.  Removed the env variable, same result.  

With or without the envvar, the MAR based updater now always runs!

Shouldn't we have a way to block it?

Making QA a challenge, may have to finally figure out git bibisecting.

=-ref-=
[1] https://gerrit.libreoffice.org/c/core/+/172406
Comment 1 Gabor Kelemen (allotropia) 2025-01-24 21:19:03 UTC
Can confirm that in cygwin, changing into my SI-GUI folder and running:

$ LIBO_UPDATER_TEST_RUNNING=0 program/soffice

does not run the MAR update on 24.8.0, but:
 
setting the LIBO_UPDATER_TEST_RUNNING value to 0 in Windows System Properties dialog -> Advanced ->Environment Variables -> System variables, does not stop the MAR update. 
Not even after a Windows restart, when in Cygwin the env command reports LIBO_UPDATER_TEST_ENABLE=0 being set.

Another fun bit UX-wise is what happens after this: the LibreOffice Update process runs several times consecutively to update from .0 to .4
Comment 2 Stephan Bergmann 2025-01-27 07:25:40 UTC
(In reply to V Stuart Foote from comment #0)
> Cleaned it off and set the LIBO_UPDATER_TEST_ENABLE to "0", and reinstalled.
> Same result.  Set value to "false", same result.

In Desktop::Main in desktop/source/app/app.cxx (which is the only place in the code that uses that env var), we only check whether the LIBO_UPDATER_TEST_ENABLE env var is set at all, not what its actual value is (i.e., setting it to "0" or "false" has the same effect as setting it to "x" or "1" or "true" or whatever).
Comment 3 V Stuart Foote 2025-01-27 16:57:11 UTC
(In reply to Stephan Bergmann from comment #2)

OK, thanks! So I removed the LIBO_UPDATER_TEST_ENABLE var *and* had disabled the LibreOffice Update Service after a clean install of 24.8.2.1 MSI.

But on initial launch of 24.8.2.1, it immediately runs through a MAR update sequence. It does ask if I want to allow it to make changes, looks benign but nope.

Watched the update service, it remains disabled. The update.exe just runs!

How/where do we quash the automatic update prior to first launch (and a profile creation)?
Comment 4 Stephan Bergmann 2025-01-28 07:29:14 UTC
(In reply to V Stuart Foote from comment #3)
> OK, thanks! So I removed the LIBO_UPDATER_TEST_ENABLE var *and* had disabled
> the LibreOffice Update Service after a clean install of 24.8.2.1 MSI.

what exactly did you disable, where?
Comment 5 V Stuart Foote 2025-01-28 12:34:55 UTC
Windows Services

'cmd' as Administrator -> 'services.msc'

select 'LibreOffice Maintenance Service' -> properties

showing "C:\Program Files\LibreOffice\program\update_service.exe"

change dialog's Startup type from 'Manual' after clean MSI install of 24.8.2.1 and prior to first run, to 'Disabled' and OK out. Verify disabled and exit.

Run soffice.exe (as administrator or as normal user), watch the MAR based patching proceed. Ends with UI open in a patched 24.8.4.2 build.

No change to the update_service.exe, it remained disabled. Seems like the update.exe just runs on first run with no means to block it.
Comment 6 Stephan Bergmann 2025-01-28 13:18:19 UTC
(In reply to V Stuart Foote from comment #5)
> No change to the update_service.exe, it remained disabled. Seems like the
> update.exe just runs on first run with no means to block it.

The update_service.exe is an implementation detail, which is only used when necessary to modify with admin privileges an installation which the current user couldn't normally modify.

To disable the MAR updater, use "Tools - Options... - LibreOffice - Online Update - Automatic Update - Enable automatic update".

But what would arguably be nice is to let some LIBO_UPDATER_TEST_ENABLE env var value (like "0" or "false") disable the MAR updater.  We should be able to implement that.
Comment 7 V Stuart Foote 2025-01-28 13:45:54 UTC
(In reply to Stephan Bergmann from comment #6)
> (In reply to V Stuart Foote from comment #5)
> > No change to the update_service.exe, it remained disabled. Seems like the
> > update.exe just runs on first run with no means to block it.
> 
> The update_service.exe is an implementation detail, which is only used when
> necessary to modify with admin privileges an installation which the current
> user couldn't normally modify.

OK, that makes sense now (and looking again at app/app.cxx in the  HAVE_FEATURE_UPDATE_MAR block).

> 
> To disable the MAR updater, use "Tools - Options... - LibreOffice - Online
> Update - Automatic Update - Enable automatic update".
> 

Sure, but since we can't currently get into the UI on install/first run to set it, there is no way to prevent the MAR based update. Right?

And it is now enabled by default, could we uncheck it? But then who would enable, defeating purpose of providing a MAR based incremental to keep folks current.

> But what would arguably be nice is to let some LIBO_UPDATER_TEST_ENABLE env
> var value (like "0" or "false") disable the MAR updater.  We should be able
> to implement that.

Sounds good. Think something is going to be needed...

=> Enhancement
Comment 8 Gabor Kelemen (allotropia) 2025-03-18 20:31:27 UTC
I have found a workaround for older versions from 24.2.0:
- from instdir/program, delete/rename the updater.exe to effectively stop the MAR updater from running
Comment 9 nobu 2025-04-30 03:59:35 UTC
*** Bug 166307 has been marked as a duplicate of this bug. ***
Comment 10 V Stuart Foote 2025-06-25 15:27:38 UTC
We have an inability to block MAR incrementals that are now enabled by default.

When coupled with the Windows registry warts of bug 164043 when MAR updates are applied, the impact on MSI based installations makes LibreOffice very unappealing in any managed environment. 

It now challenges individual users making for a poor user experience--self inflicted by the project.

Really need to get a control in place on the MAR based incrementals to block the updates. Avoid the only current functional workaround of *renaming* the updater.exe executable!

As sberg suggested comment 6, seems instrumenting a test false of the existing LIBO_UPDATER_TEST_ENABLE variable, and publishing those details, would be reasonable approach.
Comment 11 V Stuart Foote 2025-06-26 10:37:24 UTC
*** Bug 167236 has been marked as a duplicate of this bug. ***
Comment 12 Christian Lohmaier 2025-06-26 12:11:45 UTC
To disable updates, one can use:

Expert Configuration → Search for "Office.Update" → change the "Enabled" value to false. (or set the LastUpdateTime to way ahead in the future)

But if you want to install an old version and prevent it from updating at first launch and you don't have an existing userprofile with the disabled setting (i.e. install fresh), you'll either have to edit the corresponding setting in the main.xcd file, which can be done with a small powershell script: 
######
$path = 'C:\Program Files\LibreOffice\share\registry\main.xcd'
$xml = New-Object xml
$xml.PreserveWhitespace = $true

$xml.Load($path)

$node = $xml.'data'.'component-schema' | Where-Object {$_."name" -eq 'Update'}
$node = $node.component.group.prop |
Where-Object {$_.'name' -eq 'Enabled'}

if ($node) {
    $node.value = 'false'
    Write-Output $node
} else {
    Write-Output "Error - MAR Enabled node not found"
    exit 1
}

$sanitized = $xml.OuterXml.Replace(" />","/>")

Set-Content -Path $path -Value $sanitized -Encoding UTF8 -NoNewline
######

Or if you don't want to touch the installation setting, launch it from commandline and set the LIBO_UPDATER_URL to something where LibreOffice won't find an update.


so three ways to disable update:
* Expert Configuration to set Enabled to false
* editing main.xcd (by hand or with powershell) to set Enabled to falst
* using the LIBO_UPDATER_URL environment variable to prevent LO from finding an update.
Comment 13 V Stuart Foote 2025-06-26 13:45:44 UTC
(In reply to Christian Lohmaier from comment #12)
> To disable updates, one can use:
> ...
> so three ways to disable update:
> * Expert Configuration to set Enabled to false
> * editing main.xcd (by hand or with powershell) to set Enabled to falst
> * using the LIBO_UPDATER_URL environment variable to prevent LO from finding
> an update.

And in addition to using Expert Configuration to edit the Office.Update 'Enabled' -> false, user can also clobber the 'URL' string there as well.  But both those are "per user" settings in their profile, not system wide for all users. 

She executable rename, or the .xcd hack edit is needed.

IMHO disabling MAR really needs to be a selectable installation option, much like the  legacy 'Check for Updates' had been.
Comment 14 V Stuart Foote 2025-06-26 13:47:26 UTC
(In reply to V Stuart Foote from comment #13)

> IMHO disabling MAR really needs to be a selectable installation option, much
> like the  legacy 'Check for Updates' had been.

Probably instrument an environment variable to parse to toggle Enabled.