1

How to install 7z from powershell to a specified directory? I am trying to do so using the msi/exe available here: https://www.7-zip.org/download.html

The installtion always gets happends to "C:/Program Files/7-zip" even with below command:

  msiexec /i "7z1604-x64.msi" TARGETDIR="C:\Downloads" /q

How can I choose the installation path?

Sayantan Ghosh
  • 998
  • 2
  • 9
  • 29
  • Are you sure about the msi property? If I'm not wrong it should be `INSTALLDIR` instead of `TARGETDIR` – Olaf Jun 05 '20 at 09:02

2 Answers2

0

It seems that msiexec /i doesn't respect TARGET parameret but try Administrative Installation:

msiexec /a "7z1604-x64.msi" TARGETDIR="C:\Downloads" /q

Install msi with msiexec in a Specific Directory

But why somebody still needs 2016 version 7z in 2020?

lain0
  • 89
  • 3
  • 5
0

The easy to do this :

msiexec.exe /i https://www.7-zip.org/a/7z2201-x64.msi
grepit
  • 21,260
  • 6
  • 105
  • 81