Why msiexec TARGETDIR doesn't seem to work

我的未来我决定 提交于 2019-12-25 01:49:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!