cicy-desktop 2.1.296 → 2.1.297

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.
@@ -119,6 +119,19 @@ jobs:
119
119
  if (-not $exe) { Write-Error "no exe found in dist"; exit 1 }
120
120
  $base = "oss://cicy-1372193042-cn/releases"
121
121
 
122
+ # 0) WSL2 内核裸文件(一次性,已存在就跳过):精简版 Windows 没有 msiexec 装不了
123
+ # wsl_update_x64.msi,桌面端改为直接下这个文件放到 System32\lxss\tools\kernel。
124
+ $kernelKey = "$base/wsl-kernel/kernel"
125
+ & $oss stat "$kernelKey" 2>$null | Out-Null
126
+ if ($LASTEXITCODE -ne 0) {
127
+ Write-Host "Publishing raw WSL2 kernel -> $kernelKey"
128
+ Invoke-WebRequest -Uri "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi" -OutFile wsl_update_x64.msi
129
+ $kdir = Join-Path $PWD "wsl-kernel-extract"
130
+ Start-Process msiexec.exe -ArgumentList "/a","`"$PWD\wsl_update_x64.msi`"","/qn","TARGETDIR=$kdir" -Wait
131
+ $kfile = Get-ChildItem $kdir -Recurse -File | Where-Object { $_.Name -eq "kernel" } | Select-Object -First 1
132
+ if ($kfile) { & $oss cp "$($kfile.FullName)" "$kernelKey" -f --acl public-read } else { Write-Warning "kernel not found in msi extract" }
133
+ } else { Write-Host "WSL2 kernel already on OSS, skip" }
134
+
122
135
  # 1) 永久版本化副本(unique key — 不会被后续发版覆盖)
123
136
  $verKey = "$base/cicy-desktop-$version.exe"
124
137
  Write-Host "Uploading versioned -> $verKey"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cicy-desktop",
3
- "version": "2.1.296",
3
+ "version": "2.1.297",
4
4
  "description": "CiCy - AI-powered operating system browser",
5
5
  "main": "src/main.js",
6
6
  "bin": {
@@ -668,6 +668,8 @@ function featureEnabled(feature) {
668
668
  }
669
669
 
670
670
  const WSL_KERNEL_MSI_URL = process.env.CICY_WSL_KERNEL_URL || "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi";
671
+ // 裸内核文件(由发布工作流从 MSI 解出后放到 OSS):精简版 Windows 没有 msiexec 时直接放到位。
672
+ const WSL_KERNEL_RAW_URL = process.env.CICY_WSL_KERNEL_RAW_URL || (require("./mirrors").OSS_RELEASES_BASE + "/wsl-kernel/kernel");
671
673
  // WSL2 kernel present? The inbox (feature-based) WSL keeps it at System32\lxss\tools\kernel;
672
674
  // the Store WSL bundles its own, in which case the file is absent but `wsl --status`
673
675
  // reports a kernel version — callers treat "functional + version" as present too.
@@ -742,7 +744,15 @@ function elevatedWslSetup({ emit, need = {} } = {}) {
742
744
  ' & $SFC /scannow | Out-Null; Say ("sfc exit=" + $LASTEXITCODE)',
743
745
  ' foreach ($f in $bad) { $c = En $f }',
744
746
  '}',
745
- `if (Test-Path "${msi.replace(/"/g, '""')}") { $p = Start-Process $MSIEXEC -ArgumentList "/i","\`"${msi.replace(/"/g, '""')}\`"","/qn","/norestart" -Wait -PassThru; Say ("kernel msi exit=" + $p.ExitCode) }`,
747
+ `$KDIR = Join-Path $S32 "lxss\\tools"; $KFILE = Join-Path $KDIR "kernel"`,
748
+ `if (-not (Test-Path $KFILE)) {`,
749
+ ` if ((Test-Path $MSIEXEC) -and (Test-Path "${msi.replace(/"/g, '""')}")) { $p = Start-Process $MSIEXEC -ArgumentList "/i","\`"${msi.replace(/"/g, '""')}\`"","/qn","/norestart" -Wait -PassThru; Say ("kernel msi exit=" + $p.ExitCode) }`,
750
+ ` if (-not (Test-Path $KFILE)) {`,
751
+ ` Say "msiexec missing or failed — downloading the raw WSL2 kernel file"`,
752
+ ` New-Item -ItemType Directory -Force $KDIR | Out-Null`,
753
+ ` try { Invoke-WebRequest -UseBasicParsing -Uri "${WSL_KERNEL_RAW_URL}" -OutFile $KFILE; Say ("kernel file " + (Get-Item $KFILE).Length + " bytes") } catch { Say ("kernel download failed: " + $_.Exception.Message) }`,
754
+ ` }`,
755
+ `}`,
746
756
  'Say ("final subsystem=" + (St "Microsoft-Windows-Subsystem-Linux") + " vmPlatform=" + (St "VirtualMachinePlatform"))',
747
757
  'Say "DONE"',
748
758
  ].join("\r\n");
@@ -79,3 +79,10 @@ test("missing WSL2 kernel is installed through the same single elevation", () =>
79
79
  assert.match(d, /if \(!wslKernelPresent\(\)\) \{[^]*elevatedWslSetup\(\{ emit, need: \{\} \}\)/);
80
80
  assert.match(d, /reason: "wsl_kernel_missing"/);
81
81
  });
82
+
83
+ test("kernel install falls back to the raw kernel file when msiexec is absent", () => {
84
+ const d = read("src/sidecar/docker.js");
85
+ assert.match(d, /WSL_KERNEL_RAW_URL/);
86
+ assert.match(d, /msiexec missing or failed/);
87
+ assert.match(read(".github/workflows/windows-exe-release.yml"), /wsl-kernel\/kernel/);
88
+ });