Skip to content
Snippets Groups Projects
Unverified Commit 3afa9201 authored by jiangjianshan's avatar jiangjianshan Committed by GitHub
Browse files

[install.ps1] Change permission of the downloaded binary (#2308)

Fix #2256 
parent 32c493e9
No related branches found
Tags 0.25.0
No related merge requests found
......@@ -43,7 +43,11 @@ function download {
$url="https://github.com/junegunn/fzf/releases/download/$version/$file"
$temp=$env:TMP + "\fzf.zip"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object Net.WebClient).DownloadFile($url, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$temp"))
if ($PSVersionTable.PSVersion.Major -ge 3) {
Invoke-WebRequest -Uri $url -OutFile $temp
} else {
(New-Object Net.WebClient).DownloadFile($url, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$temp"))
}
if ($?) {
(Microsoft.PowerShell.Archive\Expand-Archive -Path $temp -DestinationPath .); (Remove-Item $temp)
} else {
......@@ -53,7 +57,7 @@ function download {
$binary_error="Failed to download $file"
return
}
check_binary >$null
echo y | icacls $fzf_base\bin\fzf.exe /grant Administrator:F ; check_binary >$null
}
download "fzf-$version-windows_amd64.zip"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment