diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 1074f03..089c760 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -1,5 +1,7 @@ import * as installer from '../src/installer' +import * as semver from 'semver' + const testVersions = ['v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0'] describe('installer tests', () => { @@ -28,4 +30,14 @@ describe('installer tests', () => { }) }) }) + describe('node-semver behaviour', () => { + describe('Windows installer change', () => { + it('Correctly understands >1.4.0', () => { + expect(semver.gtr('1.4.0-rc1', '1.3', {includePrerelease: true})).toBeTruthy() + expect(semver.gtr('1.4.0-DEV', '1.3', {includePrerelease: true})).toBeTruthy() + expect(semver.gtr('1.3.1', '1.3', {includePrerelease: true})).toBeFalsy() + expect(semver.gtr('1.3.2-rc1', '1.3', {includePrerelease: true})).toBeFalsy() + }) + }) + }) }) diff --git a/lib/installer.js b/lib/installer.js index 5397692..d57dd8a 100644 --- a/lib/installer.js +++ b/lib/installer.js @@ -119,7 +119,13 @@ function installJulia(version, arch) { return `${process.env.HOME}/julia`; case 'win32': const juliaInstallationPath = path.join('C:', 'Julia'); - yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${juliaInstallationPath}" -NoNewWindow -Wait`]); + if (version == 'nightly' || semver.gtr(version, '1.3', { includePrerelease: true })) { + // The installer changed in 1.4: https://github.com/JuliaLang/julia/blob/ef0c9108b12f3ae177c51037934351ffa703b0b5/NEWS.md#build-system-changes + yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/SILENT /dir=${juliaInstallationPath}" -NoNewWindow -Wait`]); + } + else { + yield exec.exec('powershell', ['-Command', `Start-Process -FilePath ${juliaDownloadPath} -ArgumentList "/S /D=${juliaInstallationPath}" -NoNewWindow -Wait`]); + } return juliaInstallationPath; case 'darwin': yield exec.exec('hdiutil', ['attach', juliaDownloadPath]); diff --git a/src/installer.ts b/src/installer.ts index ac0034d..08e7226 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -112,7 +112,12 @@ export async function installJulia(version: string, arch: string): Promise