-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_nightly.ps1
19 lines (17 loc) · 979 Bytes
/
install_nightly.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process pwsh.exe -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
exit;
}
$source = 'https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip'
$path = [Environment]::GetFolderPath("LocalApplicationData")
$destination = "$path\nvim\nvim-win64.zip"
Invoke-WebRequest $source -OutFile $destination
Remove-Item "$path\nvim\nvim-win64" -Recurse
[IO.Compression.Zipfile]::ExtractToDirectory($destination, "$path\nvim\nvim-win64")
Remove-Item $destination
$source_dir = "$path\nvim\nvim-win64\*"
$program_files = [Environment]::GetFolderPath("ProgramFiles")
$install_dir = "$program_files\Neovim"
Remove-Item $install_dir -Recurse
Copy-Item -Path $source_dir -Destination $install_dir -Recurse
Remove-Item $source_dir -Recurse