@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaidenlabs/uso",
3
- "version": "1.1.44",
3
+ "version": "1.1.46",
4
4
  "description": "Universal Solana Orchestrator - A one-command setup tool for Solana and Anchor development environments on Windows, macOS, and Linux.",
5
5
  "bin": {
6
6
  "uso": "bin/index.js"
@@ -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 (This may prompt for Admin access)...");
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
- // This command usually triggers a UAC prompt and a console window.
26
- // We can't fully hide the install process itself, but we can automate it.
27
- const install = shell.exec('wsl --install -d Ubuntu');
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
- if (install.code !== 0) {
30
- log.error("āŒ Failed to install Ubuntu.");
31
- log.warn("šŸ‘‰ Try running manually: wsl --install -d Ubuntu");
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.");