diff --git a/GraalVM-17/graalvm-java17.nuspec b/GraalVM-17/graalvm-java17.nuspec new file mode 100644 index 0000000..b2fa4fd --- /dev/null +++ b/GraalVM-17/graalvm-java17.nuspec @@ -0,0 +1,20 @@ + + + + graalvm-java17 + 22.3.3 + https://github.com/johanjanssen/ChocolateyPackages/tree/master/GraalVM-Java17 + GraalVM Java 17 + Oracle + JohanJanssen + https://github.com/oracle/graal/blob/master/LICENSE + https://www.graalvm.org/ + https://www.graalvm.org/docs/introduction/ + http://mail.openjdk.java.net/mailman/listinfo/graal-dev + https://github.com/oracle/graal/issues + https://github.com/oracle/graal + openjdk java jvm + GraalVM is a virtual machine to run applications in different programming languages such as Java, Scala, Kotlin, JavaScript, Python, C, C++ and many more + GraalVM is a virtual machine to run applications in different programming languages such as Java, Scala, Kotlin, JavaScript, Python, C, C++ and many more + + diff --git a/GraalVM-17/tools/chocolateyinstall.ps1 b/GraalVM-17/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000..4d9f124 --- /dev/null +++ b/GraalVM-17/tools/chocolateyinstall.ps1 @@ -0,0 +1,16 @@ +$programFiles = (${env:ProgramFiles}, ${env:ProgramFiles(x86)} -ne $null)[0] +$installDir = "$programFiles\GraalVM" +$version = "17.0.9+9.1" + +$packageArgs = @{ + PackageName = $env:ChocolateyPackageName + UnzipLocation = $targetDir = $installDir + Url64bit = 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_windows-x64_bin.zip' + Checksum64 = '285e045bfc0b87d2b61958fea97444c3c6c7e68fba3fdbbe146622328b52ec38' + ChecksumType64 = 'sha256' +} + +Install-ChocolateyZipPackage @packageArgs +Install-ChocolateyEnvironmentVariable 'JAVA_HOME' $targetDir\graalvm-community-openjdk-$version 'Machine' +# The full path instead of the %JAVA_HOME% is needed so it can be removed with the Chocolatey Uninstall +Install-ChocolateyPath $targetDir\graalvm-community-openjdk-$version\bin -PathType 'Machine' diff --git a/GraalVM-17/tools/chocolateyuninstall.ps1 b/GraalVM-17/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000..d03a39d --- /dev/null +++ b/GraalVM-17/tools/chocolateyuninstall.ps1 @@ -0,0 +1,29 @@ +$programFiles = (${env:ProgramFiles}, ${env:ProgramFiles(x86)} -ne $null)[0] +$installDir = "$programFiles\GraalVM" +$version = "17.0.9+9.1" + +Uninstall-ChocolateyEnvironmentVariable 'JAVA_HOME' 'Machine' +rm -r "$installDir\graalvm-community-openjdk-$version" + +$pathToUnInstall = "$installDir\graalvm-community-openjdk-$version\bin" +$pathType = 'Machine' + +$statementTerminator = ";" + +$actualPath = [System.Collections.ArrayList](Get-EnvironmentVariable -Name 'Path' -Scope 'Machine' -PreserveVariables).split($statementTerminator) + +if ($actualPath -contains $pathToUnInstall) +{ + Write-Host "PATH environment variable contains $pathToUnInstall. Removing..." + + $actualPath.Remove($pathToUnInstall) + $newPath = $actualPath -Join $statementTerminator + + $cmd = "Set-EnvironmentVariable -Name 'Path' -Value `'$newPath`' -Scope 'Machine'" + + if (Test-ProcessAdminRights) { + Invoke-Expression $cmd + } else { + Start-ChocolateyProcessAsAdmin "$cmd" + } +}