I want to install a msi with msiexec in a specific directory. I\'m using:
msiexec /i \"msi path\" INSTALLDIR=\"C:\\myfolder\" /qb
It is no
InstallShield 12
INSTALLDIRrepresents the main product installation directory for a regular Windows Installer–based (or InstallScript MSI) installation, such as the end user launching Setup.exe or your .msi database.
TARGETDIRrepresents the installation directory for an InstallScript installation, or for an administrative Windows Installer based installation (when the user runs Setup.exe or MsiExec.exe with the /a command-line switch).In an InstallScript MSI project, the InstallScript variable
MSI_TARGETDIRstores the target of an administrative installation.
Source: INSTALLDIR vs. TARGETDIR
Use APPLICATIONFOLDER="path" for latest msiexec
Use INSTALLLOCATION. When you have problems, use the /lv log.txt to dump verbose logs. The logs would tell you if there is a property change that would override your own options. If you already installed the product, then a second run might just update it without changing the install location. You will have to uninstall first (use the /x option).
Here's my attempt to install .msi using msiexec in Administrative PowerShell.
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 /a D:\users\username\downloads\soft\publisher\softwarename\software.msi /passive ARG="D:\Soft\publisher\softwarename"
ARGs:
TARGETDIR
ProgramFilesFolder (with an additional folders similar to the
default installation path, e.g.
D:\Soft\BlenderFoundation\Blender\ProgramFilesFolder\Blender
Foundation\Blender\2.81\) and a copy of the .msi at the target
folder.INSTALLDIR, INSTALLPATH, INSTALLFOLDER, INSTALLLOCATION, APPLICATIONFOLDER, APPDIR
D:\Blender Foundation\Blender\2.81\)This should work:
msiexec /i "msi path" TARGETDIR="C:\myfolder" /qb
msiexec /i "msi path" INSTALLDIR="C:\myfolder" /q
Only this variant worked well.