Commit 97548b01 authored by Alexander Alekhin's avatar Alexander Alekhin

FFmpeg: try to download wrapper with elevated privileges

parent df1f62b3
......@@ -12,6 +12,22 @@ Write-Output ("=" * 120)
Write-Output ""
if(![System.IO.File]::Exists($output)) {
try {
[io.file]::OpenWrite($output).close()
} catch {
Write-Warning "Unable to write: $output"
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "Launching with 'Administrator' elevated privileges..."
Pause
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
exit
} else {
Write-Output "FATAL: Unable to write with elevated privileges: $output"
Pause
exit 1
}
}
try {
Write-Output ("Downloading: " + $output)
Import-Module BitsTransfer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment