@xaidenlabs/uso 1.1.44 ā 1.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/platforms/wsl.js +34 -7
package/package.json
CHANGED
package/src/platforms/wsl.js
CHANGED
|
@@ -4,6 +4,8 @@ const { isWslInstalled, runWsl, toWslPath } = require('../utils/wsl-bridge');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const os = require('os');
|
|
7
|
+
const { spawnSync } = require('child_process');
|
|
8
|
+
const chalk = require('chalk');
|
|
7
9
|
|
|
8
10
|
const installWsl = async () => {
|
|
9
11
|
log.header("š§ Configuring Stealth WSL Environment...");
|
|
@@ -20,15 +22,40 @@ const installWsl = async () => {
|
|
|
20
22
|
// We target 'Ubuntu' as the standard distro.
|
|
21
23
|
const checkDistro = shell.exec('wsl -l -v', { silent: true });
|
|
22
24
|
if (!checkDistro.stdout.includes('Ubuntu')) {
|
|
23
|
-
log.info("š¦ Installing Ubuntu (
|
|
25
|
+
log.info("š¦ Installing Ubuntu (Please approve UAC prompt if asked)...");
|
|
26
|
+
log.warn("ā³ This may take a few minutes (Downloading ~500MB)...");
|
|
27
|
+
|
|
28
|
+
// Helper to try install commands
|
|
29
|
+
const tryInstall = (args, description) => {
|
|
30
|
+
log.info(`š Attempting: ${description}...`);
|
|
31
|
+
// Fix Deprecation: shell: false is safer and prevents warning
|
|
32
|
+
const proc = spawnSync('wsl', args, { stdio: 'inherit', shell: false });
|
|
33
|
+
return proc.status === 0;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Attempt 1: Standard Install
|
|
37
|
+
let success = tryInstall(['--install', '-d', 'Ubuntu'], 'Standard Install');
|
|
38
|
+
|
|
39
|
+
// Attempt 2: Update WSL Kernel (Fixes network/protocol issues)
|
|
40
|
+
if (!success) {
|
|
41
|
+
log.warn("ā ļø Standard install failed. Attempting to update WSL kernel...");
|
|
42
|
+
spawnSync('wsl', ['--update'], { stdio: 'inherit', shell: false });
|
|
43
|
+
success = tryInstall(['--install', '-d', 'Ubuntu'], 'Install after Update');
|
|
44
|
+
}
|
|
24
45
|
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
// Attempt 3: Web Download (Bypasses Microsoft Store blocks)
|
|
47
|
+
if (!success) {
|
|
48
|
+
log.warn("ā ļø Still failing. Trying --web-download (Bypasses Store)...");
|
|
49
|
+
success = tryInstall(['--install', '-d', 'Ubuntu', '--web-download'], 'Web Download Install');
|
|
50
|
+
}
|
|
28
51
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
log.
|
|
52
|
+
// Final Failure Handler
|
|
53
|
+
if (!success) {
|
|
54
|
+
log.error("ā Failed to install Ubuntu after multiple attempts.");
|
|
55
|
+
log.error("š Possible Causes: Internet Timeout, Firewall, or VPN.");
|
|
56
|
+
log.warn("\nš ACTION REQUIRED: Run this command manually in PowerShell as Administrator:");
|
|
57
|
+
console.log(chalk.bold.yellow(" wsl --install -d Ubuntu --web-download"));
|
|
58
|
+
log.warn("\nOnce that completes successfully, run 'uso setup --wsl' again.");
|
|
32
59
|
return false;
|
|
33
60
|
}
|
|
34
61
|
log.success("ā
Ubuntu installed.");
|