From 9cd3a05980d940e03066b22112611cfd7b3a14c9 Mon Sep 17 00:00:00 2001 From: Egor00f Date: Tue, 19 Nov 2024 21:33:11 +0500 Subject: [PATCH] fix choco package install choco package installing, but cant delete toolchain --- .github/workflows/test.yml | 5 +++++ .gitignore | 3 ++- chocolatey/kos32-gcc.nuspec | 4 ++-- chocolatey/tools/chocolateyInstall.ps1 | 7 +++---- chocolatey/tools/chocolateyUninstall.ps1 | 4 +++- install.ps1 | 7 +++---- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 47e5dec..866ca5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -165,6 +165,11 @@ jobs: - name: Install package run: choco install ${{ github.workspace }}\build\choco-package.nupkg + + - name: Test + run: | + kos32-gcc -v + kos32-g++ -v - name: Remove package run: choco uninstall kos32-gcc diff --git a/.gitignore b/.gitignore index 22894a1..bd75751 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ package/DEBIAN/copyright package.deb build/ chocolatey/kos32-gcc*.nupkg -chocolatey/install.ps1 \ No newline at end of file +chocolatey/install.ps1 +chocolatey/tools/install.ps1 diff --git a/chocolatey/kos32-gcc.nuspec b/chocolatey/kos32-gcc.nuspec index 1456c97..f39252d 100644 --- a/chocolatey/kos32-gcc.nuspec +++ b/chocolatey/kos32-gcc.nuspec @@ -6,10 +6,10 @@ 0.1.5 Egor00f Egor00f - __REPLACE__ + idk _KolibriOS gcc toolchain installer. This package installing KolibriOS gcc toolchain by Serge. https://github.com/Egor00f/kolibrios-gcc-toolchain/ - kolibrios toolchain compiler c/C++ + kolibrios toolchain compiler C/C++ https://github.com/Egor00f/kolibrios-gcc-toolchain/blob/main/LICENSE false diff --git a/chocolatey/tools/chocolateyInstall.ps1 b/chocolatey/tools/chocolateyInstall.ps1 index 43ccc21..fa0527d 100644 --- a/chocolatey/tools/chocolateyInstall.ps1 +++ b/chocolatey/tools/chocolateyInstall.ps1 @@ -1,15 +1,14 @@ #NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one $packageName = 'kos32-gcc' # arbitrary name for the package, used in messages -$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx # main helpers - these have error handling tucked into them already # installer, will assert administrative rights -Install-ChocolateyPackage "$packageName" -validExitCodes $validExitCodes $INSTALL_PATH = Read-Host 'Path to install toolchain(Enter - default)' -.\install.ps1 -InstallPath $INSTALL_PATH +C:\ProgramData\Chocolatey\lib\kos32-gcc\tools\install.ps1 + +Out-File -FilePath C:\ProgramData\Chocolatey\lib\kos32-gcc\install-path -InputObject $INSTALL_PATH -$env:KOS32GCCPATH = $INSTALL_PATH \ No newline at end of file diff --git a/chocolatey/tools/chocolateyUninstall.ps1 b/chocolatey/tools/chocolateyUninstall.ps1 index 1a0e319..33802c6 100644 --- a/chocolatey/tools/chocolateyUninstall.ps1 +++ b/chocolatey/tools/chocolateyUninstall.ps1 @@ -1,2 +1,4 @@ -rm $env:KOS32GCCPATH -r -f +$installPath = Get-Content C:\ProgramData\Chocolatey\lib\kos32-gcc\install-path | Out-String | ConvertFrom-StringData + +Remove-Item -LiteralPath $installPath -Force -Recurse diff --git a/install.ps1 b/install.ps1 index 120f5ed..6cc03de 100644 --- a/install.ps1 +++ b/install.ps1 @@ -15,17 +15,17 @@ $LIBS_PATH = '$InstallPath\win32\mingw32\lib\' $LIBS_URL = 'http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/' -Write-Progress -Activity 'Installing toolchain' -Status 'toolchain' -PercentComplete 0 -CurrentOperation 'Create the $InstallPath folder' +Write-Progress -Activity 'Installing toolchain' -Status 'Installing toolchain' -PercentComplete 0 -CurrentOperation 'Create the $InstallPath folder' mkdir $InstallPath -Force -Write-Progress -Activity 'Installing toolchain' -Status 'toolchain' -PercentComplete 1 -CurrentOperation 'Download the kos32-gcc toolchain' +Write-Progress -Activity 'Installing toolchain' -Status 'Installing toolchain' -PercentComplete 1 -CurrentOperation 'Download the kos32-gcc toolchain' Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -OutFile $InstallPath\kos32-toolchain.7z -Write-Progress -Activity 'Installing toolchain' -Status 'toolchain' -PercentComplete 20 -CurrentOperation 'Unpacking kos32-gcc toolchain' +Write-Progress -Activity 'Installing toolchain' -Status 'Installing toolchain' -PercentComplete 20 -CurrentOperation 'Unpacking kos32-gcc toolchain' Expand-7Zip -ArchiveFileName $InstallPath\kos32-toolchain.7z -TargetPath $InstallPath @@ -55,4 +55,3 @@ foreach( $file in $files ) { Write-Progress -Activity 'Installing toolchain' -Status 'Done!' -PercentComplete 99 -CurrentOperation "end" -$env:Path += ';$InstallPath\win32\bin'