diff --git a/biome.json b/biome.json index 96e61d4..5720642 100644 --- a/biome.json +++ b/biome.json @@ -1,6 +1,6 @@ { "files": { - "ignore": ["package.json", "__test__/*.json"] + "ignore": ["package.json", "__test__/*.json", "dist"] }, "linter": { "enabled": true, diff --git a/src/index.ts b/src/index.ts index 6054c04..9260082 100644 --- a/src/index.ts +++ b/src/index.ts @@ -31,7 +31,8 @@ async function run(): Promise { const result = await (async () => { const installed = await installer.checkInstalled(version); if (installed) { - core.info(`Edge ${version} is already installed @ ${installed.root}`); + const bin = path.join(installed.root, installed.bin); + core.info(`Edge ${version} is already installed @ ${bin}`); return installed; } diff --git a/src/installer_mac.ts b/src/installer_mac.ts index ef348de..4b99bdc 100644 --- a/src/installer_mac.ts +++ b/src/installer_mac.ts @@ -75,8 +75,18 @@ export class MacInstaller implements Installer { await exec.exec("gzip", ["--decompress", "App.gz"], { cwd: pkgroot }); await exec.exec("cpio", ["--extract", "--file", "App"], { cwd: pkgroot }); - const app = path.join(pkgroot, this.appName(version)); - const root = await tc.cacheDir(app, "msedge", version); + // tc.cacheDir copies the *contents* of the source dir into the cache root, + // so we wrap the .app inside a subdirectory to preserve the .app name and + // extension. Without this, the bundle root in the cache lacks the .app + // suffix and Edge refuses to launch (exits with null on macOS 15+). + const wrapperDir = path.join(extdir, "wrapper"); + await fs.promises.mkdir(wrapperDir); + await fs.promises.rename( + path.join(pkgroot, this.appName(version)), + path.join(wrapperDir, this.appName(version)), + ); + + const root = await tc.cacheDir(wrapperDir, "msedge", version); return { root, bin: this.binPath(version) }; } @@ -84,13 +94,13 @@ export class MacInstaller implements Installer { private binPath(version: versions.Version): string { switch (version) { case versions.StableVersion: - return "Contents/MacOS/Microsoft Edge"; + return "Microsoft Edge.app/Contents/MacOS/Microsoft Edge"; case versions.BetaVersion: - return "Contents/MacOS/Microsoft Edge Beta"; + return "Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta"; case versions.DevVersion: - return "Contents/MacOS/Microsoft Edge Dev"; + return "Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev"; case versions.CanaryVersion: - return "Contents/MacOS/Microsoft Edge Canary"; + return "Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary"; } } diff --git a/src/installer_windows.ts b/src/installer_windows.ts index d28499a..52585c8 100644 --- a/src/installer_windows.ts +++ b/src/installer_windows.ts @@ -101,12 +101,11 @@ export class WindowsInstaller implements Installer { async test(_version: versions.Version): Promise { const msedgeBin = await io.which("msedge", true); - await exec.exec("wmic", [ - "datafile", - "where", - `name="${msedgeBin.replace(/\\/g, "\\\\")}"`, - "get", - "version", + await exec.exec("powershell", [ + "-NoProfile", + "-NonInteractive", + "-Command", + `(Get-Item (Get-Command '${msedgeBin}').Source).VersionInfo.ProductVersion`, ]); } }