Skip to content

Commit

Permalink
Install MinGW (microsoft#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
brcrista committed Apr 6, 2018
1 parent 5a79970 commit 28018e7
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 4 deletions.
15 changes: 15 additions & 0 deletions images/win/scripts/Installers/Install-MinGW.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
################################################################################
## File: Install-MinGW.ps1
## Team: CI-X
## Desc: Install GNU tools for Windows to C:\tools\mingw64
################################################################################

Import-Module -Name PathHelpers -Force

choco install -y mingw
$installDir = "C:\tools\mingw64\bin"
Add-MachinePathItem $installDir

# Hard link mingw32-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux
New-Item -Path $installDir -ItemType HardLink -Name "make.exe" -Value "$installDir\mingw32-make.exe"
41 changes: 41 additions & 0 deletions images/win/scripts/Installers/Validate-MinGW.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
if (Get-Command -Name 'g++')
{
Write-Host "g++ is successfully installed:"
g++ --version | Write-Host
}
else
{
Write-Host "g++ is not on PATH"
exit 1
}

if (Get-Command -Name 'make')
{
Write-Host "make is successfully installed:"
make --version | Write-Host
}
else
{
Write-Host "make is not on PATH"
exit 1
}

# Adding description of the software to Markdown

# `g++ --version` gives output like:
# g++.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 5.3.0
# Copyright (C) 2015 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$SoftwareName = "MinGW"
$(g++ --version).Split([System.Environment]::NewLine)[0] -match "\d\.\d\.\d$"
$minGwVersion = $matches[0]

$Description = @"
_Version:_ $minGwVersion<br/>
_Environment:_
* PATH: contains location of the MinGW 'bin' directory
"@

Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
20 changes: 16 additions & 4 deletions images/win/vs2017-Server2016-Azure.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
"{{ template_dir }}/scripts/Installers/Update-AndroidSDK.ps1"
]
},
{
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-MysqlCli.ps1"
Expand Down Expand Up @@ -321,12 +321,18 @@
"{{ template_dir }}/scripts/Installers/Install-AzureModules.ps1"
]
},
{
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Update-DotnetTLS.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-MinGW.ps1"
]
},
{
"type": "windows-restart",
"restart_timeout": "30m"
Expand Down Expand Up @@ -409,18 +415,24 @@
"{{ template_dir }}/scripts/Installers/Validate-DotnetSDK.ps1"
]
},
{
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-MysqlCli.ps1"
]
},
{
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-DotnetTLS.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-MinGW.ps1"
]
},
{
"type": "file",
"source": "C:\\InstalledSoftware.md",
Expand Down

0 comments on commit 28018e7

Please sign in to comment.