- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to install MSI file to the custom directory using PowerShell?
To install the MSI file to the custom directory using PowerShell, we can use the TARGETDIR, INSTALLDIR, INSTALLPATH, etc arguments for the custom path, depending upon the MSI file that it supports.
msiexec /i "C:\temp\7z1900-x64.msi" INSTALLDIR="D:\ProgramFiles\7zip" /quiet
The above command can be run into PowerShell and cmd both but you can’t control the process that to wait until the installation finishes. To control the above command, we can use the Start-Process cmdlet in PowerShell.
Start-Process -FilePath "C:\windows\system32\msiexec.exe" -ArgumentList "/i C:\temp\7z1900-x64.msi INSTALLDIR='D:\ProgramFiles\7zip' /quiet" -Wait
If the INSTALLDIR is not supported by the MSI file then you can use the other parameters as specified above or use the logs to check what is the parameter for the default path and apply the path there.
- Related Articles
- How to install the MSI file using PowerShell?
- How to install MSI file using batch file in PowerShell?
- How to install the MSI package using PowerShell DSC?
- How to install the PowerShell Active Directory module?
- How to uninstall the MSI package using PowerShell?
- How to retrieve the MSI package product code using PowerShell?
- How to install the Nuget Package using PowerShell?
- How to install DSC resources using PowerShell?
- How to install a certificate to the certificate store using PowerShell?
- How to Install the Azure CLI on Windows using PowerShell?
- How to install PowerShell Module?
- How to convert JSON file to CSV file using PowerShell?
- How to search in the file using PowerShell?
- How to edit the CSV file using PowerShell?
- How to mount the ISO file using PowerShell?

Advertisements