Bug 122824 - Main LibreOffice MSI Package should be compiled with external .cab file to reduce installation size requirements
Summary: Main LibreOffice MSI Package should be compiled with external .cab file to re...
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Windows (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-20 05:08 UTC by João Paulo
Modified: 2019-01-29 04:53 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice properties as shown by 7-Zip (22.13 KB, image/png)
2019-01-20 05:12 UTC, João Paulo
Details
Cached LibreOffice.msi properties as shown by 7-Zip (13.55 KB, image/png)
2019-01-20 05:15 UTC, João Paulo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description João Paulo 2019-01-20 05:08:10 UTC
Description:
LibreOffice installation uses too much storage on Windows, but can use a lot less by using a stripped down LibreOffice.msi package. Please follow my explanation:

Before version 5, Windows Installer used to strip MSI packages from all .cab files  before caching the .msi file inside \Windows\Installer folder. The cached installer package therefore contained only the installer structure and was kept small and didn't increase installation storage requirements unnecessarily.

After Windows Installer 5 (which came with Windows 7), .msi files were cached in full size to avoid breaking the file signature (it affected UAC prompt on setup launch from Control Panel, Add/Remove Programs on Windows Vista). The cached installer packages are kept in full size, increasing storage requirements unnecessarily.

Both paragraphs above summarizes the information at "https://blogs.msdn.microsoft.com/heaths/2009/02/02/changes-to-package-caching-in-windows-installer-5-0/".

After some Internet searching, I found that .msi files can contain another .msi file and can be chained to run sequentially (see "https://docs.microsoft.com/pt-br/windows/desktop/Msi/multiple-package-installations", "https://docs.microsoft.com/pt-br/windows/desktop/Msi/concurrent-installations", and "http://wixtoolset.org/documentation/manual/v3/bundle/"). Therefore, it should be possible to build two .msi packages:

* "LibreOffice_inner.msi" + "LibreOffice_inner.cab", it's the main LibreOffice .msi package that will be installed, and which would go inside of:
* "LibreOffice_outer.msi", which would be downloaded from www.libreoffice.org and be visible to the user.

The idea is that the user only deals with the "LibreOffice_outer.msi" package, which would extract "LibreOffice_outer.msi" and "LibreOffice_inner.cab" to the %Temp% folder, pass all the install properties/features the user selected (either by the GUI, the command line or by a transform .mst file) to it, then only the bundled/chained package would be installed. Therefore, Windows Installer 5 (on Windows 7 and newer) would only copy the stripped down "LibreOffice_inner.msi".

Although current hard disk drives are on the 500GB+ range, people who uses solid state drives (not my case) has a lot less storage space available. Also, people with HDDs would still benefit from the approximately 240MB free space, be it because of the space, or be it because it's less data to defragment or to mirror inside a backup or system image.

Steps to Reproduce:
1. Download LibreOffice for Windows, then install it.
2. Open \Windows\Installer folder (it's hidden by default).
3. Find the .msi file related to LibreOffice (it has a random hex name) by righ-clicking it, then Properties, Details (it will have "LibreOffice" as its subject property).
4. Open the found .msi file with 7-Zip, then check its properties (Info button at toolbar).
4. Check the file size: It's exactly the same as the downloaded file.

Actual Results:
The cached LibreOffice .msi file inside Windows\Installer folder is the same size as the downloaded LibreOffice .msi file because it has the libreoffice1.cab inside of it.

Expected Results:
It would be better if the cached file was minimal, without the .cab file inside of it.


Reproducible: Always


User Profile Reset: No



Additional Info:
Although Windows Installer 5 (from Windows 7 and newer) doesn't strip the .msi file from its internal .cab file, there is a way to author the .msi file so the cached .msi file doesn't have the .cab file embedded.
Comment 1 João Paulo 2019-01-20 05:12:04 UTC
Created attachment 148446 [details]
LibreOffice properties as shown by 7-Zip

This file shows "LibreOffice_6.1.4.2_Win_x86.msi" properties shown by 7-Zip. It's also the same properties found on the cached <random hex name>.msi file inside \Windows\Installer.
Comment 2 João Paulo 2019-01-20 05:15:52 UTC
Created attachment 148447 [details]
Cached LibreOffice.msi properties as shown by 7-Zip

This file is the cached <random hex name>.msi file inside \Windows\Installer folder. Its contents and properties are exactly the same as the LibreOffice_<version_information>.msi downloaded from www.libreoffice.org, when it should be smaller to avoid consuming storage.
Comment 3 João Paulo 2019-01-20 09:27:53 UTC
LibreOffice 3.4.6.2 x86 for Windows was the last version which the installer (an .exe file) had a stripped down .msi file and an external .cab file (it's possibile to open the .exe file with 7-Zip to verify it) and so the cached file at \Windows\Installer folder was minimal, without the .cab file.

The main installer was a .exe file, so it was easier to do (Windows Installer has its quirks to do a .msi chained installation), but the links on the first comment teach it's possible to do the same with a .msi file.
Comment 4 Mike Kaganski 2019-01-21 07:50:35 UTC
Hi!

Although I understand the rationale behind the proposal, unfortunately, this request should not be implemented.

The three links mentioned in comment 0, that relate to technologies used for chained installs, all relate to different technologies:

1. https://docs.microsoft.com/en-us/windows/desktop/Msi/multiple-package-installations
This is about "Multiple-Package installations", a technology that is explicitly marked incompatible with Windows Server with RDP (a scenario quite common among users of LibreOffice). It requires to create an executable that will be embedded inside the main MSI, which will provide a complex functionality required for complex transactional processing. And while the mentioned problems limit compatibility and increase maintenance cost, it's unclear how to make all this packaged into a single download (the documentation only mentions packaging the installer functions, which is different from packaging MSIs; and if MSIs were packaged inside the primary MSI, then it's unclear how they would be split from their CABs), unless a bootstrap used (see #3 below), which would increase complexity and maintenance cost even more. Since this would require a bootstrap anyway, I would dismiss this approach from the beginning. To mention one last concert with this approach, I'm not sure that this will not *increase* the total disk cost, because Windows Installer would need to cache both original MSI, and embedded MSI.

2. https://docs.microsoft.com/en-us/windows/desktop/Msi/concurrent-installations
This is marked "Deprecated"; "Do not use concurrent installations to install products that are intended to be released to the public". And see the last remark to #1 wrt size savings doubts.

3. http://wixtoolset.org/documentation/manual/v3/bundle/
WIX' Burn is an EXE which packs some other files (possibly including MSIs) inside, like a self-extracting ZIP, with advanced installer-related capabilities. This is absolutely like LibreOffice was packaged before 3.5.Using this increases complexity for corporate deployments, since this would require system administrators who want to deploy LO in AD domains using GPO to extract the contents, and GPOs would be non-trivial, if working at all; and increases maintenance cost. I'm not sure if this was the reason for our move at the time of 3.5 (Andras is already in CC, so he can clarify or correct me if I'm wrong), but IMO (as an ex-sysadmin with AD domains experience) that alone is a serious problem to avoid reverting to .EXE-based installer.

I don't mention an option to provide simple ZIPs with split installers inside, because that brings additional complexity to end users (non-corporate), and an option for providing different packages for different scenarios (because that would increase maintenance cost for TDF tremendously).

I close this WONTFIX because of the explained problems of the approach. Of course, you are welcome to continue discussion here or in development mailing list.
Comment 5 João Paulo 2019-01-21 17:05:11 UTC
Wow, thanks for the info! I didn't know all that. And I agree it's not good to provide .zip files with split installers nor providing different packages for different scenarios (it not only creates extra complexity, but also duplicates the storage space needed to provide each new LibreOffice version).

Anyway, I found a workaround: First make an administrative install folder (the "/A" option passed to msiexec.exe extracts everything to a folder, including the **stripped down** .msi file) and then use the administrative install folder to install LibreOffice.

Unfortunately, the workaround creates some undesired side effects
:
(a) The digital signatures for the .msi file are invalidated (not a problem to my configured machines and users, but can be for someone else);
(b) More storage space (on the server or on the client machine) is needed to deploy LibreOffice. It can be a problem, as the administrative install folder for LibreOffice 6.1.4.2 x64 alone is 1.172.491.255 bytes, against 283.185.152 bytes of the .msi which has a compressed .cab file, and not all installs can be made through a fast network or any network at all (slow network means it's better to use the compressed .msi file with embedded .cab file or even a physical media as a pen-drive or portable HDD);
(c) If there is not enough storage on the server or the setup media or fast enough network connection to serve the administrative install folder, then it will be needed more time to complete setup (not a problem if using a portable HDD as it appears only when installing, which is not frequent -- but is a problem through a slow network connection).

But then the completed setup uses less space (as the cached .msi file inside \Windows\Installer folder is the stripped down without the internal .cab file). The cached .msi file is now just 20.336.640 bytes (or 11.943.936 bytes if NTFS compression on that folder is enabled), vs. the original size of 283.185.152 bytes (or 274.460.672 bytes if NTFS compression is enabled) after installing LibreOffice 6.1.4.2 x64.

I adapted my previous install script (I use a .cmd file on every deployment) to use this new logic and I'll copy (a stripped down version of) it here (I don't know a better place to publish a workaround):

@Echo Off
SetLocal EnableExtensions EnableDelayedExpansion
PushD "%~dp0"

Set MSI-x86=x86\LibreOffice_6.1.4.2_Win_x86
Set MSI-x64=x64\LibreOffice_6.1.4.2_Win_x64

REM code to install x86 binaries on x86 or x64 processor / in case there is no x64 setup file to install on a x64 machine, but there is a x86 file

REM %ProgramFiles2% is needed as %ProgramFiles(x86)% don't work when used with "If ( ) Else" because of the parenthesis.
Set ProgramFiles2=%ProgramFiles%
Set CommonProgramFiles2=%CommonProgramFiles%
If Defined ProgramFiles(x86) Set ProgramFiles2=%ProgramFiles(x86)%
If Defined CommonProgramFiles(x86) Set CommonProgramFiles2=%CommonProgramFiles(x86)%

If "%Processor_Architecture%" == "AMD64" If Exist "%MSI-x64%.msi" (
  Call :Installer "%MSI-x64%.msi" "%ProgramFiles%"
) Else If Exist "%MSI-x86%.msi" Call :Installer "%MSI-x86%.msi" "%ProgramFiles2%"
If "%Processor_Architecture%" == "x86" Call :Installer "%MSI-x86%.msi" "%ProgramFiles%"

GoTo :End

:Installer
  Start "" /Wait MsiExec.exe /A "%~1" TARGETDIR="%Temp%\LibreOffice" /Quiet /NoRestart
  If Exist "%Temp%\LibreOffice\%~nx1" (
    Start "" /Wait MsiExec.exe /Package "%Temp%\LibreOffice\%~nx1" /Passive /NoRestart ADDLOCAL=ALL CREATEDESKTOPLINK=0 QUICKSTART=0 REGISTER_NO_MSO_TYPES=0 REMOVE=gm_o_Pyuno_LibreLogo,gm_o_Quickstart,gm_o_Activexcontrol,gm_Reportbuilder,gm_o_Extensions,gm_r_ex_Dictionary_Af,gm_r_ex_Dictionary_An,gm_r_ex_Dictionary_Ar,gm_r_ex_Dictionary_Be,gm_r_ex_Dictionary_Bg,gm_r_ex_Dictionary_Bn,gm_r_ex_Dictionary_Pt_Pt,gm_r_ex_Dictionary_Br,gm_r_ex_Dictionary_Bs,gm_r_ex_Dictionary_Ca,gm_r_ex_Dictionary_Bo,gm_r_ex_Dictionary_Cs,gm_r_ex_Dictionary_Da,gm_r_ex_Dictionary_Nl,gm_r_ex_Dictionary_En,gm_r_ex_Dictionary_Et,gm_r_ex_Dictionary_Fr,gm_r_ex_Dictionary_Gd,gm_r_ex_Dictionary_Gl,gm_r_ex_Dictionary_Gu,gm_r_ex_Dictionary_De,gm_r_ex_Dictionary_He,gm_r_ex_Dictionary_Hi,gm_r_ex_Dictionary_Hu,gm_r_ex_Dictionary_Hr,gm_r_ex_Dictionary_It,gm_r_ex_Dictionary_Is,gm_r_ex_Dictionary_Lt,gm_r_ex_Dictionary_Lo,gm_r_ex_Dictionary_Lv,gm_r_ex_Dictionary_Ne,gm_r_ex_Dictionary_No,gm_r_ex_Dictionary_Oc,gm_r_ex_Dictionary_Pl,gm_r_ex_Dictionary_Ro,gm_r_ex_Dictionary_Ru,gm_r_ex_Dictionary_Si,gm_r_ex_Dictionary_Sq,gm_r_ex_Dictionary_Sr,gm_r_ex_Dictionary_Sk,gm_r_ex_Dictionary_Sl,gm_r_ex_Dictionary_El,gm_r_ex_Dictionary_Es,gm_r_ex_Dictionary_Sv,gm_r_ex_Dictionary_Te,gm_r_ex_Dictionary_Th,gm_r_ex_Dictionary_Uk,gm_r_ex_Dictionary_Vi,gm_r_ex_Dictionary_Zu,gm_Langpack_r_af,gm_Langpack_r_am,gm_Langpack_r_ar,gm_Langpack_r_as,gm_Langpack_r_ast,gm_Langpack_r_be,gm_Langpack_r_bg,gm_Langpack_r_bn,gm_Langpack_r_bn_IN,gm_Langpack_r_bo,gm_Langpack_r_br,gm_Langpack_r_brx,gm_Langpack_r_bs,gm_Langpack_r_ca,gm_Langpack_r_ca_valencia,gm_Langpack_r_cs,gm_Langpack_r_cy,gm_Langpack_r_da,gm_Langpack_r_de,gm_Langpack_r_dgo,gm_Langpack_r_dz,gm_Langpack_r_el,gm_Langpack_r_en_GB,gm_Langpack_r_en_US,gm_Langpack_r_en_ZA,gm_Langpack_r_eo,gm_Langpack_r_es,gm_Langpack_r_et,gm_Langpack_r_eu,gm_Langpack_r_fa,gm_Langpack_r_fi,gm_Langpack_r_fr,gm_Langpack_r_ga,gm_Langpack_r_gd,gm_Langpack_r_gl,gm_Langpack_r_gu,gm_Langpack_r_gug,gm_Langpack_r_he,gm_Langpack_r_hi,gm_Langpack_r_hr,gm_Langpack_r_hsb,gm_Langpack_r_hu,gm_Langpack_r_id,gm_Langpack_r_is,gm_Langpack_r_it,gm_Langpack_r_ja,gm_Langpack_r_ka,gm_Langpack_r_kk,gm_Langpack_r_km,gm_Langpack_r_kmr_Latn,gm_Langpack_r_kn,gm_Langpack_r_ko,gm_Langpack_r_kok,gm_Langpack_r_ks,gm_Langpack_r_lb,gm_Langpack_r_lb,gm_Langpack_r_lo,gm_Langpack_r_lt,gm_Langpack_r_lv,gm_Langpack_r_mai,gm_Langpack_r_mk,gm_Langpack_r_ml,gm_Langpack_r_mn,gm_Langpack_r_mni,gm_Langpack_r_mr,gm_Langpack_r_my,gm_Langpack_r_nb,gm_Langpack_r_ne,gm_Langpack_r_nl,gm_Langpack_r_nn,gm_Langpack_r_nr,gm_Langpack_r_nso,gm_Langpack_r_oc,gm_Langpack_r_om,gm_Langpack_r_or,gm_Langpack_r_pa_IN,gm_Langpack_r_pl,gm_Langpack_r_pt,gm_Langpack_r_ro,gm_Langpack_r_ru,gm_Langpack_r_rw,gm_Langpack_r_sa_IN,gm_Langpack_r_sat,gm_Langpack_r_sd,gm_Langpack_r_si,gm_Langpack_r_sid,gm_Langpack_r_sk,gm_Langpack_r_sl,gm_Langpack_r_sq,gm_Langpack_r_sr,gm_Langpack_r_sr_Latn,gm_Langpack_r_ss,gm_Langpack_r_st,gm_Langpack_r_sv,gm_Langpack_r_sw_TZ,gm_Langpack_r_ta,gm_Langpack_r_te,gm_Langpack_r_tg,gm_Langpack_r_th,gm_Langpack_r_tn,gm_Langpack_r_tr,gm_Langpack_r_ts,gm_Langpack_r_tt,gm_Langpack_r_ug,gm_Langpack_r_uk,gm_Langpack_r_uz,gm_Langpack_r_ve,gm_Langpack_r_vec,gm_Langpack_r_vi,gm_Langpack_r_xh,gm_Langpack_r_zh_CN,gm_Langpack_r_zh_TW,gm_Langpack_r_zu,gm_Langpack_r_kab,gm_Langpack_r_fy,gm_r_ex_Dictionary_Id
)
  REM Remove temporary installation folder
  If Exist "%Temp%\LibreOffice" (
    RmDir /s /q "%Temp%\LibreOffice"
  )
GoTo :End

:End

EndLocal