-
Notifications
You must be signed in to change notification settings - Fork 30
/
Install-Cygwin.ps1
15 lines (15 loc) · 995 Bytes
/
Install-Cygwin.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Source: https://www.willhaley.com/blog/script-install-cygwin-windows/
New-Item "C:\CygwinX64" -ItemType Directory
Invoke-WebRequest "https://www.cygwin.com/setup-x86_64.exe" -OutFile "C:\CygwinX64\setup.exe"
$Cmd = "C:\CygwinX64\setup.exe --site='https://cygwin.mirror.constant.com' --no-shortcuts --no-desktop --quiet-mode --root='C:\cygwinX64\cygwin' --arch='x86_64' --local-package-dir='C:\cygwinX64\cygwin-packages' --prune-install --packages='mingw64-x86_64-gcc-g++,mingw64-i686-gcc-g++'"
Invoke-Expression -Command $Cmd
# Little hack to let Cygwin be installed correctly
while(-Not (Test-Path -Path "C:\CygwinX64\cygwin\var\log\setup.log" -PathType leaf) ){
Write-Host "[1/2] Cygwin install still pending..."
Start-Sleep -Seconds 15
}
while(-Not (Select-String -Path "C:\CygwinX64\cygwin\var\log\setup.log" -CaseSensitive -Pattern "Ending cygwin install") ){
Write-Host "[2/2] Cygwin install still pending..."
Start-Sleep -Seconds 15
}
Write-Host "[V] Cygwin installation finished."