Skip to content

Commit 58b81a1

Browse files
prathikrPrathik Rao
andauthored
impl (#431)
Co-authored-by: Prathik Rao <prathikrao@microsoft.com>
1 parent 75973e6 commit 58b81a1

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

sdk_v2/js/script/install.cjs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,16 @@ const ARTIFACTS = [
5656
{
5757
name: useWinML ? 'Microsoft.AI.Foundry.Local.Core.WinML' : 'Microsoft.AI.Foundry.Local.Core',
5858
version: useNightly ? undefined : useWinML ? '0.9.0.7-dev.20260209T090407.b5352143' : '0.9.0.8-dev.20260209T090216.b5352143', // Set later using resolveLatestVersion if undefined
59-
files: ['Microsoft.AI.Foundry.Local.Core'],
6059
feed: ORT_NIGHTLY_FEED
6160
},
6261
{
6362
name: os.platform() === 'linux' ? 'Microsoft.ML.OnnxRuntime.Gpu.Linux' : 'Microsoft.ML.OnnxRuntime.Foundry',
64-
version: os.platform() === 'linux' ? '1.24.1' : '1.24.1.1', // Hardcoded stable version
65-
files: RID == 'win-x64' ? ['onnxruntime', 'dxil', 'dxcompiler'] : ['onnxruntime'],
63+
version: os.platform() === 'linux' ? '1.24.1' : '1.24.1.1',
6664
feed: os.platform() === 'linux' ? NUGET_FEED : ORT_NIGHTLY_FEED
6765
},
6866
{
6967
name: useWinML ? 'Microsoft.ML.OnnxRuntimeGenAI.WinML' : 'Microsoft.ML.OnnxRuntimeGenAI.Foundry',
70-
version: '0.12.0', // Hardcoded dev version (until we upload 0.12.0 to ORT or NuGet)
71-
files: ['onnxruntime-genai'],
68+
version: '0.12.0',
7269
feed: ORT_NIGHTLY_FEED
7370
}
7471
];
@@ -240,22 +237,22 @@ async function installPackage(artifact, tempDir) {
240237
const targetPathPrefix = `runtimes/${RID}/native/`.toLowerCase();
241238

242239
let found = false;
243-
for (const fileBase of artifact.files) {
244-
const fileName = `${fileBase}${ext}`;
245-
// Look for entry ending with fileName and containing runtimes/RID/native/
246-
const entry = zipEntries.find(e => {
247-
const entryPathLower = e.entryName.toLowerCase();
248-
return entryPathLower.includes(targetPathPrefix) && entryPathLower.endsWith(fileName.toLowerCase());
249-
});
250-
251-
if (entry) {
240+
241+
console.log(` Scanning for all ${ext} files in ${targetPathPrefix}...`);
242+
const entries = zipEntries.filter(e => {
243+
const entryPathLower = e.entryName.toLowerCase();
244+
return entryPathLower.includes(targetPathPrefix) && entryPathLower.endsWith(ext);
245+
});
246+
247+
if (entries.length > 0) {
248+
entries.forEach(entry => {
252249
console.log(` Found ${entry.entryName}`);
253250
zip.extractEntryTo(entry, BIN_DIR, false, true);
254-
console.log(` Extracted via AdmZip to ${path.join(BIN_DIR, entry.name)}`);
255-
found = true;
256-
} else {
257-
console.warn(` ⚠ File ${fileName} not found for RID ${RID} in package.`);
258-
}
251+
console.log(` Extracted ${entry.name}`);
252+
});
253+
found = true;
254+
} else {
255+
console.warn(` ⚠ No files found for RID ${RID} in package.`);
259256
}
260257

261258
// After extracting, update the packages/@foundry-local-core/RID/package.json version to match the downloaded artifact

0 commit comments

Comments
 (0)