feat: enhance native binary resolution and add bundled Node.js runtime

- Refactored gelectron.js to improve native binary discovery with additional paths and environment variable support.
- Implemented a function to find the Node.js runtime, allowing bundled Node.js to be used when available.
- Updated package.json to include gelectron-packager as a CLI command.
- Enhanced gelectron-packager.js to locate installed gelectron runtime and added compatibility for bundled Node.js.
- Modified install-release.sh to download and install a private Node.js runtime alongside the gelectron binary.
- Updated NSIS installer script to include bundled Node.js runtime.
- Enhanced AppImage and DMG packaging scripts to include Node.js runtime.
- Added clipboard, nativeTheme, and screen modules for Electron compatibility.
- Implemented native bridge request handling for clipboard operations.
This commit is contained in:
miles committed 2026-09-05 22:23:37 -05:00
1 parent 247daa6460
commit 1689adffc6
16 files changed
+816 -79

No files matched your search

+17 -2
View File
@@ -1,6 +1,7 @@
# Gelectron Windows installer builder (NSIS)
#
# Stages the payload and compiles the installer EXE with makensis:
# Stages the payload (gelectron runtime + bundled Node.js + compat layer) and
# compiles the installer EXE with makensis:
# Gelectron-<version>-<arch>.exe
#
# Usage:
@@ -17,7 +18,8 @@ param(
[Parameter(Mandatory = $true)][string]$Version,
[string]$Arch = "x64",
[string]$Out = "dist",
[string]$NsiPath = "scripts/pkg/gelectron.nsi"
[string]$NsiPath = "scripts/pkg/gelectron.nsi",
[string]$NodeVersion = "20.18.1"
)
$ErrorActionPreference = "Stop"
@@ -35,6 +37,19 @@ try {
Copy-Item -Recurse -Force $Compat (Join-Path $Stage "compat")
Copy-Item $NsiPath (Join-Path $Stage "gelectron.nsi") -Force
# Bundled Node.js runtime so the installed CLI works with no system Node.
$NodeArch = if ($Arch -eq "arm64") { "arm64" } else { "x64" }
$NodeArchive = Join-Path $Stage "node.zip"
$NodeUrl = "https://nodejs.org/dist/v$NodeVersion/node-v$NodeVersion-win-$NodeArch.zip"
Write-Host "==> Downloading Node.js v$NodeVersion ($NodeArch)..."
Invoke-WebRequest -Uri $NodeUrl -OutFile $NodeArchive -UseBasicParsing
$NodeExtract = Join-Path $Stage "node"
Expand-Archive -Path $NodeArchive -DestinationPath $NodeExtract -Force
$NodeExe = Get-ChildItem $NodeExtract -Recurse -Filter node.exe | Select-Object -First 1
if (-not $NodeExe) { throw "node.exe not found in Node.js archive" }
Copy-Item $NodeExe.FullName (Join-Path $Stage "node.exe") -Force
Write-Host "==> Compiling installer (makensis)..."
Push-Location $Stage
try {