From 94e87238756845a653cac6251e89d8e549529ecb Mon Sep 17 00:00:00 2001 From: tsharmaMW Date: Fri, 28 Mar 2025 14:33:51 +0530 Subject: [PATCH 1/3] add runtime directory to system PATH for windows --- src/install.ts | 4 ++++ src/install.unit.test.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/install.ts b/src/install.ts index a443179..991c321 100644 --- a/src/install.ts +++ b/src/install.ts @@ -54,6 +54,10 @@ export async function install(platform: string, architecture: string, release: s core.setOutput('matlabroot', destination); await matlab.setupBatch(platform, matlabArch); + + if(platform === "win32") { + core.addPath(path.join(destination, "runtime", matlabArch)); + } }); return; diff --git a/src/install.unit.test.ts b/src/install.unit.test.ts index 44b876e..04e8408 100644 --- a/src/install.unit.test.ts +++ b/src/install.unit.test.ts @@ -157,4 +157,12 @@ describe("install procedure", () => { expect(matlabSetupBatchMock).toHaveBeenCalledWith("darwin", "x64"); expect(mpmSetupMock).toHaveBeenCalledWith("darwin", "x64"); }); + + it("adds runtime path for Windows platform", async () => { + await expect(install.install("win32", arch, release, products, useCache)).resolves.toBeUndefined(); + expect(addPathMock).toHaveBeenCalledTimes(2); + expect(addPathMock).toHaveBeenCalledWith(expect.stringContaining("bin")); + expect(addPathMock).toHaveBeenCalledWith(expect.stringContaining("runtime")); + }); + }); From 867efa5908aa04af0c987331f157989559533c85 Mon Sep 17 00:00:00 2001 From: tsharmaMW Date: Tue, 1 Apr 2025 12:49:00 +0530 Subject: [PATCH 2/3] update path according to arch --- src/install.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/install.ts b/src/install.ts index 991c321..3e81121 100644 --- a/src/install.ts +++ b/src/install.ts @@ -56,7 +56,11 @@ export async function install(platform: string, architecture: string, release: s await matlab.setupBatch(platform, matlabArch); if(platform === "win32") { - core.addPath(path.join(destination, "runtime", matlabArch)); + if(matlabArch === "x86") { + core.addPath(path.join(destination, "runtime", "win32")); + } else { + core.addPath(path.join(destination, "runtime", "win64")); + } } }); From b4b81f169c8381dd3dbfc8049aa61023f87febbc Mon Sep 17 00:00:00 2001 From: tsharmaMW Date: Wed, 2 Apr 2025 10:58:29 +0530 Subject: [PATCH 3/3] fix formatting --- src/install.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/install.ts b/src/install.ts index 3e81121..2670592 100644 --- a/src/install.ts +++ b/src/install.ts @@ -55,8 +55,8 @@ export async function install(platform: string, architecture: string, release: s await matlab.setupBatch(platform, matlabArch); - if(platform === "win32") { - if(matlabArch === "x86") { + if (platform === "win32") { + if (matlabArch === "x86") { core.addPath(path.join(destination, "runtime", "win32")); } else { core.addPath(path.join(destination, "runtime", "win64"));