Skip to content

Commit

Permalink
Fix download links, use JRE17
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Dec 2, 2021
1 parent 92e49c2 commit 9c5d379
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 29 deletions.
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Installer [![Build Status](https://travis-ci.com/panda-lang/installer.svg?branch=master)](https://travis-ci.com/panda-lang/installer)
# Installer
Install jvm-based version of Panda using a fancy installer.
The installer downloads the latest version of Panda and creates necessary file associations.
It also delivers the latest version of JRE used by Panda.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "panda-installer",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"author": "dzikoysk <[email protected]>",
"repository": {
Expand Down
16 changes: 7 additions & 9 deletions src/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ const { promisify } = require('util')
const got = require('got')
const pipeline = promisify(stream.pipeline)

const adoptOpenJDK = 'https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7_openj9-0.24.0/OpenJDK15U-jre_x64_windows_openj9_15.0.2_7_openj9-0.24.0.zip'
const bellSoftJre17 = 'https://download.bell-sw.com/java/17.0.1+12/bellsoft-jre17.0.1+12-windows-amd64.zip'
const pandaRepository = 'https://repo.panda-lang.org/releases/org/panda-lang/panda-standalone'
const latestVersionEndpoint = 'https://repo.panda-lang.org/api/maven/latest/releases/org/panda-lang/panda-standalone'

const toEntry = (type, value) => {
return {
Expand All @@ -37,7 +38,7 @@ module.exports = {
fs.mkdirSync(directory)
}

const jreArchive = path.resolve(directory, 'jre15.zip')
const jreArchive = path.resolve(directory, 'jre17.zip')
const jvmDirectory = path.resolve(directory, 'jvm')
const pandaDirectory = path.resolve(directory, 'panda')

Expand All @@ -58,22 +59,19 @@ module.exports = {

// Download JVM

const adoptOpenJDKStream = got.stream(adoptOpenJDK)
adoptOpenJDKStream.on('downloadProgress', progress => event.reply('progress', 0.3 + (progress.percent / 2)))

await pipeline(adoptOpenJDKStream, fs.createWriteStream(jreArchive))
const jdkStream = got.stream(bellSoftJre17)
jdkStream.on('downloadProgress', progress => event.reply('progress', 0.3 + (progress.percent / 2)))
await pipeline(jdkStream, fs.createWriteStream(jreArchive))
fs.createReadStream(jreArchive).pipe(unzipper.Extract({ path: jvmDirectory }));
event.reply('progress', 0.8)

fs.unlinkSync(jreArchive)
const versions = fs.readdirSync(jvmDirectory)
const jreDirectory = path.resolve(jvmDirectory, versions.sort()[0])

event.reply('progress', 0.9)

// Download latest version of Panda

const latest = (await got(pandaRepository + '/latest')).body
const latest = (await got(latestVersionEndpoint)).body
console.log(pandaRepository + '/' + latest + '/panda-standalone-' + latest + '-all.jar')

const pandaStream = got.stream(pandaRepository + '/' + latest + '/panda-standalone-' + latest + '-all.jar')
Expand Down

2 comments on commit 9c5d379

@FinnT730
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you beat me to it :P
Sorry I could not make a PR to fix it in the end, school stuff was busy

@dzikoysk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FinnT730 I had to fix this for Advent of Code 2021: https://github.com/dzikoysk/advent-of-code :P Also changes in Reposilite 3.x forced me to update other links

Please sign in to comment.