20 lines
860 B
PowerShell
20 lines
860 B
PowerShell
## Specify the URL to download the app from
|
|
$URL = 'https://dl.4kdownload.com/app/4kvideodownloader_4.16.0_x64.msi'
|
|
|
|
## Make sure the app isn't already installed
|
|
If (! (Test-Path "${Env:ProgramFiles}\4KDownload\4kvideodownloader\4kvideodownloader.exe") ) {
|
|
|
|
## Download the installer
|
|
$INSTALLER = Download-File -URL $URL
|
|
|
|
## Install the app
|
|
Write-Output "Installing 4K Video Downloader from ""${INSTALLER}"""
|
|
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${INSTALLER} /qn /norestart" -Wait }
|
|
Catch { Write-Error $_.Exception.Message }
|
|
|
|
## Delete the installer
|
|
Write-Output "Deleting downloaded installer from ""${INSTALLER}"""
|
|
Try { Remove-Item -Path $INSTALLER -Force -ErrorAction SilentlyContinue }
|
|
Catch { Write-Error $_.Exception.Message }
|
|
}
|
|
Else { Write-Output "4K Video Downloader is already installed!" } |