Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I specify the target directory for the LibreOffice 4.0.2.2 .msi installation?

The .msi file is here: http://downloadarchive.documentfoundation.org/libreoffice/old/4.0.2.2/win/x86/LibreOffice_4.0.2.2_Win_x86.msi

The following script installs LibreOffice in C:\Program Files (x86):

msiexec.exe /qn /norestart /Lime .Npackd\InstallMSI.log /i ".Npackd\LibreOffice_4.0.2.2_Win_x86.msi" TARGETDIR="C:\Users\t\Downloads" ALLUSERS=1 MSIFASTINSTALL=7
share|improve this question

migrated from stackoverflow.com Apr 14 '13 at 18:12

This question came from our site for professional and enthusiast programmers.

    
Try passing the TARGETDIR option prior to the /i option; there may be some odd precedence behavior there. The .msi file may also be built in such a way that its target directory can't be overridden on the command line; in that case you'd need to unpack the .msi's contents, modify the target directory, and then repack the modified contents into a new .msi file. – Aaron Miller Apr 17 '13 at 18:42
    
...also, if you're trying to do a user-specific install, why specify the ALLUSERS option? – Aaron Miller Apr 17 '13 at 18:43
1  
C:\Users\t\Downloads is just for testing. It could be anything like F:\LibreOffice. The application should be installed for all users. – kaboom Apr 17 '13 at 18:47
    
What version of Windows are you using? – ChimneyImp Apr 17 '13 at 19:22
    
I test it on an XP VM. Let me know if you could make it work at least on one Windows version. – kaboom Apr 18 '13 at 17:25
up vote 2 down vote accepted
+50

It looks like LibreOffice wants to use INSTALLLOCATION instead of TARGETDIR, according to their wiki.

Try this: msiexec.exe /qn /norestart /Lime .Npackd\InstallMSI.log /i ".Npackd\LibreOffice_4.0.2.2_Win_x86.msi" INSTALLLOCATION="C:\Users\t\Downloads" ALLUSERS=1 MSIFASTINSTALL=7

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .