问题
I tried
msiexec /i "yarn-1.10.1.msi" TARGETDIR="C:\programs" /qb
It installed but not in TARGETDIR, did I miss something ?
回答1:
You can try the following command line instead:
msiexec.exe /i "yarn-1.10.1.msi" INSTALLDIR="C:\programs" /qb
- Standards Compliance: Installing underneath
%ProgramFiles%
is always recommended. Creativity in deployment is generally always overrated and usually causes unnecessary problems. However, you could have an SOE setup that requires custom paths? - Path Update: A per-user path variable is added to a folder that is not created by default (
%SystemDrive%\Users\[UserName]\AppData\Local\Yarn\bin
). It is by design. The application probably creates the folder when run.
Administrative Installation: TARGETDIR
is generally used during administrative installations (essentially a file extraction from the MSI) to specify the output directory for extracted files:
msiexec.exe /a yarn-1.10.1.msi TARGETDIR=D:\YarnExtractedFiles\
TARGETDIR: Without over-complicating too much, let me add two links with more information about TARGETDIR
(this is to try to make the answer helpful also for others - more "general and generic" info - what you might not need, but that you just might want to know):
- In WiX files, what does Name="SourceDir" refer to?
- Why does the TARGETDIR directory need a name?
来源:https://stackoverflow.com/questions/52727895/why-msiexec-targetdir-doesnt-seem-to-work