I want to install CMake without any interaction. I tried this script, but there's no Install-FromMsi
on my PowerShell.
Is there a fix for that or an easier way to install CMake and put it into the PowerShell path just with scripts?
PS: how to call Install-CMake
with parameters?
UPDATE:
I followed https://silentinstallhq.com/cmake-silent-install-how-to-guide/ and tried
Write-Host "Installing Cmake..." -ForegroundColor Cyan
$exePath = "$env:TEMP\cmake.exe"
Write-Host "Downloading..."
(New-Object Net.WebClient).DownloadFile('https://github.com/Kitware/CMake/releases/download/v3.24.0/cmake-3.24.0-windows-x86_64.msi', $exePath)
Write-Host "Installing..."
MsiExec.exe /i $exePath ADD_CMAKE_TO_PATH=User /qn
but my Windows does not recognize the command MsiExec.exe
I changed to
Start-Process msiexec.exe -Wait -ArgumentList "/i $exePath ADD_CMAKE_TO_PATH=User /qn"
cmake --version
It looks like it installs but cmake --version
says that cmake
is not a command in PowerShell, so either it's not installing or not putting into PATH
.