mirror of
https://github.com/KiTTYsh/dotfiles.git
synced 2025-12-09 20:59:16 -05:00
initenv: install vim using winget
This commit is contained in:
20
initenv.ps1
20
initenv.ps1
@@ -5,22 +5,19 @@ if (!(Get-Module -ListAvailable -Name Microsoft.WinGet.Client)) {
|
|||||||
Install-Module -Name Microsoft.WinGet.Client -Repository "PSGallery"
|
Install-Module -Name Microsoft.WinGet.Client -Repository "PSGallery"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get installed applications so that we can identify what needs to be installed
|
|
||||||
$InstalledApplications = Get-WmiObject -Class Win32_Product
|
|
||||||
|
|
||||||
# Install PowerShell Core
|
# Install PowerShell Core
|
||||||
if (!(Get-WinGetPackage -Source "winget" -MatchOption "Equals" -Id "Microsoft.PowerShell")) {
|
if (!(Get-WinGetPackage -Source "winget" -MatchOption "Equals" -Id "Microsoft.PowerShell")) {
|
||||||
Write-Host "Installing PowerShell Core"
|
Write-Host "Installing PowerShell Core"
|
||||||
Install-WinGetPackage -Source "winget" -MatchOption "Equals" -Id "Microsoft.PowerShell" -Override "/passive ENABLE_PSREMOTING=1 ADD_PATH=1"
|
Install-WinGetPackage -Source "winget" -MatchOption "Equals" -Id "Microsoft.PowerShell" -Override "/passive ENABLE_PSREMOTING=1 ADD_PATH=1"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Vim90
|
# Install vim
|
||||||
if (-not (Test-Path 'C:\Program Files\Vim\vim90\vim.exe')) {
|
if (!(Get-WinGetPackage -Source "winget" -MatchOption "Equals" -Id "vim.vim")) {
|
||||||
echo "Installing Vim90"
|
Write-Host "Installing vim"
|
||||||
|
# Vim configuration during install uses options set in registry from last reinstall
|
||||||
# Create registry key if it doesn't already exist
|
# Create registry key if it doesn't already exist
|
||||||
if (-not (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0')) {
|
if (-not (Test-Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.1')) {
|
||||||
New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Force | Out-Null
|
New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.1' -Force | Out-Null
|
||||||
}
|
}
|
||||||
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name AllowSilent -Value 1 -PropertyType DWORD -Force | Out-Null
|
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name AllowSilent -Value 1 -PropertyType DWORD -Force | Out-Null
|
||||||
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_batch -Value 1 -PropertyType DWORD -Force | Out-Null
|
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_batch -Value 1 -PropertyType DWORD -Force | Out-Null
|
||||||
@@ -32,10 +29,7 @@ if (-not (Test-Path 'C:\Program Files\Vim\vim90\vim.exe')) {
|
|||||||
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_pluginvim -Value 0 -PropertyType DWORD -Force | Out-Null
|
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_pluginvim -Value 0 -PropertyType DWORD -Force | Out-Null
|
||||||
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_startmenu -Value 1 -PropertyType DWORD -Force | Out-Null
|
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_startmenu -Value 1 -PropertyType DWORD -Force | Out-Null
|
||||||
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_vimrc -Value 1 -PropertyType DWORD -Force | Out-Null
|
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.0' -Name select_vimrc -Value 1 -PropertyType DWORD -Force | Out-Null
|
||||||
cd "$env:USERPROFILE\Downloads"
|
Install-WinGetPackage -Source "winget" -MatchOption "Equals" -Id "vim.vim"
|
||||||
Invoke-WebRequest -Uri 'https://github.com/vim/vim-win32-installer/releases/download/v9.0.1882/gvim_9.0.1882_x64_signed.exe' -OutFile gvim.exe
|
|
||||||
.\gvim.exe /S | Out-Null
|
|
||||||
rm gvim.exe
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# sshd
|
# sshd
|
||||||
|
|||||||
Reference in New Issue
Block a user