Files
management-scripts/Install-4KVideoDownloader.ps1
T

20 lines
860 B
PowerShell
Raw Normal View History

2021-05-27 17:40:13 -04:00
## Specify the URL to download the app from
2021-05-27 17:21:33 -04:00
$URL = 'https://dl.4kdownload.com/app/4kvideodownloader_4.16.0_x64.msi'
2021-05-27 17:40:13 -04:00
## Make sure the app isn't already installed
If (! (Test-Path "${Env:ProgramFiles}\4KDownload\4kvideodownloader\4kvideodownloader.exe") ) {
## Download the installer
2021-05-27 17:21:33 -04:00
$INSTALLER = Download-File -URL $URL
2021-05-27 17:40:13 -04:00
## Install the app
2023-10-05 13:11:38 -04:00
Write-Output "Installing 4K Video Downloader from ""${INSTALLER}"""
2021-05-27 17:21:33 -04:00
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart" -Wait }
2023-10-05 13:17:18 -04:00
Catch { Write-Error $_.Exception.Message }
2021-05-27 17:40:13 -04:00
## Delete the installer
2023-10-05 13:11:38 -04:00
Write-Output "Deleting downloaded installer from ""${INSTALLER}"""
2021-05-27 17:21:33 -04:00
Try { Remove-Item -Path $INSTALLER -Force -ErrorAction SilentlyContinue }
2023-10-05 13:17:18 -04:00
Catch { Write-Error $_.Exception.Message }
2021-05-27 17:43:04 -04:00
}
2023-10-05 13:11:38 -04:00
Else { Write-Output "4K Video Downloader is already installed!" }