2024-11-15 17:45:10 +01:00
|
|
|
#Requires -RunAsAdministrator
|
2024-11-14 17:26:34 +01:00
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
if (!Get-Module -ListAvailable -Name 7Zip4PowerShell)
|
|
|
|
{
|
|
|
|
Install-Module -Name 7Zip4PowerShell
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$DEFAULT_InstallPath="C:\MinGW\msys\1.0\home\autobuild\tools"
|
2024-11-14 17:26:34 +01:00
|
|
|
PSStyle.Progress.View = 'Classic'
|
2024-11-15 17:45:10 +01:00
|
|
|
$URL_TO_LIBS = "http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/"
|
2024-11-14 17:26:34 +01:00
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
$LIST_OF_LIBS = @{
|
|
|
|
'libdll.a',
|
|
|
|
'libfreetype.a',
|
|
|
|
'libc.dll.a',
|
|
|
|
'libSDLn.a',
|
|
|
|
'libcurses.a',
|
|
|
|
'libz.dll.a',
|
|
|
|
'libogg.a',
|
|
|
|
'libvorbis.a',
|
|
|
|
'libopenjpeg.a'
|
2024-11-14 17:26:34 +01:00
|
|
|
}
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
param (
|
|
|
|
[string] $InstallPath=$DEFAULT_InstallPath
|
|
|
|
)
|
2024-11-14 17:26:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "toolchain",
|
|
|
|
PercentComplete = 0,
|
2024-11-15 17:45:10 +01:00
|
|
|
CurrentOperation = "Create the $InstallPath folder"
|
2024-11-14 17:26:34 +01:00
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
mkdir $InstallPath
|
2024-11-14 17:26:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "toolchain",
|
|
|
|
PercentComplete = 1,
|
|
|
|
CurrentOperation = "Download the kos32-gcc toolchain"
|
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -OutFile $InstallPath\kos32-toolchain.7z
|
2024-11-14 17:26:34 +01:00
|
|
|
|
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "toolchain",
|
|
|
|
PercentComplete = 20,
|
|
|
|
CurrentOperation = "Unpacking kos32-gcc toolchain"
|
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
Expand-7Zip -ArchiveFileName $InstallPath\kos32-toolchain.7z -TargetPath $InstallPath
|
2024-11-14 17:26:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "Installing libraries",
|
|
|
|
PercentComplete = 40,
|
|
|
|
CurrentOperation = "Downloading libraries"
|
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -OutFile $InstallPath\win32\mingw32\sdk-28-10-16.7z
|
2024-11-14 17:26:34 +01:00
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
# Unpack libs
|
2024-11-14 17:26:34 +01:00
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "Installing libraries",
|
|
|
|
PercentComplete = 50,
|
|
|
|
CurrentOperation = "Downloading libraries"
|
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
Expand-7Zip -ArchiveFileName $InstallPath\win32\mingw32\sdk-28-10-16.7z -TargetPath $InstallPath\win32\mingw32\
|
2024-11-14 17:26:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
for (($i = 0); $i -lt $LIST_OF_LIBS.count; $i++)
|
|
|
|
{
|
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "Updating libraries",
|
|
|
|
PercentComplete = 50+(49 * ($i / $LIST_OF_LIBS.count) ),
|
|
|
|
CurrentOperation = "download $($LIST_OF_LIBS[$i])"
|
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
2024-11-14 17:26:34 +01:00
|
|
|
|
2024-11-15 17:45:10 +01:00
|
|
|
Invoke-WebRequest $URL_TO_LIBS$LIST_OF_LIBS[$i] -OutFile $InstallPath\win32\mingw32\lib\$LIST_OF_LIBS[$i]
|
2024-11-14 17:26:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$OuterLoopProgressParameters = @{
|
|
|
|
Activity = "Installing toolchain"
|
|
|
|
Status = "Done!",
|
|
|
|
PercentComplete = 99,
|
|
|
|
CurrentOperation = "Adding C:\MinGW\msys\1.0\home\autobuild\tools\win32\bin to PATH"
|
|
|
|
}
|
|
|
|
Write-Progress @OuterLoopProgressParameters
|
|
|
|
|
|
|
|
|
|
|
|
Write-Information -MessageData "Installation was successful!"
|