2

I tried

msiexec /i "yarn-1.10.1.msi" TARGETDIR="C:\programs" /qb

The software wwas installed, but not into TARGETDIR. Did I miss something?

Andreas
  • 5,050
  • 8
  • 42
  • 51
user310291
  • 35,095
  • 76
  • 252
  • 458
  • I just ran into the same issue on Windows 10 creating a batch installation job. Some installations are installed into `TARGETDIR`, others not. The `INSTALLDIR` solution from the accepted answer didn't work either. – Andreas Nov 11 '21 at 07:38

1 Answers1

3

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):

Stein Åsmul
  • 37,754
  • 24
  • 87
  • 158