diff --git a/.bin/Scripts/functions/setup.py b/.bin/Scripts/functions/setup.py index d90494ac..6e9fac29 100644 --- a/.bin/Scripts/functions/setup.py +++ b/.bin/Scripts/functions/setup.py @@ -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)