I tried TARGETDIR
, INSTALLLOCATION
and INSTALLDIR
args and still it installed in the default directory.
So I viewed the log and there is this arg where it sets the Application Directory and it is being set to default.
MSI (s) (50:94) [09:03:13:374]: Running product '{BDAFD18D-0395-4E72-B295-1EA66A7B80CF}' with elevated privileges: Product is assigned.
MSI (s) (50:94) [09:03:13:374]: PROPERTY CHANGE: Adding APPDIR property. Its value is 'E:\RMP2'.
MSI (s) (50:94) [09:03:13:374]: PROPERTY CHANGE: Adding CURRENTDIRECTORY property. Its value is 'C:\Users\Administrator'.
So I changed the command to have APPDIR
instead of the args mentioned above. It worked like a charm.
msiexec /i "path_to_msi" APPDIR="path_to_installation_dir" /q
Add /lv
if you want to copy the installation progress to a logfile.