electrobun 0.0.19-beta.92 → 0.0.19-beta.95

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.
@@ -13,6 +13,50 @@ import { native } from '../proc/native';
13
13
  // native.symbols.killApp();
14
14
  // }, 1000)
15
15
 
16
+ // Create or update run.sh launcher script for Linux
17
+ async function createLinuxLauncherScript(appDir: string): Promise<void> {
18
+ const parentDir = dirname(appDir);
19
+ const launcherPath = join(parentDir, "run.sh");
20
+
21
+ const launcherContent = `#!/bin/bash
22
+ # Electrobun App Launcher
23
+ # This script sets up the environment and launches the app
24
+
25
+ # Get the directory where this script is located
26
+ SCRIPT_DIR="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
27
+ APP_DIR="$SCRIPT_DIR/app"
28
+
29
+ cd "$APP_DIR/bin"
30
+ export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
31
+
32
+ # Force X11 backend for compatibility
33
+ export GDK_BACKEND=x11
34
+
35
+ # Check if CEF libraries exist and set LD_PRELOAD
36
+ if [ -f "./libcef.so" ] || [ -f "./libvk_swiftshader.so" ]; then
37
+ CEF_LIBS=""
38
+ [ -f "./libcef.so" ] && CEF_LIBS="./libcef.so"
39
+ if [ -f "./libvk_swiftshader.so" ]; then
40
+ if [ -n "$CEF_LIBS" ]; then
41
+ CEF_LIBS="$CEF_LIBS:./libvk_swiftshader.so"
42
+ else
43
+ CEF_LIBS="./libvk_swiftshader.so"
44
+ fi
45
+ fi
46
+ export LD_PRELOAD="$CEF_LIBS"
47
+ fi
48
+
49
+ exec ./launcher "$@"
50
+ `;
51
+
52
+ await Bun.write(launcherPath, launcherContent);
53
+
54
+ // Make it executable
55
+ execSync(`chmod +x "${launcherPath}"`);
56
+
57
+ console.log(`Created/updated Linux launcher script: ${launcherPath}`);
58
+ }
59
+
16
60
  // Cross-platform app data directory
17
61
  function getAppDataDir(): string {
18
62
  switch (currentOS) {
@@ -473,6 +517,9 @@ const Updater = {
473
517
 
474
518
  // Move new app to app location
475
519
  renameSync(newAppBundlePath, runningAppBundlePath);
520
+
521
+ // Recreate run.sh launcher script
522
+ await createLinuxLauncherScript(runningAppBundlePath);
476
523
  } else {
477
524
  // On Windows, use versioned app folders
478
525
  const parentDir = dirname(runningAppBundlePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.92",
3
+ "version": "0.0.19-beta.95",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",
package/src/cli/index.ts CHANGED
@@ -1445,7 +1445,7 @@ if (commandArg === "init") {
1445
1445
  dereference: true,
1446
1446
  });
1447
1447
 
1448
- buildIcons(appBundleFolderResourcesPath);
1448
+ buildIcons(selfExtractingBundle.appBundleFolderResourcesPath);
1449
1449
  await Bun.write(
1450
1450
  join(selfExtractingBundle.appBundleFolderContentsPath, "Info.plist"),
1451
1451
  InfoPlistContents
@@ -1477,7 +1477,7 @@ if (commandArg === "init") {
1477
1477
  // Note: use ULFO (lzfse) for better compatibility with large CEF frameworks and modern macOS
1478
1478
  execSync(
1479
1479
  `hdiutil create -volname "${appFileName}" -srcfolder ${escapePathForTerminal(
1480
- appBundleFolderPath
1480
+ selfExtractingBundle.appBundleFolderPath
1481
1481
  )} -ov -format ULFO ${escapePathForTerminal(dmgPath)}`
1482
1482
  );
1483
1483