Fixed LibreOffice installations

This commit is contained in:
2Shirt 2019-05-10 17:28:21 -06:00
parent 3bb2100dcd
commit a9c874d79e
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -235,10 +235,9 @@ def install_libreoffice(
use_mso_formats=False, vcredist=False):
"""Install LibreOffice using specified settings."""
cmd = [
r'{}\Installers\Extras\Office\LibreOffice.msi'.format(
'msiexec', '/passive', '/norestart',
'/i', r'{}\Installers\Extras\Office\LibreOffice.msi'.format(
global_vars['BaseDir']),
'/qn',
'/norestart',
'REBOOTYESNO=No',
'ISCHECKFORPRODUCTUPDATES=0',
'QUICKSTART={}'.format(1 if quickstart else 0),
@ -249,11 +248,12 @@ def install_libreoffice(
cmd.append('REGISTER_ALL_MSO_TYPES=1')
else:
cmd.append('REGISTER_NO_MSO_TYPES=1')
xcu_file = r'{APPDATA}LibreOffice\4\user\registrymodifications.xcu'.format(
**global_vars)
xcu_dir = r'{APPDATA}\LibreOffice\4\user'.format(**global_vars['Env'])
xcu_file = r'{}\registrymodifications.xcu'.format(xcu_dir)
# Set default save format
if use_mso_formats and not os.path.exists(xcu_file):
os.makedirs(xcu_dir, exist_ok=True)
with open(xcu_file, 'w', encoding='utf-8', newline='\n') as f:
f.write(LIBREOFFICE_XCU_DATA)