Bug 155724

Summary: -env:UserInstallation= broken on Windows
Product: LibreOffice Reporter: Jim Avera <jim.avera>
Component: InstallationAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED INVALID    
Severity: normal CC: telesto
Priority: medium    
Version: 7.5.3.2 release   
Hardware: All   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:

Description Jim Avera 2023-06-08 00:18:45 UTC
The documented UserInstallation mechanism for specifying a profile directory does not work on Windows.   I think the reason is that 'UserInstallation' is defined in "C:\Program Files\LibreOffice\program\bootstrap.ini" and it can not be over-ridden with an environment variable or using the documented command line option -env:UserInstallation=file://...

Can LO be made to ignore the setting in .ini if the user explicitly over-rides it with a command line option?

--- details ---

This prevents safely using LO as a batch tool to convert files (--convert-to option etc.) because if the user has an interactive session running then random aborts will occur.

https://wiki.documentfoundation.org/UserProfile says the following will start LO with a different user profile:

  For Windows:  soffice.com -env:UserInstallation=file:///c:/my-test-profile

Initially, that fails because .../program/ was not registered by the installer to be in PATH, so "soffice.com" is not found.

If the fully-qualified path is specified, then a pop-up error says
  
    The application cannot be started. 
    The configuration file "C:\Program Files\LibreOffice\program\bootstrap.ini" 
    is corrupt.

That .ini file does contain

    "C:\Program Files\LibreOffice\program\bootstrap.ini"

which seems to cause this conflict.

STEPS TO REPRODUCE:

1. Using Vim or Notepad, create a file "test.bad" containing the following two lines (change the paths appropriately):

mkdir "C:\Users\Admin0\AppData\Local\Temp\TestProfile"

"C:\Program Files\LibreOffice\program\soffice.com" "-env:UserInstallation=file://C:\Users\Admin0\AppData\Local\Temp\TestProfile"

2. Type the name/path of the script (e.g. "test.bat")

RESULTS: The "corrupted" error pop-up appears and LO stalls waiting for the user to click ok.

-----------------

Note: There is no such problem on Linux.
Comment 1 Jim Avera 2023-06-08 00:24:07 UTC
I'm sorry (copy-paste mistake), the .ini file contains

   UserInstallation=$SYSUSERCONFIG/LibreOffice/4

Also, the batch file name should end in .bat not .bad
Comment 2 Eike Rathke 2023-06-08 08:56:52 UTC
Fwiw, file://C:\Users\Admin0\AppData\Local\Temp\TestProfile with backslashes is not a valid URL, and it also lacks the (empty) host subcomponent, that should be
file:///C:/Users/Admin0/AppData/Local/Temp/TestProfile
instead.
Comment 3 Jim Avera 2023-06-08 20:44:08 UTC
@Eike - Thank you.   Fixing the incorrect URI makes it work

There remains a small bug in that the source of the error is mis-diagnosed as being a "corrupt C:\Program Files\LibreOffice\program\bootstrap.ini"
when the error was actually in a passed-in environment variable.

It might not be worth the trouble to keep track of the over-ride for diagnostic purposes, however.

I'm going to mark this RESOLVED.   Thank you for the help!