How to install MSI to custom directory using msiexec?

0

1

Here's my attempt to install .msi using msiexec in Administrative PowerShell on Windows 10.

I've made it 7 times for each of 2 drives, C: and D: (14 total) with different arguments in place of ARG and the same desirable path value.

Template: PS C:\WINDOWS\system32> msiexec /i D:\users\username\downloads\soft\publisher\softwarename\software.msi /passive ARG="D:\Soft\publisher\softwarename"

ARGs:

  • TARGETDIR, INSTALLDIR, INSTALLPATH, INSTALLFOLDER, INSTALLLOCATION, APPLICATIONFOLDER, APPDIR
    • When running on the same drive as set in the parameter: installs on this drive in a default folder (e.g. D:\Blender Foundation\Blender\2.81\)
    • When running from a differnet drive: seems to do nothing

Is there a workaround to this behavior?

Update 1

Tested it on another .msi package (Blender 2.81), because previous was built incorrectly. None of the argument names listed above did the trick. Every install even from a D: drive was on default folder on C:.

Update 2

For Blender 2.81, as, I suppose, for any .msi packed with WiX, it was INSTALL_ROOT. You could try msiexec /lp! <msi_property_logfile> /i <msi_name> for any .msi to find out the name of the installation path argument. Thanks to YenForYang and his answer here.

VELFR

Posted 2020-02-02T15:55:47.263

Reputation: 121

1

I think you misunderstand the way msiexec /a works. Please read https://stackoverflow.com/questions/5564619/what-is-the-purpose-of-administrative-installation-initiated-using-msiexec-a and you will see that the parameter /a is not for installing at all.

– Robert – 2020-02-02T17:00:30.060

@Robert thank you. Tested it with /i - now it does nothing in every occasion. – VELFR – 2020-02-02T17:12:59.030

This question could lead to a solution: https://stackoverflow.com/questions/2366480/detect-msi-parameters-for-unattended-install

– VELFR – 2020-02-03T10:17:37.387

No answers