mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-30 04:03:48 +02:00
feat: download and include dotnet runtime in the appimage on linux (#1289)
This commit is contained in:
@@ -13,6 +13,15 @@ const { spawn, spawnSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const https = require('https');
|
||||
|
||||
// Include bundled .NET runtime
|
||||
const bundledDotNetPath = path.join(process.resourcesPath, 'dotnet-runtime');
|
||||
const bundledDotnet = path.join(bundledDotNetPath, 'bin', 'dotnet');
|
||||
|
||||
if (fs.existsSync(bundledDotnet)) {
|
||||
process.env.DOTNET_ROOT = bundledDotNetPath;
|
||||
process.env.PATH = `${path.dirname(bundledDotnet)}:${process.env.PATH}`;
|
||||
}
|
||||
|
||||
if (!isDotNetInstalled()) {
|
||||
app.whenReady().then(() => {
|
||||
dialog.showErrorBox(
|
||||
@@ -24,7 +33,7 @@ if (!isDotNetInstalled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// get launch arguments
|
||||
// Get launch arguments
|
||||
let appImagePath = process.env.APPIMAGE;
|
||||
const args = process.argv.slice(1);
|
||||
const noInstall = args.includes('--no-install');
|
||||
@@ -527,6 +536,14 @@ function isDotNetInstalled() {
|
||||
// Assume .NET is already installed on macOS
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for bundled .NET runtime
|
||||
if (fs.existsSync(bundledDotnet)) {
|
||||
console.log('Using bundled .NET runtime at:', bundledDotNetPath);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Fallback to system .NET runtime
|
||||
const result = spawnSync('dotnet', ['--list-runtimes'], {
|
||||
encoding: 'utf-8'
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user