mirror of
https://github.com/Egor00f/kolibrios-gcc-toolchain.git
synced 2025-01-15 05:46:04 +01:00
use powershell features for install toolchain && use powershell script in installer
Additions: + modules for download and unpacking package + use Write-Progress for show progress + update libs in for loop + use ps1 installer in setup installer, because it not need pre-installed depends + Add test for PowerShell install script Script not tested.
This commit is contained in:
parent
dfde28f76f
commit
2bfe470796
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: test
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -8,6 +8,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
#Test linux install script
|
#Test linux install script
|
||||||
linux-install:
|
linux-install:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -26,8 +27,8 @@ jobs:
|
|||||||
kos32-gcc -v
|
kos32-gcc -v
|
||||||
kos32-g++ -v
|
kos32-g++ -v
|
||||||
|
|
||||||
#Test windows install script
|
#Test Batch install script
|
||||||
windows-install:
|
batch-install:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -38,7 +39,16 @@ jobs:
|
|||||||
choco install 7zip
|
choco install 7zip
|
||||||
|
|
||||||
- name: Run script
|
- name: Run script
|
||||||
run: ${{ github.workspace }}/install.bat
|
run: ${{ github.workspace }}\install.bat
|
||||||
|
|
||||||
|
#Test PowerShell install script
|
||||||
|
PowerShell-install:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run script
|
||||||
|
run: ${{ github.workspace }}\install.ps1
|
||||||
|
|
||||||
#Test Windows Installer
|
#Test Windows Installer
|
||||||
build-Installer:
|
build-Installer:
|
||||||
|
177
install.ps1
177
install.ps1
@ -1,28 +1,42 @@
|
|||||||
@echo off
|
#Requires -RunAsAdministrator
|
||||||
|
|
||||||
$DEFAULT_TOOLCHAIN_DIR="C:\MinGW\msys\1.0\home\autobuild\tools"
|
if (!Get-Module -ListAvailable -Name 7Zip4PowerShell)
|
||||||
|
{
|
||||||
|
Install-Module -Name 7Zip4PowerShell
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$DEFAULT_InstallPath="C:\MinGW\msys\1.0\home\autobuild\tools"
|
||||||
PSStyle.Progress.View = 'Classic'
|
PSStyle.Progress.View = 'Classic'
|
||||||
|
$URL_TO_LIBS = "http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/"
|
||||||
|
|
||||||
if ()
|
$LIST_OF_LIBS = @{
|
||||||
{
|
'libdll.a',
|
||||||
$TOOLCHAIN_DIR=$DEFAULT_TOOLCHAIN_DIR
|
'libfreetype.a',
|
||||||
}
|
'libc.dll.a',
|
||||||
else
|
'libSDLn.a',
|
||||||
{
|
'libcurses.a',
|
||||||
$TOOLCHAIN_DIR=%1
|
'libz.dll.a',
|
||||||
|
'libogg.a',
|
||||||
|
'libvorbis.a',
|
||||||
|
'libopenjpeg.a'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
param (
|
||||||
|
[string] $InstallPath=$DEFAULT_InstallPath
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
$OuterLoopProgressParameters = @{
|
||||||
Activity = "Installing toolchain"
|
Activity = "Installing toolchain"
|
||||||
Status = "toolchain",
|
Status = "toolchain",
|
||||||
PercentComplete = 0,
|
PercentComplete = 0,
|
||||||
CurrentOperation = "Create the $TOOLCHAIN_DIR folder"
|
CurrentOperation = "Create the $InstallPath folder"
|
||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
mkdir $TOOLCHAIN_DIR
|
mkdir $InstallPath
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -34,7 +48,7 @@ $OuterLoopProgressParameters = @{
|
|||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -O $TOOLCHAIN_DIR\kos32-toolchain.7z
|
Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -OutFile $InstallPath\kos32-toolchain.7z
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
$OuterLoopProgressParameters = @{
|
||||||
Activity = "Installing toolchain"
|
Activity = "Installing toolchain"
|
||||||
@ -44,8 +58,7 @@ $OuterLoopProgressParameters = @{
|
|||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
7z x -y $TOOLCHAIN_DIR\kos32-toolchain.7z -o$TOOLCHAIN_DIR
|
Expand-7Zip -ArchiveFileName $InstallPath\kos32-toolchain.7z -TargetPath $InstallPath
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
$OuterLoopProgressParameters = @{
|
||||||
@ -56,10 +69,9 @@ $OuterLoopProgressParameters = @{
|
|||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
|
Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -OutFile $InstallPath\win32\mingw32\sdk-28-10-16.7z
|
||||||
|
|
||||||
wget http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -O $TOOLCHAIN_DIR\win32\mingw32\sdk-28-10-16.7z
|
# Unpack libs
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
$OuterLoopProgressParameters = @{
|
||||||
Activity = "Installing toolchain"
|
Activity = "Installing toolchain"
|
||||||
Status = "Installing libraries",
|
Status = "Installing libraries",
|
||||||
@ -68,115 +80,22 @@ $OuterLoopProgressParameters = @{
|
|||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
|
Expand-7Zip -ArchiveFileName $InstallPath\win32\mingw32\sdk-28-10-16.7z -TargetPath $InstallPath\win32\mingw32\
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Installing libraries",
|
for (($i = 0); $i -lt $LIST_OF_LIBS.count; $i++)
|
||||||
PercentComplete = 60,
|
{
|
||||||
CurrentOperation = "unpacking libraries"
|
$OuterLoopProgressParameters = @{
|
||||||
|
Activity = "Installing toolchain"
|
||||||
|
Status = "Updating libraries",
|
||||||
|
PercentComplete = 50+(49 * ($i / $LIST_OF_LIBS.count) ),
|
||||||
|
CurrentOperation = "download $($LIST_OF_LIBS[$i])"
|
||||||
|
}
|
||||||
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
|
Invoke-WebRequest $URL_TO_LIBS$LIST_OF_LIBS[$i] -OutFile $InstallPath\win32\mingw32\lib\$LIST_OF_LIBS[$i]
|
||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
7z x -y $TOOLCHAIN_DIR\win32\mingw32\sdk-28-10-16.7z
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 65,
|
|
||||||
CurrentOperation = "download libdll.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libdll.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libdll.a
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 67,
|
|
||||||
CurrentOperation = "download libfreetype.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libfreetype.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libfreetype.a
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 70,
|
|
||||||
CurrentOperation = "download libc.dll.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libc.dll.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libc.dll.a
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 75,
|
|
||||||
CurrentOperation = "download libSDLn.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libSDLn.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libSDLn.a
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 78,
|
|
||||||
CurrentOperation = "download libcurses.a "
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libcurses.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libcurses.a
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 82,
|
|
||||||
CurrentOperation = "download libz.dll.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libz.dll.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libz.dll.a
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 85,
|
|
||||||
CurrentOperation = "download libogg.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libogg.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libogg.a
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 88,
|
|
||||||
CurrentOperation = "download libvorbis.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libvorbis.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libvorbis.a
|
|
||||||
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Updating libraries",
|
|
||||||
PercentComplete = 95,
|
|
||||||
CurrentOperation = "download libopenjpeg.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
wget http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/libopenjpeg.a -O $TOOLCHAIN_DIR\win32\mingw32\lib\libopenjpeg.a
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -188,15 +107,5 @@ $OuterLoopProgressParameters = @{
|
|||||||
}
|
}
|
||||||
Write-Progress @OuterLoopProgressParameters
|
Write-Progress @OuterLoopProgressParameters
|
||||||
|
|
||||||
set PATH=%PATH%;$TOOLCHAIN_DIR%\win32\bin
|
|
||||||
|
|
||||||
$OuterLoopProgressParameters = @{
|
|
||||||
Activity = "Installing toolchain"
|
|
||||||
Status = "Done!",
|
|
||||||
PercentComplete = 100,
|
|
||||||
CurrentOperation = "download libdll.a"
|
|
||||||
}
|
|
||||||
Write-Progress @OuterLoopProgressParameters
|
|
||||||
|
|
||||||
|
|
||||||
Write-Information -MessageData "Installation was successful!"
|
Write-Information -MessageData "Installation was successful!"
|
||||||
|
@ -65,11 +65,11 @@ Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environmen
|
|||||||
Check: NeedsAddPath('{app}\win32\bin')
|
Check: NeedsAddPath('{app}\win32\bin')
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: ".\install.bat"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: ".\install.ps1"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: "{app}\install.bat"; description: "install script"; StatusMsg: "Installing toolchain"; Parameters: "{app}"; Flags: runhidden logoutput
|
Filename: "{app}\install.ps1"; description: "install script"; StatusMsg: "Installing toolchain"; Parameters: "-InstallPath {app}"; Flags: runhidden logoutput
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
|
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
|
||||||
|
Loading…
Reference in New Issue
Block a user