diff --git a/dist/setup/index.js b/dist/setup/index.js index d614737..120da8b 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -123970,6 +123970,11 @@ class MicrosoftDistributions extends base_installer_1.JavaBase { let javaArchivePath = yield tc.downloadTool(javaRelease.url); core.info(`Extracting Java archive...`); const extension = (0, util_1.getDownloadArchiveExtension)(); + // Rename archive to add extension because after downloading + // archive does not contain extension type and it leads to some issues + // on Windows runners without PowerShell Core. + // + // For default PowerShell Windows it should contain extension type to unpack it. if (process.platform === 'win32' && (this.architecture === 'arm64' || this.architecture === 'aarch64')) { const javaArchivePathRenamed = `${javaArchivePath}.zip`; diff --git a/src/distributions/microsoft/installer.ts b/src/distributions/microsoft/installer.ts index 1b68ef3..cc09955 100644 --- a/src/distributions/microsoft/installer.ts +++ b/src/distributions/microsoft/installer.ts @@ -30,6 +30,11 @@ export class MicrosoftDistributions extends JavaBase { core.info(`Extracting Java archive...`); const extension = getDownloadArchiveExtension(); + // Rename archive to add extension because after downloading + // archive does not contain extension type and it leads to some issues + // on Windows runners without PowerShell Core. + // + // For default PowerShell Windows it should contain extension type to unpack it. if ( process.platform === 'win32' && (this.architecture === 'arm64' || this.architecture === 'aarch64') @@ -38,6 +43,7 @@ export class MicrosoftDistributions extends JavaBase { await fs.renameSync(javaArchivePath, javaArchivePathRenamed); javaArchivePath = javaArchivePathRenamed; } + const extractedJavaPath = await extractJdkFile(javaArchivePath, extension); const archiveName = fs.readdirSync(extractedJavaPath)[0];